From 2d9afd0c2194b60689717c2a9dc36284f012f7b6 Mon Sep 17 00:00:00 2001 From: Gusted Date: Thu, 4 Apr 2024 18:02:24 +0200 Subject: [PATCH] [CHORE] Remove Microsoft SQL Server Support - Per https://codeberg.org/forgejo/discussions/issues/122 --- .gitea/issue_template/bug-report.yaml | 1 - Makefile | 61 +--------- assets/go-licenses.json | 15 --- cmd/doctor_convert.go | 15 +-- cmd/dump.go | 2 +- go.mod | 3 - go.sum | 10 -- models/activities/user_heatmap.go | 8 +- models/db/collation.go | 33 +----- models/db/common.go | 2 - models/db/convert.go | 27 ----- models/db/engine.go | 9 +- models/db/index.go | 29 ----- models/git/branch.go | 2 +- models/git/commit_status.go | 30 ----- models/migrations/base/db.go | 91 --------------- models/migrations/v1_11/v110.go | 3 - models/migrations/v1_12/v139.go | 7 +- models/migrations/v1_13/v145.go | 26 ----- models/migrations/v1_13/v151.go | 30 ----- models/migrations/v1_14/v158.go | 10 -- models/migrations/v1_14/v165.go | 16 +-- models/migrations/v1_15/v184.go | 9 +- models/migrations/v1_16/v210.go | 26 ----- models/migrations/v1_17/v220.go | 8 +- models/migrations/v1_17/v223.go | 9 +- models/migrations/v1_20/v245.go | 9 +- models/migrations/v1_22/v283.go | 21 +--- models/migrations/v1_22/v286.go | 32 ------ models/migrations/v1_8/v81.go | 2 - models/unittest/fixtures.go | 2 - modules/setting/database.go | 33 +----- options/locale/locale_ar.ini | 3 +- options/locale/locale_bg.ini | 2 +- options/locale/locale_cs-CZ.ini | 4 +- options/locale/locale_de-DE.ini | 3 +- options/locale/locale_el-GR.ini | 3 +- options/locale/locale_en-US.ini | 3 +- options/locale/locale_eo.ini | 2 +- options/locale/locale_es-ES.ini | 2 +- options/locale/locale_fi-FI.ini | 2 +- options/locale/locale_fil.ini | 2 +- options/locale/locale_fr-FR.ini | 4 +- options/locale/locale_is-IS.ini | 2 +- options/locale/locale_it-IT.ini | 3 +- options/locale/locale_ja-JP.ini | 2 +- options/locale/locale_lv-LV.ini | 2 +- options/locale/locale_nl-NL.ini | 3 +- options/locale/locale_pl-PL.ini | 2 +- options/locale/locale_pt-BR.ini | 2 +- options/locale/locale_pt-PT.ini | 3 +- options/locale/locale_ru-RU.ini | 3 +- options/locale/locale_sk-SK.ini | 2 +- options/locale/locale_sl.ini | 2 +- options/locale/locale_tr-TR.ini | 2 +- options/locale/locale_zh-CN.ini | 4 +- options/locale/locale_zh-TW.ini | 2 +- routers/web/web.go | 2 +- templates/admin/navbar.tmpl | 2 +- templates/admin/self_check.tmpl | 2 - tests/e2e/README.md | 15 +-- tests/integration/README.md | 15 +-- tests/integration/README_ZH.md | 14 +-- tests/integration/db_collation_test.go | 18 +-- .../migration-test/gitea-v1.6.4.mssql.sql.gz | Bin 12969 -> 0 bytes .../migration-test/gitea-v1.7.0.mssql.sql.gz | Bin 13068 -> 0 bytes .../migration-test/migration_test.go | 26 ----- tests/mssql.ini.tmpl | 107 ------------------ tests/test_utils.go | 12 -- web_src/js/features/install.js | 1 - 70 files changed, 70 insertions(+), 789 deletions(-) delete mode 100644 tests/integration/migration-test/gitea-v1.6.4.mssql.sql.gz delete mode 100644 tests/integration/migration-test/gitea-v1.7.0.mssql.sql.gz delete mode 100644 tests/mssql.ini.tmpl diff --git a/.gitea/issue_template/bug-report.yaml b/.gitea/issue_template/bug-report.yaml index 6edbca886f..6fab61fcdc 100644 --- a/.gitea/issue_template/bug-report.yaml +++ b/.gitea/issue_template/bug-report.yaml @@ -87,4 +87,3 @@ body: - SQLite - PostgreSQL - MySQL - - MSSQL diff --git a/Makefile b/Makefile index fec96de982..6a745edc7c 100644 --- a/Makefile +++ b/Makefile @@ -196,10 +196,6 @@ TEST_PGSQL_DBNAME ?= testgitea TEST_PGSQL_USERNAME ?= postgres TEST_PGSQL_PASSWORD ?= postgres TEST_PGSQL_SCHEMA ?= gtestschema -TEST_MSSQL_HOST ?= mssql:1433 -TEST_MSSQL_DBNAME ?= gitea -TEST_MSSQL_USERNAME ?= sa -TEST_MSSQL_PASSWORD ?= MwantsaSecurePassword1 .PHONY: all all: build @@ -309,7 +305,7 @@ clean: e2e*.test \ tests/integration/gitea-integration-* \ tests/integration/indexers-* \ - tests/mysql.ini tests/pgsql.ini tests/mssql.ini man/ \ + tests/mysql.ini tests/pgsql.ini man/ \ tests/e2e/gitea-e2e-*/ \ tests/e2e/indexers-*/ \ tests/e2e/reports/ tests/e2e/test-artifacts/ tests/e2e/test-snapshots/ @@ -612,27 +608,6 @@ test-pgsql\#%: integrations.pgsql.test generate-ini-pgsql .PHONY: test-pgsql-migration test-pgsql-migration: migrations.pgsql.test migrations.individual.pgsql.test -generate-ini-mssql: - sed -e 's|{{TEST_MSSQL_HOST}}|${TEST_MSSQL_HOST}|g' \ - -e 's|{{TEST_MSSQL_DBNAME}}|${TEST_MSSQL_DBNAME}|g' \ - -e 's|{{TEST_MSSQL_USERNAME}}|${TEST_MSSQL_USERNAME}|g' \ - -e 's|{{TEST_MSSQL_PASSWORD}}|${TEST_MSSQL_PASSWORD}|g' \ - -e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \ - -e 's|{{TEST_LOGGER}}|$(or $(TEST_LOGGER),test$(COMMA)file)|g' \ - -e 's|{{TEST_TYPE}}|$(or $(TEST_TYPE),integration)|g' \ - tests/mssql.ini.tmpl > tests/mssql.ini - -.PHONY: test-mssql -test-mssql: integrations.mssql.test generate-ini-mssql - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini ./integrations.mssql.test - -.PHONY: test-mssql\#% -test-mssql\#%: integrations.mssql.test generate-ini-mssql - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini ./integrations.mssql.test -test.run $(subst .,/,$*) - -.PHONY: test-mssql-migration -test-mssql-migration: migrations.mssql.test migrations.individual.mssql.test - .PHONY: playwright playwright: deps-frontend npx playwright install $(PLAYWRIGHT_FLAGS) @@ -669,14 +644,6 @@ test-e2e-pgsql: playwright e2e.pgsql.test generate-ini-pgsql test-e2e-pgsql\#%: playwright e2e.pgsql.test generate-ini-pgsql GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./e2e.pgsql.test -test.run TestE2e/$* -.PHONY: test-e2e-mssql -test-e2e-mssql: playwright e2e.mssql.test generate-ini-mssql - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini ./e2e.mssql.test -test.run TestE2e - -.PHONY: test-e2e-mssql\#% -test-e2e-mssql\#%: playwright e2e.mssql.test generate-ini-mssql - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini ./e2e.mssql.test -test.run TestE2e/$* - .PHONY: test-e2e-debugserver test-e2e-debugserver: e2e.sqlite.test generate-ini-sqlite sed -i s/3003/3000/g tests/sqlite.ini @@ -690,10 +657,6 @@ bench-sqlite: integrations.sqlite.test generate-ini-sqlite bench-mysql: integrations.mysql.test generate-ini-mysql GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./integrations.mysql.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench . -.PHONY: bench-mssql -bench-mssql: integrations.mssql.test generate-ini-mssql - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini ./integrations.mssql.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench . - .PHONY: bench-pgsql bench-pgsql: integrations.pgsql.test generate-ini-pgsql GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./integrations.pgsql.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench . @@ -712,9 +675,6 @@ integrations.mysql.test: git-check $(GO_SOURCES) integrations.pgsql.test: git-check $(GO_SOURCES) $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.pgsql.test -integrations.mssql.test: git-check $(GO_SOURCES) - $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mssql.test - integrations.sqlite.test: git-check $(GO_SOURCES) $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.sqlite.test -tags '$(TEST_TAGS)' @@ -734,11 +694,6 @@ migrations.pgsql.test: $(GO_SOURCES) generate-ini-pgsql $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.pgsql.test GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./migrations.pgsql.test -.PHONY: migrations.mssql.test -migrations.mssql.test: $(GO_SOURCES) generate-ini-mssql - $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mssql.test - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini ./migrations.mssql.test - .PHONY: migrations.sqlite.test migrations.sqlite.test: $(GO_SOURCES) generate-ini-sqlite $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.sqlite.test -tags '$(TEST_TAGS)' @@ -764,17 +719,6 @@ migrations.individual.pgsql.test: $(GO_SOURCES) migrations.individual.pgsql.test\#%: $(GO_SOURCES) generate-ini-pgsql GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$* - -.PHONY: migrations.individual.mssql.test -migrations.individual.mssql.test: $(GO_SOURCES) generate-ini-mssql - for pkg in $(MIGRATION_PACKAGES); do \ - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' -test.failfast $$pkg || exit 1; \ - done - -.PHONY: migrations.individual.mssql.test\#% -migrations.individual.mssql.test\#%: $(GO_SOURCES) generate-ini-mssql - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$* - .PHONY: migrations.individual.sqlite.test migrations.individual.sqlite.test: $(GO_SOURCES) generate-ini-sqlite for pkg in $(MIGRATION_PACKAGES); do \ @@ -791,9 +735,6 @@ e2e.mysql.test: $(GO_SOURCES) e2e.pgsql.test: $(GO_SOURCES) $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.pgsql.test -e2e.mssql.test: $(GO_SOURCES) - $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.mssql.test - e2e.sqlite.test: $(GO_SOURCES) $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.sqlite.test -tags '$(TEST_TAGS)' diff --git a/assets/go-licenses.json b/assets/go-licenses.json index d1062d747b..3275d76f2e 100644 --- a/assets/go-licenses.json +++ b/assets/go-licenses.json @@ -294,11 +294,6 @@ "path": "github.com/davecgh/go-spew/spew/LICENSE", "licenseText": "ISC License\n\nCopyright (c) 2012-2016 Dave Collins \u003cdave@davec.name\u003e\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n" }, - { - "name": "github.com/denisenkom/go-mssqldb", - "path": "github.com/denisenkom/go-mssqldb/LICENSE.txt", - "licenseText": "Copyright (c) 2012 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" - }, { "name": "github.com/dgryski/go-rendezvous", "path": "github.com/dgryski/go-rendezvous/LICENSE", @@ -504,16 +499,6 @@ "path": "github.com/golang-jwt/jwt/v5/LICENSE", "licenseText": "Copyright (c) 2012 Dave Grijalva\nCopyright (c) 2021 golang-jwt maintainers\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n" }, - { - "name": "github.com/golang-sql/civil", - "path": "github.com/golang-sql/civil/LICENSE", - "licenseText": "\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License." - }, - { - "name": "github.com/golang-sql/sqlexp", - "path": "github.com/golang-sql/sqlexp/LICENSE", - "licenseText": "Copyright (c) 2017 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" - }, { "name": "github.com/golang/geo", "path": "github.com/golang/geo/LICENSE", diff --git a/cmd/doctor_convert.go b/cmd/doctor_convert.go index 48c835ad0e..190b2fc2ef 100644 --- a/cmd/doctor_convert.go +++ b/cmd/doctor_convert.go @@ -17,7 +17,7 @@ import ( var cmdDoctorConvert = &cli.Command{ Name: "convert", Usage: "Convert the database", - Description: "A command to convert an existing MySQL database from utf8 to utf8mb4 or MSSQL database from varchar to nvarchar", + Description: "A command to convert an existing MySQL database from utf8 to utf8mb4", Action: runDoctorConvert, } @@ -35,21 +35,14 @@ func runDoctorConvert(ctx *cli.Context) error { log.Info("Log path: %s", setting.Log.RootPath) log.Info("Configuration file: %s", setting.CustomConf) - switch { - case setting.Database.Type.IsMySQL(): + if setting.Database.Type.IsMySQL() { if err := db.ConvertDatabaseTable(); err != nil { log.Fatal("Failed to convert database & table: %v", err) return err } fmt.Println("Converted successfully, please confirm your database's character set is now utf8mb4") - case setting.Database.Type.IsMSSQL(): - if err := db.ConvertVarcharToNVarchar(); err != nil { - log.Fatal("Failed to convert database from varchar to nvarchar: %v", err) - return err - } - fmt.Println("Converted successfully, please confirm your database's all columns character is NVARCHAR now") - default: - fmt.Println("This command can only be used with a MySQL or MSSQL database") + } else { + fmt.Println("This command can only be used with a MySQL database") } return nil diff --git a/cmd/dump.go b/cmd/dump.go index 3ea92aa112..0a18adb27d 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -128,7 +128,7 @@ It can be used for backup and capture Forgejo server image to send to maintainer &cli.StringFlag{ Name: "database", Aliases: []string{"d"}, - Usage: "Specify the database SQL syntax: sqlite3, mysql, mssql, postgres", + Usage: "Specify the database SQL syntax: sqlite3, mysql, postgres", }, &cli.BoolFlag{ Name: "skip-repository", diff --git a/go.mod b/go.mod index 669ba8ced3..198eaaf2a1 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,6 @@ require ( github.com/buildkite/terminal-to-html/v3 v3.10.1 github.com/caddyserver/certmagic v0.20.0 github.com/chi-middleware/proxy v1.1.1 - github.com/denisenkom/go-mssqldb v0.12.3 github.com/dimiro1/reply v0.0.0-20200315094148-d0136a4c9e21 github.com/djherbis/buffer v1.2.0 github.com/djherbis/nio/v3 v3.0.1 @@ -193,8 +192,6 @@ require ( github.com/go-webauthn/x v0.1.6 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect - github.com/golang-sql/sqlexp v0.1.0 // indirect github.com/golang/geo v0.0.0-20230421003525-6adc56603217 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect diff --git a/go.sum b/go.sum index a1f35bd1e0..72c6300d36 100644 --- a/go.sum +++ b/go.sum @@ -70,9 +70,6 @@ github.com/42wim/sshsig v0.0.0-20211121163825-841cf5bbc121 h1:r3qt8PCHnfjOv9PN3H github.com/42wim/sshsig v0.0.0-20211121163825-841cf5bbc121/go.mod h1:Ock8XgA7pvULhIaHGAk/cDnRfNrF9Jey81nPcc403iU= github.com/6543/go-version v1.3.1 h1:HvOp+Telns7HWJ2Xo/05YXQSB2bE0WmVgbHqwMPZT4U= github.com/6543/go-version v1.3.1/go.mod h1:oqFAHCwtLVUTLdhQmVZWYvaHXTdsbB4SY85at64SQEo= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8= github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 h1:mFRzDkZVAjdal+s7s0MwaRv9igoPqLRdzOLzw/8Xvq8= github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -236,7 +233,6 @@ github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55k github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= -github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 h1:iFaUwBSo5Svw6L7HYpRu/0lE3e0BaElwnNO1qkNQxBY= github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5/go.mod h1:qssHWj60/X5sZFNxpG4HBPDHVqxNm4DfnCKgrbZOT+s= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= @@ -376,7 +372,6 @@ github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOW github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= @@ -640,7 +635,6 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mrjones/oauth v0.0.0-20180629183705-f4e24b6d100c/go.mod h1:skjdDftzkFALcuGzYSklqYd8gvat6F1gZJ4YPVbkZpM= github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 h1:j2kD3MT1z4PXCiUllUJF9mWUESr9TWKS7iEKsQ/IipM= @@ -691,7 +685,6 @@ github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -887,7 +880,6 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -969,7 +961,6 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200927032502-5d4f70055728/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1264,7 +1255,6 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/models/activities/user_heatmap.go b/models/activities/user_heatmap.go index 78fcd76d43..080075d793 100644 --- a/models/activities/user_heatmap.go +++ b/models/activities/user_heatmap.go @@ -39,12 +39,8 @@ func getUserHeatmapData(ctx context.Context, user *user_model.User, team *organi // Group by 15 minute intervals which will allow the client to accurately shift the timestamp to their timezone. // The interval is based on the fact that there are timezones such as UTC +5:30 and UTC +12:45. groupBy := "created_unix / 900 * 900" - groupByName := "timestamp" // We need this extra case because mssql doesn't allow grouping by alias - switch { - case setting.Database.Type.IsMySQL(): + if setting.Database.Type.IsMySQL() { groupBy = "created_unix DIV 900 * 900" - case setting.Database.Type.IsMSSQL(): - groupByName = groupBy } cond, err := activityQueryCondition(ctx, GetFeedsOptions{ @@ -67,7 +63,7 @@ func getUserHeatmapData(ctx context.Context, user *user_model.User, team *organi Table("action"). Where(cond). And("created_unix > ?", timeutil.TimeStampNow()-31536000). - GroupBy(groupByName). + GroupBy("timestamp"). OrderBy("timestamp"). Find(&hdata) } diff --git a/models/db/collation.go b/models/db/collation.go index c128cf5029..61260d6d17 100644 --- a/models/db/collation.go +++ b/models/db/collation.go @@ -41,20 +41,6 @@ func findAvailableCollationsMySQL(x *xorm.Engine) (ret container.Set[string], er return ret, nil } -func findAvailableCollationsMSSQL(x *xorm.Engine) (ret container.Set[string], err error) { - var res []struct { - Name string - } - if err = x.SQL("SELECT * FROM sys.fn_helpcollations() WHERE name LIKE '%[_]CS[_]AS%'").Find(&res); err != nil { - return nil, err - } - ret = make(container.Set[string], len(res)) - for _, r := range res { - ret.Add(r.Name) - } - return ret, nil -} - func CheckCollations(x *xorm.Engine) (*CheckCollationsResult, error) { dbTables, err := x.DBMetas() if err != nil { @@ -84,18 +70,6 @@ func CheckCollations(x *xorm.Engine) (*CheckCollationsResult, error) { // At the moment, it's safe to ignore the database difference, just trim the prefix and compare. It could be fixed easily if there is any problem in the future. return a == b || strings.TrimPrefix(a, "utf8mb4_") == strings.TrimPrefix(b, "utf8mb4_") } - } else if x.Dialect().URI().DBType == schemas.MSSQL { - if _, err = x.SQL("SELECT DATABASEPROPERTYEX(DB_NAME(), 'Collation')").Get(&res.DatabaseCollation); err != nil { - return nil, err - } - res.IsCollationCaseSensitive = func(s string) bool { - return strings.HasSuffix(s, "_CS_AS") - } - candidateCollations = []string{"Latin1_General_CS_AS"} - res.AvailableCollation, err = findAvailableCollationsMSSQL(x) - if err != nil { - return nil, err - } } else { return nil, nil } @@ -146,10 +120,6 @@ func alterDatabaseCollation(x *xorm.Engine, collation string) error { if x.Dialect().URI().DBType == schemas.MYSQL { _, err := x.Exec("ALTER DATABASE CHARACTER SET utf8mb4 COLLATE " + collation) return err - } else if x.Dialect().URI().DBType == schemas.MSSQL { - // TODO: MSSQL has many limitations on changing database collation, it could fail in many cases. - _, err := x.Exec("ALTER DATABASE CURRENT COLLATE " + collation) - return err } return errors.New("unsupported database type") } @@ -165,12 +135,11 @@ func preprocessDatabaseCollation(x *xorm.Engine) { } // try to alter database collation to expected if the database is empty, it might fail in some cases (and it isn't necessary to succeed) - // at the moment, there is no "altering" solution for MSSQL, site admin should manually change the database collation + // at the moment. if !r.CollationEquals(r.DatabaseCollation, r.ExpectedCollation) && r.ExistingTableNumber == 0 { if err = alterDatabaseCollation(x, r.ExpectedCollation); err != nil { log.Error("Failed to change database collation to %q: %v", r.ExpectedCollation, err) } else { - _, _ = x.Exec("SELECT 1") // after "altering", MSSQL's session becomes invalid, so make a simple query to "refresh" the session if r, err = CheckCollations(x); err != nil { log.Error("Failed to check database collation again after altering: %v", err) // impossible case return diff --git a/models/db/common.go b/models/db/common.go index ea628bf2a0..f3fd3e72ae 100644 --- a/models/db/common.go +++ b/models/db/common.go @@ -47,8 +47,6 @@ func BuilderDialect() string { return builder.SQLITE case setting.Database.Type.IsPostgreSQL(): return builder.POSTGRES - case setting.Database.Type.IsMSSQL(): - return builder.MSSQL default: return "" } diff --git a/models/db/convert.go b/models/db/convert.go index 8c124471ab..b8b15382e7 100644 --- a/models/db/convert.go +++ b/models/db/convert.go @@ -47,33 +47,6 @@ func ConvertDatabaseTable() error { return nil } -// ConvertVarcharToNVarchar converts database and tables from varchar to nvarchar if it's mssql -func ConvertVarcharToNVarchar() error { - if x.Dialect().URI().DBType != schemas.MSSQL { - return nil - } - - sess := x.NewSession() - defer sess.Close() - res, err := sess.QuerySliceString(`SELECT 'ALTER TABLE ' + OBJECT_NAME(SC.object_id) + ' MODIFY SC.name NVARCHAR(' + CONVERT(VARCHAR(5),SC.max_length) + ')' -FROM SYS.columns SC -JOIN SYS.types ST -ON SC.system_type_id = ST.system_type_id -AND SC.user_type_id = ST.user_type_id -WHERE ST.name ='varchar'`) - if err != nil { - return err - } - for _, row := range res { - if len(row) == 1 { - if _, err = sess.Exec(row[0]); err != nil { - return err - } - } - } - return err -} - // Cell2Int64 converts a xorm.Cell type to int64, // and handles possible irregular cases. func Cell2Int64(val xorm.Cell) int64 { diff --git a/models/db/engine.go b/models/db/engine.go index 27e5fb9e1a..09f64b6c8f 100755 --- a/models/db/engine.go +++ b/models/db/engine.go @@ -22,9 +22,8 @@ import ( "xorm.io/xorm/names" "xorm.io/xorm/schemas" - _ "github.com/denisenkom/go-mssqldb" // Needed for the MSSQL driver - _ "github.com/go-sql-driver/mysql" // Needed for the MySQL driver - _ "github.com/lib/pq" // Needed for the Postgresql driver + _ "github.com/go-sql-driver/mysql" // Needed for the MySQL driver + _ "github.com/lib/pq" // Needed for the Postgresql driver ) var ( @@ -114,10 +113,8 @@ func newXORMEngine() (*xorm.Engine, error) { if err != nil { return nil, err } - if setting.Database.Type == "mysql" { + if setting.Database.Type.IsMySQL() { engine.Dialect().SetParams(map[string]string{"rowFormat": "DYNAMIC"}) - } else if setting.Database.Type == "mssql" { - engine.Dialect().SetParams(map[string]string{"DEFAULT_VARCHAR": "nvarchar"}) } engine.SetSchema(setting.Database.Schema) return engine, nil diff --git a/models/db/index.go b/models/db/index.go index 29254b1f07..259ddd6ade 100644 --- a/models/db/index.go +++ b/models/db/index.go @@ -89,33 +89,6 @@ func mysqlGetNextResourceIndex(ctx context.Context, tableName string, groupID in return idx, nil } -func mssqlGetNextResourceIndex(ctx context.Context, tableName string, groupID int64) (int64, error) { - if _, err := GetEngine(ctx).Exec(fmt.Sprintf(` -MERGE INTO %s WITH (HOLDLOCK) AS target -USING (SELECT %d AS group_id) AS source -(group_id) -ON target.group_id = source.group_id -WHEN MATCHED - THEN UPDATE - SET max_index = max_index + 1 -WHEN NOT MATCHED - THEN INSERT (group_id, max_index) - VALUES (%d, 1); -`, tableName, groupID, groupID)); err != nil { - return 0, err - } - - var idx int64 - _, err := GetEngine(ctx).SQL(fmt.Sprintf("SELECT max_index FROM %s WHERE group_id = ?", tableName), groupID).Get(&idx) - if err != nil { - return 0, err - } - if idx == 0 { - return 0, errors.New("cannot get the correct index") - } - return idx, nil -} - // GetNextResourceIndex generates a resource index, it must run in the same transaction where the resource is created func GetNextResourceIndex(ctx context.Context, tableName string, groupID int64) (int64, error) { switch { @@ -123,8 +96,6 @@ func GetNextResourceIndex(ctx context.Context, tableName string, groupID int64) return postgresGetNextResourceIndex(ctx, tableName, groupID) case setting.Database.Type.IsMySQL(): return mysqlGetNextResourceIndex(ctx, tableName, groupID) - case setting.Database.Type.IsMSSQL(): - return mssqlGetNextResourceIndex(ctx, tableName, groupID) } e := GetEngine(ctx) diff --git a/models/git/branch.go b/models/git/branch.go index a12cbd4dee..0e2febce3b 100644 --- a/models/git/branch.go +++ b/models/git/branch.go @@ -103,7 +103,7 @@ func (err ErrBranchesEqual) Unwrap() error { type Branch struct { ID int64 RepoID int64 `xorm:"UNIQUE(s)"` - Name string `xorm:"UNIQUE(s) NOT NULL"` // git's ref-name is case-sensitive internally, however, in some databases (mssql, mysql, by default), it's case-insensitive at the moment + Name string `xorm:"UNIQUE(s) NOT NULL"` // git's ref-name is case-sensitive internally, however, in some databases (mysql, by default), it's case-insensitive at the moment CommitID string CommitMessage string `xorm:"TEXT"` // it only stores the message summary (the first line) PusherID int64 diff --git a/models/git/commit_status.go b/models/git/commit_status.go index e44cc98985..bec819348a 100644 --- a/models/git/commit_status.go +++ b/models/git/commit_status.go @@ -84,34 +84,6 @@ func mysqlGetCommitStatusIndex(ctx context.Context, repoID int64, sha string) (i return idx, nil } -func mssqlGetCommitStatusIndex(ctx context.Context, repoID int64, sha string) (int64, error) { - if _, err := db.GetEngine(ctx).Exec(` -MERGE INTO commit_status_index WITH (HOLDLOCK) AS target -USING (SELECT ? AS repo_id, ? AS sha) AS source -(repo_id, sha) -ON target.repo_id = source.repo_id AND target.sha = source.sha -WHEN MATCHED - THEN UPDATE - SET max_index = max_index + 1 -WHEN NOT MATCHED - THEN INSERT (repo_id, sha, max_index) - VALUES (?, ?, 1); -`, repoID, sha, repoID, sha); err != nil { - return 0, err - } - - var idx int64 - _, err := db.GetEngine(ctx).SQL("SELECT max_index FROM `commit_status_index` WHERE repo_id = ? AND sha = ?", - repoID, sha).Get(&idx) - if err != nil { - return 0, err - } - if idx == 0 { - return 0, errors.New("cannot get the correct index") - } - return idx, nil -} - // GetNextCommitStatusIndex retried 3 times to generate a resource index func GetNextCommitStatusIndex(ctx context.Context, repoID int64, sha string) (int64, error) { _, err := git.NewIDFromString(sha) @@ -124,8 +96,6 @@ func GetNextCommitStatusIndex(ctx context.Context, repoID int64, sha string) (in return postgresGetCommitStatusIndex(ctx, repoID, sha) case setting.Database.Type.IsMySQL(): return mysqlGetCommitStatusIndex(ctx, repoID, sha) - case setting.Database.Type.IsMSSQL(): - return mssqlGetCommitStatusIndex(ctx, repoID, sha) } e := db.GetEngine(ctx) diff --git a/models/migrations/base/db.go b/models/migrations/base/db.go index 51351cc7d3..a76ce29deb 100644 --- a/models/migrations/base/db.go +++ b/models/migrations/base/db.go @@ -89,13 +89,6 @@ func RecreateTable(sess *xorm.Session, bean any) error { hasID = hasID || (column.IsPrimaryKey && column.IsAutoIncrement) } - if hasID && setting.Database.Type.IsMSSQL() { - if _, err := sess.Exec(fmt.Sprintf("SET IDENTITY_INSERT `%s` ON", tempTableName)); err != nil { - log.Error("Unable to set identity insert for table %s. Error: %v", tempTableName, err) - return err - } - } - sqlStringBuilder := &strings.Builder{} _, _ = sqlStringBuilder.WriteString("INSERT INTO `") _, _ = sqlStringBuilder.WriteString(tempTableName) @@ -143,13 +136,6 @@ func RecreateTable(sess *xorm.Session, bean any) error { return err } - if hasID && setting.Database.Type.IsMSSQL() { - if _, err := sess.Exec(fmt.Sprintf("SET IDENTITY_INSERT `%s` OFF", tempTableName)); err != nil { - log.Error("Unable to switch off identity insert for table %s. Error: %v", tempTableName, err) - return err - } - } - switch { case setting.Database.Type.IsSQLite3(): // SQLite will drop all the constraints on the old table @@ -296,19 +282,6 @@ func RecreateTable(sess *xorm.Session, bean any) error { } - case setting.Database.Type.IsMSSQL(): - // MSSQL will drop all the constraints on the old table - if _, err := sess.Exec(fmt.Sprintf("DROP TABLE `%s`", tableName)); err != nil { - log.Error("Unable to drop old table %s. Error: %v", tableName, err) - return err - } - - // MSSQL sp_rename will move all the constraints from the temporary table to the new table - if _, err := sess.Exec(fmt.Sprintf("sp_rename `%s`,`%s`", tempTableName, tableName)); err != nil { - log.Error("Unable to rename %s to %s. Error: %v", tempTableName, tableName, err) - return err - } - default: log.Fatal("Unrecognized DB") } @@ -444,40 +417,6 @@ func DropTableColumns(sess *xorm.Session, tableName string, columnNames ...strin if _, err := sess.Exec(fmt.Sprintf("ALTER TABLE `%s` %s", tableName, cols)); err != nil { return fmt.Errorf("Drop table `%s` columns %v: %v", tableName, columnNames, err) } - case setting.Database.Type.IsMSSQL(): - cols := "" - for _, col := range columnNames { - if cols != "" { - cols += ", " - } - cols += "`" + strings.ToLower(col) + "`" - } - sql := fmt.Sprintf("SELECT Name FROM sys.default_constraints WHERE parent_object_id = OBJECT_ID('%[1]s') AND parent_column_id IN (SELECT column_id FROM sys.columns WHERE LOWER(name) IN (%[2]s) AND object_id = OBJECT_ID('%[1]s'))", - tableName, strings.ReplaceAll(cols, "`", "'")) - constraints := make([]string, 0) - if err := sess.SQL(sql).Find(&constraints); err != nil { - return fmt.Errorf("Find constraints: %v", err) - } - for _, constraint := range constraints { - if _, err := sess.Exec(fmt.Sprintf("ALTER TABLE `%s` DROP CONSTRAINT `%s`", tableName, constraint)); err != nil { - return fmt.Errorf("Drop table `%s` default constraint `%s`: %v", tableName, constraint, err) - } - } - sql = fmt.Sprintf("SELECT DISTINCT Name FROM sys.indexes INNER JOIN sys.index_columns ON indexes.index_id = index_columns.index_id AND indexes.object_id = index_columns.object_id WHERE indexes.object_id = OBJECT_ID('%[1]s') AND index_columns.column_id IN (SELECT column_id FROM sys.columns WHERE LOWER(name) IN (%[2]s) AND object_id = OBJECT_ID('%[1]s'))", - tableName, strings.ReplaceAll(cols, "`", "'")) - constraints = make([]string, 0) - if err := sess.SQL(sql).Find(&constraints); err != nil { - return fmt.Errorf("Find constraints: %v", err) - } - for _, constraint := range constraints { - if _, err := sess.Exec(fmt.Sprintf("DROP INDEX `%[2]s` ON `%[1]s`", tableName, constraint)); err != nil { - return fmt.Errorf("Drop index `%[2]s` on `%[1]s`: %v", tableName, constraint, err) - } - } - - if _, err := sess.Exec(fmt.Sprintf("ALTER TABLE `%s` DROP COLUMN %s", tableName, cols)); err != nil { - return fmt.Errorf("Drop table `%s` columns %v: %v", tableName, columnNames, err) - } default: log.Fatal("Unrecognized DB") } @@ -489,21 +428,6 @@ func DropTableColumns(sess *xorm.Session, tableName string, columnNames ...strin func ModifyColumn(x *xorm.Engine, tableName string, col *schemas.Column) error { var indexes map[string]*schemas.Index var err error - // MSSQL have to remove index at first, otherwise alter column will fail - // ref. https://sqlzealots.com/2018/05/09/error-message-the-index-is-dependent-on-column-alter-table-alter-column-failed-because-one-or-more-objects-access-this-column/ - if x.Dialect().URI().DBType == schemas.MSSQL { - indexes, err = x.Dialect().GetIndexes(x.DB(), context.Background(), tableName) - if err != nil { - return err - } - - for _, index := range indexes { - _, err = x.Exec(x.Dialect().DropIndexSQL(tableName, index)) - if err != nil { - return err - } - } - } defer func() { for _, index := range indexes { @@ -612,21 +536,6 @@ func deleteDB() error { } return nil } - case setting.Database.Type.IsMSSQL(): - host, port := setting.ParseMSSQLHostPort(setting.Database.Host) - db, err := sql.Open("mssql", fmt.Sprintf("server=%s; port=%s; database=%s; user id=%s; password=%s;", - host, port, "master", setting.Database.User, setting.Database.Passwd)) - if err != nil { - return err - } - defer db.Close() - - if _, err = db.Exec(fmt.Sprintf("DROP DATABASE IF EXISTS [%s]", setting.Database.Name)); err != nil { - return err - } - if _, err = db.Exec(fmt.Sprintf("CREATE DATABASE [%s]", setting.Database.Name)); err != nil { - return err - } } return nil diff --git a/models/migrations/v1_11/v110.go b/models/migrations/v1_11/v110.go index 81afa1331d..fce9be847e 100644 --- a/models/migrations/v1_11/v110.go +++ b/models/migrations/v1_11/v110.go @@ -16,9 +16,6 @@ func ChangeReviewContentToText(x *xorm.Engine) error { case schemas.ORACLE: _, err := x.Exec("ALTER TABLE review MODIFY content TEXT") return err - case schemas.MSSQL: - _, err := x.Exec("ALTER TABLE review ALTER COLUMN content TEXT") - return err case schemas.POSTGRES: _, err := x.Exec("ALTER TABLE review ALTER COLUMN content TYPE TEXT") return err diff --git a/models/migrations/v1_12/v139.go b/models/migrations/v1_12/v139.go index 279aa7df87..5b6576951d 100644 --- a/models/migrations/v1_12/v139.go +++ b/models/migrations/v1_12/v139.go @@ -12,12 +12,9 @@ import ( func PrependRefsHeadsToIssueRefs(x *xorm.Engine) error { var query string - switch { - case setting.Database.Type.IsMSSQL(): - query = "UPDATE `issue` SET `ref` = 'refs/heads/' + `ref` WHERE `ref` IS NOT NULL AND `ref` <> '' AND `ref` NOT LIKE 'refs/%'" - case setting.Database.Type.IsMySQL(): + if setting.Database.Type.IsMySQL() { query = "UPDATE `issue` SET `ref` = CONCAT('refs/heads/', `ref`) WHERE `ref` IS NOT NULL AND `ref` <> '' AND `ref` NOT LIKE 'refs/%';" - default: + } else { query = "UPDATE `issue` SET `ref` = 'refs/heads/' || `ref` WHERE `ref` IS NOT NULL AND `ref` <> '' AND `ref` NOT LIKE 'refs/%'" } diff --git a/models/migrations/v1_13/v145.go b/models/migrations/v1_13/v145.go index 8acb29bf33..5b38f1cd80 100644 --- a/models/migrations/v1_13/v145.go +++ b/models/migrations/v1_13/v145.go @@ -45,32 +45,6 @@ func IncreaseLanguageField(x *xorm.Engine) error { if _, err := sess.Exec(fmt.Sprintf("ALTER TABLE language_stat MODIFY COLUMN language %s", sqlType)); err != nil { return err } - case setting.Database.Type.IsMSSQL(): - // Yet again MSSQL just has to be awkward. - // Here we have to drop the constraints first and then rebuild them - constraints := make([]string, 0) - if err := sess.SQL(`SELECT i.name AS Name - FROM sys.indexes i INNER JOIN sys.index_columns ic - ON i.index_id = ic.index_id AND i.object_id = ic.object_id - INNER JOIN sys.tables AS t - ON t.object_id = i.object_id - INNER JOIN sys.columns c - ON t.object_id = c.object_id AND ic.column_id = c.column_id - WHERE t.name = 'language_stat' AND c.name = 'language'`).Find(&constraints); err != nil { - return fmt.Errorf("Find constraints: %w", err) - } - for _, constraint := range constraints { - if _, err := sess.Exec(fmt.Sprintf("DROP INDEX [%s] ON `language_stat`", constraint)); err != nil { - return fmt.Errorf("Drop table `language_stat` constraint `%s`: %w", constraint, err) - } - } - if _, err := sess.Exec(fmt.Sprintf("ALTER TABLE language_stat ALTER COLUMN language %s", sqlType)); err != nil { - return err - } - // Finally restore the constraint - if err := sess.CreateUniques(new(LanguageStat)); err != nil { - return err - } case setting.Database.Type.IsPostgreSQL(): if _, err := sess.Exec(fmt.Sprintf("ALTER TABLE language_stat ALTER COLUMN language TYPE %s", sqlType)); err != nil { return err diff --git a/models/migrations/v1_13/v151.go b/models/migrations/v1_13/v151.go index 25af1d03ec..ea4a8eae31 100644 --- a/models/migrations/v1_13/v151.go +++ b/models/migrations/v1_13/v151.go @@ -23,36 +23,6 @@ func SetDefaultPasswordToArgon2(x *xorm.Engine) error { case setting.Database.Type.IsPostgreSQL(): _, err := x.Exec("ALTER TABLE `user` ALTER COLUMN passwd_hash_algo SET DEFAULT 'argon2';") return err - case setting.Database.Type.IsMSSQL(): - // need to find the constraint and drop it, then recreate it. - sess := x.NewSession() - defer sess.Close() - if err := sess.Begin(); err != nil { - return err - } - res, err := sess.QueryString("SELECT [name] FROM sys.default_constraints WHERE parent_object_id=OBJECT_ID(?) AND COL_NAME(parent_object_id, parent_column_id)=?;", "user", "passwd_hash_algo") - if err != nil { - return err - } - if len(res) > 0 { - constraintName := res[0]["name"] - log.Error("Results of select constraint: %s", constraintName) - _, err := sess.Exec("ALTER TABLE [user] DROP CONSTRAINT " + constraintName) - if err != nil { - return err - } - _, err = sess.Exec("ALTER TABLE [user] ADD CONSTRAINT " + constraintName + " DEFAULT 'argon2' FOR passwd_hash_algo") - if err != nil { - return err - } - } else { - _, err := sess.Exec("ALTER TABLE [user] ADD DEFAULT('argon2') FOR passwd_hash_algo") - if err != nil { - return err - } - } - return sess.Commit() - case setting.Database.Type.IsSQLite3(): // drop through default: diff --git a/models/migrations/v1_14/v158.go b/models/migrations/v1_14/v158.go index 1094d8abf7..2d688b1706 100644 --- a/models/migrations/v1_14/v158.go +++ b/models/migrations/v1_14/v158.go @@ -62,13 +62,6 @@ func UpdateCodeCommentReplies(x *xorm.Engine) error { return err } - if setting.Database.Type.IsMSSQL() { - if _, err := sess.Exec(sqlSelect + " INTO #temp_comments" + sqlTail); err != nil { - log.Error("unable to create temporary table") - return err - } - } - comments := make([]*Comment, 0, batchSize) switch { @@ -78,9 +71,6 @@ func UpdateCodeCommentReplies(x *xorm.Engine) error { fallthrough case setting.Database.Type.IsSQLite3(): sqlCmd = sqlSelect + sqlTail + " LIMIT " + strconv.Itoa(batchSize) + " OFFSET " + strconv.Itoa(start) - case setting.Database.Type.IsMSSQL(): - sqlCmd = "SELECT TOP " + strconv.Itoa(batchSize) + " * FROM #temp_comments WHERE " + - "(id NOT IN ( SELECT TOP " + strconv.Itoa(start) + " id FROM #temp_comments ORDER BY id )) ORDER BY id" default: return fmt.Errorf("Unsupported database type") } diff --git a/models/migrations/v1_14/v165.go b/models/migrations/v1_14/v165.go index 926350cdf7..5b1a779294 100644 --- a/models/migrations/v1_14/v165.go +++ b/models/migrations/v1_14/v165.go @@ -32,13 +32,7 @@ func ConvertHookTaskTypeToVarcharAndTrim(x *xorm.Engine) error { return err } - var hookTaskTrimSQL string - if dbType == schemas.MSSQL { - hookTaskTrimSQL = "UPDATE hook_task SET typ = RTRIM(LTRIM(typ))" - } else { - hookTaskTrimSQL = "UPDATE hook_task SET typ = TRIM(typ)" - } - if _, err := x.Exec(hookTaskTrimSQL); err != nil { + if _, err := x.Exec("UPDATE hook_task SET typ = TRIM(typ)"); err != nil { return err } @@ -58,12 +52,6 @@ func ConvertHookTaskTypeToVarcharAndTrim(x *xorm.Engine) error { return err } - var webhookTrimSQL string - if dbType == schemas.MSSQL { - webhookTrimSQL = "UPDATE webhook SET type = RTRIM(LTRIM(type))" - } else { - webhookTrimSQL = "UPDATE webhook SET type = TRIM(type)" - } - _, err := x.Exec(webhookTrimSQL) + _, err := x.Exec("UPDATE webhook SET type = TRIM(type)") return err } diff --git a/models/migrations/v1_15/v184.go b/models/migrations/v1_15/v184.go index 4b3dd1467a..871c9db18a 100644 --- a/models/migrations/v1_15/v184.go +++ b/models/migrations/v1_15/v184.go @@ -53,16 +53,11 @@ func RenameTaskErrorsToMessage(x *xorm.Engine) error { } } - switch { - case setting.Database.Type.IsMySQL(): + if setting.Database.Type.IsMySQL() { if _, err := sess.Exec("ALTER TABLE `task` CHANGE errors message text"); err != nil { return err } - case setting.Database.Type.IsMSSQL(): - if _, err := sess.Exec("sp_rename 'task.errors', 'message', 'COLUMN'"); err != nil { - return err - } - default: + } else { if _, err := sess.Exec("ALTER TABLE `task` RENAME COLUMN errors TO message"); err != nil { return err } diff --git a/models/migrations/v1_16/v210.go b/models/migrations/v1_16/v210.go index 533bb4bf80..2df1c18b19 100644 --- a/models/migrations/v1_16/v210.go +++ b/models/migrations/v1_16/v210.go @@ -8,7 +8,6 @@ import ( "fmt" "strings" - "code.gitea.io/gitea/models/migrations/base" "code.gitea.io/gitea/modules/timeutil" "github.com/tstranex/u2f" @@ -48,26 +47,6 @@ func RemigrateU2FCredentials(x *xorm.Engine) error { if err != nil { return err } - case schemas.MSSQL: - // This column has an index on it. I could write all of the code to attempt to change the index OR - // I could just use recreate table. - sess := x.NewSession() - if err := sess.Begin(); err != nil { - _ = sess.Close() - return err - } - - if err := base.RecreateTable(sess, new(webauthnCredential)); err != nil { - _ = sess.Close() - return err - } - if err := sess.Commit(); err != nil { - _ = sess.Close() - return err - } - if err := sess.Close(); err != nil { - return err - } case schemas.POSTGRES: _, err := x.Exec("ALTER TABLE webauthn_credential ALTER COLUMN credential_id TYPE VARCHAR(410)") if err != nil { @@ -111,11 +90,6 @@ func RemigrateU2FCredentials(x *xorm.Engine) error { if err := sess.Begin(); err != nil { return fmt.Errorf("unable to allow start session. Error: %w", err) } - if x.Dialect().URI().DBType == schemas.MSSQL { - if _, err := sess.Exec("SET IDENTITY_INSERT `webauthn_credential` ON"); err != nil { - return fmt.Errorf("unable to allow identity insert on webauthn_credential. Error: %w", err) - } - } for _, reg := range regs { parsed := new(u2f.Registration) err = parsed.UnmarshalBinary(reg.Raw) diff --git a/models/migrations/v1_17/v220.go b/models/migrations/v1_17/v220.go index 904ddc5192..d4007163ab 100644 --- a/models/migrations/v1_17/v220.go +++ b/models/migrations/v1_17/v220.go @@ -12,14 +12,10 @@ import ( ) func AddContainerRepositoryProperty(x *xorm.Engine) (err error) { - switch x.Dialect().URI().DBType { - case schemas.SQLITE: + if x.Dialect().URI().DBType == schemas.SQLITE { _, err = x.Exec("INSERT INTO package_property (ref_type, ref_id, name, value) SELECT ?, p.id, ?, u.lower_name || '/' || p.lower_name FROM package p JOIN `user` u ON p.owner_id = u.id WHERE p.type = ?", packages_model.PropertyTypePackage, container_module.PropertyRepository, packages_model.TypeContainer) - case schemas.MSSQL: - _, err = x.Exec("INSERT INTO package_property (ref_type, ref_id, name, value) SELECT ?, p.id, ?, u.lower_name + '/' + p.lower_name FROM package p JOIN `user` u ON p.owner_id = u.id WHERE p.type = ?", - packages_model.PropertyTypePackage, container_module.PropertyRepository, packages_model.TypeContainer) - default: + } else { _, err = x.Exec("INSERT INTO package_property (ref_type, ref_id, name, value) SELECT ?, p.id, ?, CONCAT(u.lower_name, '/', p.lower_name) FROM package p JOIN `user` u ON p.owner_id = u.id WHERE p.type = ?", packages_model.PropertyTypePackage, container_module.PropertyRepository, packages_model.TypeContainer) } diff --git a/models/migrations/v1_17/v223.go b/models/migrations/v1_17/v223.go index 018451ee4c..3592eb1be6 100644 --- a/models/migrations/v1_17/v223.go +++ b/models/migrations/v1_17/v223.go @@ -64,16 +64,11 @@ func RenameCredentialIDBytes(x *xorm.Engine) error { } } - switch { - case setting.Database.Type.IsMySQL(): + if setting.Database.Type.IsMySQL() { if _, err := sess.Exec("ALTER TABLE `webauthn_credential` CHANGE credential_id_bytes credential_id VARBINARY(1024)"); err != nil { return err } - case setting.Database.Type.IsMSSQL(): - if _, err := sess.Exec("sp_rename 'webauthn_credential.credential_id_bytes', 'credential_id', 'COLUMN'"); err != nil { - return err - } - default: + } else { if _, err := sess.Exec("ALTER TABLE `webauthn_credential` RENAME COLUMN credential_id_bytes TO credential_id"); err != nil { return err } diff --git a/models/migrations/v1_20/v245.go b/models/migrations/v1_20/v245.go index ab58d12880..b0d4c21502 100644 --- a/models/migrations/v1_20/v245.go +++ b/models/migrations/v1_20/v245.go @@ -50,8 +50,7 @@ func RenameWebhookOrgToOwner(x *xorm.Engine) error { } } - switch { - case setting.Database.Type.IsMySQL(): + if setting.Database.Type.IsMySQL() { inferredTable, err := x.TableInfo(new(Webhook)) if err != nil { return err @@ -60,11 +59,7 @@ func RenameWebhookOrgToOwner(x *xorm.Engine) error { if _, err := sess.Exec(fmt.Sprintf("ALTER TABLE `webhook` CHANGE org_id owner_id %s", sqlType)); err != nil { return err } - case setting.Database.Type.IsMSSQL(): - if _, err := sess.Exec("sp_rename 'webhook.org_id', 'owner_id', 'COLUMN'"); err != nil { - return err - } - default: + } else { if _, err := sess.Exec("ALTER TABLE `webhook` RENAME COLUMN org_id TO owner_id"); err != nil { return err } diff --git a/models/migrations/v1_22/v283.go b/models/migrations/v1_22/v283.go index 0a45c51245..86946d1c39 100644 --- a/models/migrations/v1_22/v283.go +++ b/models/migrations/v1_22/v283.go @@ -4,10 +4,7 @@ package v1_22 //nolint import ( - "fmt" - "xorm.io/xorm" - "xorm.io/xorm/schemas" ) func AddCombinedIndexToIssueUser(x *xorm.Engine) error { @@ -23,18 +20,12 @@ func AddCombinedIndexToIssueUser(x *xorm.Engine) error { return err } for _, issueUser := range duplicatedIssueUsers { - if x.Dialect().URI().DBType == schemas.MSSQL { - if _, err := x.Exec(fmt.Sprintf("delete from issue_user where id in (SELECT top %d id FROM issue_user WHERE issue_id = ? and uid = ?)", issueUser.Cnt-1), issueUser.IssueID, issueUser.UID); err != nil { - return err - } - } else { - var ids []int64 - if err := x.SQL("SELECT id FROM issue_user WHERE issue_id = ? and uid = ? limit ?", issueUser.IssueID, issueUser.UID, issueUser.Cnt-1).Find(&ids); err != nil { - return err - } - if _, err := x.Table("issue_user").In("id", ids).Delete(); err != nil { - return err - } + var ids []int64 + if err := x.SQL("SELECT id FROM issue_user WHERE issue_id = ? and uid = ? limit ?", issueUser.IssueID, issueUser.UID, issueUser.Cnt-1).Find(&ids); err != nil { + return err + } + if _, err := x.Table("issue_user").In("id", ids).Delete(); err != nil { + return err } } diff --git a/models/migrations/v1_22/v286.go b/models/migrations/v1_22/v286.go index fbbd87344f..2d62d7788c 100644 --- a/models/migrations/v1_22/v286.go +++ b/models/migrations/v1_22/v286.go @@ -3,7 +3,6 @@ package v1_22 //nolint import ( - "errors" "fmt" "code.gitea.io/gitea/modules/log" @@ -33,27 +32,10 @@ func expandHashReferencesToSha256(x *xorm.Engine) error { } if !setting.Database.Type.IsSQLite3() { - if setting.Database.Type.IsMSSQL() { - // drop indexes that need to be re-created afterwards - droppedIndexes := []string{ - "DROP INDEX IF EXISTS [IDX_commit_status_context_hash] ON [commit_status]", - "DROP INDEX IF EXISTS [UQE_review_state_pull_commit_user] ON [review_state]", - "DROP INDEX IF EXISTS [UQE_repo_archiver_s] ON [repo_archiver]", - } - for _, s := range droppedIndexes { - _, err := db.Exec(s) - if err != nil { - return errors.New(s + " " + err.Error()) - } - } - } - for _, alts := range alteredTables { var err error if setting.Database.Type.IsMySQL() { _, err = db.Exec(fmt.Sprintf("ALTER TABLE `%s` MODIFY COLUMN `%s` VARCHAR(64)", alts[0], alts[1])) - } else if setting.Database.Type.IsMSSQL() { - _, err = db.Exec(fmt.Sprintf("ALTER TABLE [%s] ALTER COLUMN [%s] VARCHAR(64)", alts[0], alts[1])) } else { _, err = db.Exec(fmt.Sprintf("ALTER TABLE `%s` ALTER COLUMN `%s` TYPE VARCHAR(64)", alts[0], alts[1])) } @@ -61,20 +43,6 @@ func expandHashReferencesToSha256(x *xorm.Engine) error { return fmt.Errorf("alter column '%s' of table '%s' failed: %w", alts[1], alts[0], err) } } - - if setting.Database.Type.IsMSSQL() { - recreateIndexes := []string{ - "CREATE INDEX IDX_commit_status_context_hash ON commit_status(context_hash)", - "CREATE UNIQUE INDEX UQE_review_state_pull_commit_user ON review_state(user_id, pull_id, commit_sha)", - "CREATE UNIQUE INDEX UQE_repo_archiver_s ON repo_archiver(repo_id, type, commit_id)", - } - for _, s := range recreateIndexes { - _, err := db.Exec(s) - if err != nil { - return errors.New(s + " " + err.Error()) - } - } - } } log.Debug("Updated database tables to hold SHA256 git hash references") diff --git a/models/migrations/v1_8/v81.go b/models/migrations/v1_8/v81.go index a100dc1ef7..734fc24641 100644 --- a/models/migrations/v1_8/v81.go +++ b/models/migrations/v1_8/v81.go @@ -18,8 +18,6 @@ func ChangeU2FCounterType(x *xorm.Engine) error { _, err = x.Exec("ALTER TABLE `u2f_registration` MODIFY `counter` BIGINT") case schemas.POSTGRES: _, err = x.Exec("ALTER TABLE `u2f_registration` ALTER COLUMN `counter` SET DATA TYPE bigint") - case schemas.MSSQL: - _, err = x.Exec("ALTER TABLE `u2f_registration` ALTER COLUMN `counter` BIGINT") } if err != nil { diff --git a/models/unittest/fixtures.go b/models/unittest/fixtures.go index 9ce0909589..63b26a0af7 100644 --- a/models/unittest/fixtures.go +++ b/models/unittest/fixtures.go @@ -60,8 +60,6 @@ func InitFixtures(opts FixturesOptions, engine ...*xorm.Engine) (err error) { dialect = "postgres" case schemas.MYSQL: dialect = "mysql" - case schemas.MSSQL: - dialect = "mssql" case schemas.SQLITE: dialect = "sqlite3" default: diff --git a/modules/setting/database.go b/modules/setting/database.go index 47d79d0de9..6abef42cba 100644 --- a/modules/setting/database.go +++ b/modules/setting/database.go @@ -16,9 +16,9 @@ import ( var ( // SupportedDatabaseTypes includes all XORM supported databases type, sqlite3 maybe added by `database_sqlite3.go` - SupportedDatabaseTypes = []string{"mysql", "postgres", "mssql"} + SupportedDatabaseTypes = []string{"mysql", "postgres"} // DatabaseTypeNames contains the friendly names for all database types - DatabaseTypeNames = map[string]string{"mysql": "MySQL", "postgres": "PostgreSQL", "mssql": "MSSQL", "sqlite3": "SQLite3"} + DatabaseTypeNames = map[string]string{"mysql": "MySQL", "postgres": "PostgreSQL", "sqlite3": "SQLite3"} // EnableSQLite3 use SQLite3, set by build flag EnableSQLite3 bool @@ -120,9 +120,6 @@ func DBConnStr() (string, error) { Database.User, Database.Passwd, connType, Database.Host, Database.Name, paramSep, tls) case "postgres": connStr = getPostgreSQLConnectionString(Database.Host, Database.User, Database.Passwd, Database.Name, Database.SSLMode) - case "mssql": - host, port := ParseMSSQLHostPort(Database.Host) - connStr = fmt.Sprintf("server=%s; port=%s; database=%s; user id=%s; password=%s;", host, port, Database.Name, Database.User, Database.Passwd) case "sqlite3": if !EnableSQLite3 { return "", errors.New("this Gitea binary was not built with SQLite3 support") @@ -188,28 +185,6 @@ func getPostgreSQLConnectionString(dbHost, dbUser, dbPasswd, dbName, dbsslMode s return connURL.String() } -// ParseMSSQLHostPort splits the host into host and port -func ParseMSSQLHostPort(info string) (string, string) { - // the default port "0" might be related to MSSQL's dynamic port, maybe it should be double-confirmed in the future - host, port := "127.0.0.1", "0" - if strings.Contains(info, ":") { - host = strings.Split(info, ":")[0] - port = strings.Split(info, ":")[1] - } else if strings.Contains(info, ",") { - host = strings.Split(info, ",")[0] - port = strings.TrimSpace(strings.Split(info, ",")[1]) - } else if len(info) > 0 { - host = info - } - if host == "" { - host = "127.0.0.1" - } - if port == "" { - port = "0" - } - return host, port -} - type DatabaseType string func (t DatabaseType) String() string { @@ -224,10 +199,6 @@ func (t DatabaseType) IsMySQL() bool { return t == "mysql" } -func (t DatabaseType) IsMSSQL() bool { - return t == "mssql" -} - func (t DatabaseType) IsPostgreSQL() bool { return t == "postgres" } diff --git a/options/locale/locale_ar.ini b/options/locale/locale_ar.ini index da60b73291..e58f7dfdf7 100644 --- a/options/locale/locale_ar.ini +++ b/options/locale/locale_ar.ini @@ -137,7 +137,7 @@ reinstall_confirm_message = إعادة التثبيت باستخدام قاعد db_schema = مخطط reinstall_error = أنت تحاول التثبيت في قاعدة بيانات فورجيو موجودة sqlite_helper = مسار المِلَفّ لقاعدة بيانات SQLite3.
أدخل المسار المطلق إذا شغلت فورجيو كخدمة. -require_db_desc = فورجيو يحتاج MySQL أو PostgreSQL أو MSSQL أو SQLite3 أو TiDB. +require_db_desc = فورجيو يحتاج MySQL أو PostgreSQL أو SQLite3 أو TiDB. password = كلمة المرور host = المضيف docker_helper = إذا كنت تستخدم فورجيو داخل دوكر، يرجي قراءة المستندات قبل تغيير أي إعدادات. @@ -1547,7 +1547,6 @@ dashboard.sync_tag.started = بدأ تزامن الوسوم dashboard.sync_repo_tags = زامن الوسوم من بيانات جِت إلى قاعدة البيانات self_check = فحص ذاتي self_check.database_collation_case_insensitive = تستخدم قاعدة البيانات تجميع %s ، وهو تجميع غير حساس. على الرغم من أن فورجيو يمكن أن يعمل معها قد تكون هناك حالات نادرة لا تعمل كما هو متوقع. -self_check.database_fix_mssql = بالنسبة لمستخدمي الـإم إس سيكول، يمكنك إصلاح المشكلة بتعديل السيكول يدوياً فقط في الوقت الراهن. monitor.process.cancel_desc = قد يسبب إلغاء العملية فقدانًا للبيانات monitor.queue.type = النوع monitor.process.cancel_notices = أتريد إلغاء: %s؟ diff --git a/options/locale/locale_bg.ini b/options/locale/locale_bg.ini index 2c302ed822..ca1598fb1b 100644 --- a/options/locale/locale_bg.ini +++ b/options/locale/locale_bg.ini @@ -1217,7 +1217,7 @@ admin_name = Потреб. име за администратор confirm_password = Потвърдете паролата title = Първоначална конфигурация domain = Домейн на сървъра -require_db_desc = Forgejo изисква MySQL, PostgreSQL, MSSQL, SQLite3 или TiDB (MySQL протокол). +require_db_desc = Forgejo изисква MySQL, PostgreSQL, SQLite3 или TiDB (MySQL протокол). general_title = Общи настройки email_title = Настройки на ел. поща db_schema = Схема diff --git a/options/locale/locale_cs-CZ.ini b/options/locale/locale_cs-CZ.ini index 6e57a9dd59..fd7d8b03fb 100644 --- a/options/locale/locale_cs-CZ.ini +++ b/options/locale/locale_cs-CZ.ini @@ -219,7 +219,7 @@ license_desc=Vše je na dokumentaci, než budete měnit jakákoliv nastavení. -require_db_desc=Forgejo vyžaduje MySQL, PostgreSQL, MSSQL, SQLite3 nebo TiDB (protokol MySQL). +require_db_desc=Forgejo vyžaduje MySQL, PostgreSQL, SQLite3 nebo TiDB (protokol MySQL). db_title=Nastavení databáze db_type=Typ databáze host=Hostitel @@ -3396,7 +3396,6 @@ self_check = Vlastní kontrola dashboard.sync_tag.started = Synchronizace značek spuštěna dashboard.rebuild_issue_indexer = Přestavit indexer vydání self_check.database_collation_case_insensitive = Databáze používá collation %s. Jedná se o intenzivní collation. Ačkoli s ní Forgejo nejspíše bude pracovat, mohou nastat určité vzácné případy, kdy nebude pracovat tak, jak má. -self_check.database_fix_mssql = Uživatelé MSSQL mohou tento problém vyřešit pouze ručními SQL příkazy „ALTER ... COLLATE ...“. auths.oauth2_map_group_to_team = Zmapovat zabrané skupiny u týmů organizací (volitelné - vyžaduje název claimu výše) monitor.queue.settings.desc = Pooly dynamicky rostou podle blokování fronty jejich workerů. @@ -3405,7 +3404,6 @@ self_check.database_collation_mismatch=Očekávejte, že databáze použije coll self_check.database_collation_case_insensitive=Databáze používá collation %s, což je collation nerozlišující velká a malá písmena. Ačkoli s ní Gitea může pracovat, mohou se vyskytnout vzácné případy, kdy nebude fungovat podle očekávání. self_check.database_inconsistent_collation_columns=Databáze používá collation %s, ale tyto sloupce používají chybné collation. To může způsobit neočekávané problémy. self_check.database_fix_mysql=Pro uživatele MySQL/MariaDB můžete použít příkaz "gitea doctor convert", který opraví problémy s collation, nebo můžete také problém vyřešit příkazem "ALTER ... COLLATE ..." SQL ručně. -self_check.database_fix_mssql=Uživatelé MSSQL mohou problém vyřešit pouze pomocí příkazu "ALTER ... COLLATE ..." SQL ručně. auths.tips.gmail_settings = Nastavení služby Gmail: config_summary = Souhrn config.open_with_editor_app_help = Editory v nabídce „Otevřít pomocí“ v nabídce klonování. Ponechte prázdné pro použití výchozího editoru (zobrazíte jej rozšířením). diff --git a/options/locale/locale_de-DE.ini b/options/locale/locale_de-DE.ini index ccb45b5d49..77dd23a785 100644 --- a/options/locale/locale_de-DE.ini +++ b/options/locale/locale_de-DE.ini @@ -217,7 +217,7 @@ license_desc=Hole dir Dokumentation, bevor du irgendwelche Einstellungen veränderst. -require_db_desc=Forgejo benötigt MySQL, PostgreSQL, MSSQL, SQLite3 oder TiDB (MySQL-Protokoll). +require_db_desc=Forgejo benötigt MySQL, PostgreSQL, SQLite3 oder TiDB (MySQL-Protokoll). db_title=Datenbankeinstellungen db_type=Datenbanktyp host=Host @@ -3368,7 +3368,6 @@ self_check = Selbstprüfung dashboard.sync_repo_tags = Tags aus Git-Daten zu Datenbank synchronisieren emails.change_email_text = Bist du dir sicher, dass du diese E-Mail-Addresse aktualisieren möchtest? packages.cleanup.success = Abgelaufene Daten erfolgreich gesäubert -self_check.database_fix_mssql = Für MSSQL-Benutzer: Du kannst das Problem im Moment nur mit „ALTER … COLLATE …“-SQLs beheben. self_check.no_problem_found = Noch kein Problem gefunden. self_check.database_inconsistent_collation_columns = Datenbank benutzt Collation %s, aber diese Spalten benutzen Collations, die nicht zusammenpassen. Das könnte ein paar unerwartete Probleme verursachen. self_check.database_collation_mismatch = Erwarte von Datenbank, folgende Collation zu verwenden: %s diff --git a/options/locale/locale_el-GR.ini b/options/locale/locale_el-GR.ini index 7feea5269e..5116f6b2e4 100644 --- a/options/locale/locale_el-GR.ini +++ b/options/locale/locale_el-GR.ini @@ -211,7 +211,7 @@ license_desc=Κατέβασε το εγχειρίδιο πριν αλλάξετε τις ρυθμίσεις. -require_db_desc=Το Forgejo απαιτεί MySQL, PostgreSQL, MSSQL, SQLite3 ή TiDB (με πρωτόκολλο MySQL). +require_db_desc=Το Forgejo απαιτεί MySQL, PostgreSQL, SQLite3 ή TiDB (με πρωτόκολλο MySQL). db_title=Ρυθμίσεις βάσης δεδομένων db_type=Είδος βάσης δεδομένων host=Διακομιστής @@ -3322,7 +3322,6 @@ notices.desc=Περιγραφή notices.op=Λειτ. notices.delete_success=Οι ειδοποιήσεις του συστήματος έχουν διαγραφεί. self_check.no_problem_found = Μέχρι τώρα, δεν έχει βρεθεί κάποιο πρόβλημα. -self_check.database_fix_mssql = Προς το παρόν, οι χρήστες του MSSQL μπορούν να διορθώσουν το πρόβλημα αυτό χειροκίνητα χρησιμοποιώντας τις εντολές SQL «ALTER ... COLLATE ...». self_check = Αυτοέλεγχος dashboard.sync_repo_tags = Συγχρονισμός tag από δεδομένα git στην βάση δεδομένων dashboard.sync_tag.started = Ο συγχρονισμός tag έχει ξεκινήσει diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index c727a9cc12..bbbee6124a 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -239,7 +239,7 @@ license_desc = Go get documentation before changing any settings. -require_db_desc = Forgejo requires MySQL, PostgreSQL, MSSQL, SQLite3 or TiDB (MySQL protocol). +require_db_desc = Forgejo requires MySQL, PostgreSQL, SQLite3 or TiDB (MySQL protocol). db_title = Database settings db_type = Database type host = Host @@ -3378,7 +3378,6 @@ self_check.database_collation_mismatch = Expect database to use collation: %s self_check.database_collation_case_insensitive = Database is using a collation %s, which is an insensitive collation. Although Forgejo could work with it, there might be some rare cases which don't work as expected. self_check.database_inconsistent_collation_columns = Database is using collation %s, but these columns are using mismatched collations. It might cause some unexpected problems. self_check.database_fix_mysql = For MySQL/MariaDB users, you could use the "gitea doctor convert" command to fix the collation problems, or you could also fix the problem by "ALTER ... COLLATE ..." SQLs manually. -self_check.database_fix_mssql = For MSSQL users, you could only fix the problem by "ALTER ... COLLATE ..." SQLs manually at the moment. [action] create_repo = created repository %s diff --git a/options/locale/locale_eo.ini b/options/locale/locale_eo.ini index 6527d0d42e..88bbb958bd 100644 --- a/options/locale/locale_eo.ini +++ b/options/locale/locale_eo.ini @@ -226,7 +226,7 @@ disable_gravatar = Malŝalti profilbildojn per Gravatar repo_path_helper = Foraj Git-deponejoj konserviĝos al tiu ĉi dosierujo. sqlite_helper = Dosiervojo por la datumbazo SQLite3.
Enigu absolutan vojon se vi rulas Forgejon kiel servo. enable_captcha = Ŝalti dumregistriĝan teston de homeco -require_db_desc = Forgejo bezonas kiel datumbazo MySQL, PostgreSQL, MSSQL, SQLite3, aŭ TiDB (MySQL komunikformo). +require_db_desc = Forgejo bezonas kiel datumbazo MySQL, PostgreSQL, SQLite3, aŭ TiDB (MySQL komunikformo). smtp_from = Sendu retleterojn kiel general_title = Ĝeneralaj agordoj password = Pasvorto diff --git a/options/locale/locale_es-ES.ini b/options/locale/locale_es-ES.ini index 2965de5f35..5ac709e875 100644 --- a/options/locale/locale_es-ES.ini +++ b/options/locale/locale_es-ES.ini @@ -210,7 +210,7 @@ license_desc=¡Está todo en < documentación antes de realizar cambios en la configuración. -require_db_desc=Forgejo requiere una base de datos MySQL, PostgreSQL, MSSQL, SQLite3 o TiDB (usar el protocolo MySQL). +require_db_desc=Forgejo requiere una base de datos MySQL, PostgreSQL, SQLite3 o TiDB (usar el protocolo MySQL). db_title=Configuración de base de datos db_type=Tipo de base de datos host=Servidor diff --git a/options/locale/locale_fi-FI.ini b/options/locale/locale_fi-FI.ini index 0d55fff150..b56d9c8967 100644 --- a/options/locale/locale_fi-FI.ini +++ b/options/locale/locale_fi-FI.ini @@ -144,7 +144,7 @@ license_desc=Mene osoitteeseen ohjeet ennen minkään asetuksen muuttamista. -require_db_desc=Forgejo tarvitsee toimiakseen MySQL, PostgreSQL, MSSQL, SQLite3 tai TiDB (MySQL protokolla) tietokannan. +require_db_desc=Forgejo tarvitsee toimiakseen MySQL, PostgreSQL, SQLite3 tai TiDB (MySQL protokolla) tietokannan. db_title=Tietokanta asetukset db_type=Tietokanta tyyppi host=Isäntä diff --git a/options/locale/locale_fil.ini b/options/locale/locale_fil.ini index b50143444c..a6421b26ec 100644 --- a/options/locale/locale_fil.ini +++ b/options/locale/locale_fil.ini @@ -211,7 +211,7 @@ reinstall_error = Sinusubukan mong mag-install sa umiiral na Forgejo database install = Pag-install title = Paunang pagsasaayos docker_helper = Kapag tinatakbo mo ang Forgejo sa loob ng Docker, mangyaring basahin ang dokumentasyon bago baguhin ang anumang mga setting. -require_db_desc = Kinakailangan ng Forgejo ang MySQL, PostgreSQL, MSSQL, SQLite3 o TiDB (MySQL protocol). +require_db_desc = Kinakailangan ng Forgejo ang MySQL, PostgreSQL, SQLite3 o TiDB (MySQL protocol). db_title = Mga setting ng database db_type = Uri ng database host = Host diff --git a/options/locale/locale_fr-FR.ini b/options/locale/locale_fr-FR.ini index 3e5e1a3ffd..4840f1e478 100644 --- a/options/locale/locale_fr-FR.ini +++ b/options/locale/locale_fr-FR.ini @@ -218,7 +218,7 @@ license_desc=Toutes les sources sont sur documentation avant de modifier les paramètres. -require_db_desc=Forgejo nécessite MySQL, PostgreSQL, MSSQL, SQLite3 ou TiDB (avec le protocole MySQL). +require_db_desc=Forgejo nécessite MySQL, PostgreSQL, SQLite3 ou TiDB (avec le protocole MySQL). db_title=Paramètres de la base de données db_type=Type de base de données host=Hôte @@ -3388,14 +3388,12 @@ self_check.database_collation_mismatch = La base de donnée devrait utiliser la self_check.database_collation_case_insensitive = La base de donnée utilise la collation %s qui n'est pas sensible à la casse. Bien que Forgejo puisse fonctionner de cette façon, il est possible que certains cas limite d'utilisation de la casse ne fonctionne pas comme attendu. self_check.database_inconsistent_collation_columns = La base de donnée utilise la collation %s, mais ces colonnes utilisent des collations incohérentes. Cela peut causer des problèmes inattendus. self_check.database_fix_mysql = Les utilisateurs de MySQL/MariaDB peuvent utiliser la commande "forgejo doctor convert" pour corriger les problèmes de collation, ou bien manuellement avec la commande SQL "ALTER ... COLLATE ...". -self_check.database_fix_mssql = Les utilisateurs de MSSQL sont pour l'instant contraint d'utiliser la commande SQL "ALTER ... COLLATE ..." pour corriger ce problème. self_check.no_problem_found=Aucun problème trouvé pour l’instant. self_check.database_collation_mismatch=Exige que la base de données utilise la collation %s. self_check.database_collation_case_insensitive=La base de données utilise la collation %s, insensible à la casse. Bien que Gitea soit compatible, il peut y avoir quelques rares cas qui ne fonctionnent pas comme prévu. self_check.database_inconsistent_collation_columns=La base de données utilise la collation %s, mais ces colonnes utilisent des collations différentes. Cela peut causer des problèmes imprévus. self_check.database_fix_mysql=Pour les utilisateurs de MySQL ou MariaDB, vous pouvez utiliser la commande « gitea doctor convert » dans un terminal ou exécuter une requête du type « ALTER … COLLATE ... » pour résoudre les problèmes de collation. -self_check.database_fix_mssql=Pour les utilisateurs de MSSQL, vous ne pouvez résoudre le problème qu’en exécutant une requête SQL du type « ALTER … COLLATE … ». [action] create_repo=a créé le dépôt %s diff --git a/options/locale/locale_is-IS.ini b/options/locale/locale_is-IS.ini index 3948015902..e448ee4568 100644 --- a/options/locale/locale_is-IS.ini +++ b/options/locale/locale_is-IS.ini @@ -141,7 +141,7 @@ license_desc=Sæktu leiðbeiningaritið áður en þú breytir stillingum. -require_db_desc=Forgejo krefst MySQL, PostgreSQL, MSSQL, SQLite3 eða TiDB (MySQL samskiptareglur). +require_db_desc=Forgejo krefst MySQL, PostgreSQL, SQLite3 eða TiDB (MySQL samskiptareglur). db_title=Gagnagrunnsstillingar db_type=Tegund Gagnagrunns host=Hýsill diff --git a/options/locale/locale_it-IT.ini b/options/locale/locale_it-IT.ini index 9332fbf49b..ee367101a3 100644 --- a/options/locale/locale_it-IT.ini +++ b/options/locale/locale_it-IT.ini @@ -215,7 +215,7 @@ install_desc = Semplicemente la documentazione prima di cambiare qualsiasi impostazione. -require_db_desc=Forgejo requires MySQL, PostgreSQL, MSSQL, SQLite3 or TiDB (MySQL protocol). +require_db_desc=Forgejo requires MySQL, PostgreSQL, SQLite3 or TiDB (MySQL protocol). db_title=Impostazioni database db_type=Tipo di database host=Host @@ -3351,7 +3351,6 @@ monitor.queue.settings.remove_all_items_done = Tutti gli elementi in coda sono s self_check.database_collation_mismatch = Pretendi che la base di dati usi la collazione: %s self_check.database_fix_mysql = Per utenti MySQL/MariaDB, potresti usare il comando "gitea doctor convert" per risolvere problemi di collazione, o potresti risolvere il problema manualmente tramite SQL con "ALTER ... COLLATE ...". self_check.database_collation_case_insensitive = La base di dati sta usando la collazione %s, che è una collazione insensibile. Nonostante Forgejo potrebbe lavorarci, ci potrebbero essere rari casi che non vanno come previsto. -self_check.database_fix_mssql = Gli utenti MSSQL possono provare a risolvere il problema tramite SQL con "ALTER ... COLLATE ..." manualmente, per il momento. [action] diff --git a/options/locale/locale_ja-JP.ini b/options/locale/locale_ja-JP.ini index c5f940b4c3..3a4f414a9b 100644 --- a/options/locale/locale_ja-JP.ini +++ b/options/locale/locale_ja-JP.ini @@ -214,7 +214,7 @@ license_desc=Go get ドキュメントを読んでください。 -require_db_desc=Forgejoには、MySQL、PostgreSQL、MSSQL、SQLite3、またはTiDB(MySQL プロトコル) が必要です。 +require_db_desc=Forgejoには、MySQL、PostgreSQL、SQLite3、またはTiDB(MySQL プロトコル) が必要です。 db_title=データベース設定 db_type=データベースのタイプ host=ホスト diff --git a/options/locale/locale_lv-LV.ini b/options/locale/locale_lv-LV.ini index f4d6eee2b1..3ccc1054c8 100644 --- a/options/locale/locale_lv-LV.ini +++ b/options/locale/locale_lv-LV.ini @@ -197,7 +197,7 @@ license_desc=Iegūsti vadlīninas pirms maināt iestatījumus. -require_db_desc=Forgejo nepieciešams MySQL, PostgreSQL, MSSQL, SQLite3 vai TiDB (izmantojot MySQL protokolu). +require_db_desc=Forgejo nepieciešams MySQL, PostgreSQL, SQLite3 vai TiDB (izmantojot MySQL protokolu). db_title=Datu bāzes iestatījumi db_type=Datu bāzes veids host=Resursdators diff --git a/options/locale/locale_nl-NL.ini b/options/locale/locale_nl-NL.ini index 74f008cd78..52ff71c90d 100644 --- a/options/locale/locale_nl-NL.ini +++ b/options/locale/locale_nl-NL.ini @@ -217,7 +217,7 @@ install_desc = Draai gewoon documentatie voordat je een instelling aanpast. -require_db_desc=Forgejo vereist MySQL, PostgreSQL, MSSQL, SQLite3 of TiDB (MySQL protocol). +require_db_desc=Forgejo vereist MySQL, PostgreSQL, SQLite3 of TiDB (MySQL protocol). db_title=Database-instellingen db_type=Database-type host=Server @@ -3323,7 +3323,6 @@ dashboard.sync_repo_branches = Synchroniseren gemiste branches van git data naar monitor.processes_count = %d Processen monitor.process.children = Kinderen self_check.database_inconsistent_collation_columns = Database gebruikt collatie %s, maar deze kolommen gebruiken onjuiste collaties. Dit kan onverwachte problemen veroorzaken. -self_check.database_fix_mssql = Voor MSSQL gebruikers kan je het probleem alleen oplossen door "ALTER ... COLLATE ..." SQL's handmatig op te lossen. monitor.stacktrace = Stacktrace monitor.download_diagnosis_report = Diagnoserapport downloaden self_check.database_collation_case_insensitive = Database gebruikt collatie %s, wat een ongevoelige collatie is. Hoewel Forgejo ermee kan werken, kunnen er enkele zeldzame gevallen zijn die niet werken zoals verwacht. diff --git a/options/locale/locale_pl-PL.ini b/options/locale/locale_pl-PL.ini index 9a035cd088..ba9f6765a8 100644 --- a/options/locale/locale_pl-PL.ini +++ b/options/locale/locale_pl-PL.ini @@ -160,7 +160,7 @@ license_desc=Pobierz na dokumentację przed wprowadzeniem jakichkolwiek zmian. -require_db_desc=Forgejo wymaga MySQL, PostgreSQL, MSSQL, SQLite3 lub TiDB (protokół MySQL). +require_db_desc=Forgejo wymaga MySQL, PostgreSQL, SQLite3 lub TiDB (protokół MySQL). db_title=Ustawienia bazy danych db_type=Typ bazy danych host=Serwer diff --git a/options/locale/locale_pt-BR.ini b/options/locale/locale_pt-BR.ini index 303ee10b46..e70fa9df57 100644 --- a/options/locale/locale_pt-BR.ini +++ b/options/locale/locale_pt-BR.ini @@ -205,7 +205,7 @@ install_desc = Apenas documentação cuidadosamente antes de alterar qualquer coisa nesta página. -require_db_desc=Forgejo requer MySQL, PostgreSQL, MSSQL, SQLite3 ou TiDB (protocolo MySQL). +require_db_desc=Forgejo requer MySQL, PostgreSQL, SQLite3 ou TiDB (protocolo MySQL). db_title=Configurações de banco de dados db_type=Tipo de banco de dados host=Servidor diff --git a/options/locale/locale_pt-PT.ini b/options/locale/locale_pt-PT.ini index 4562d29fd8..1f05e3e50a 100644 --- a/options/locale/locale_pt-PT.ini +++ b/options/locale/locale_pt-PT.ini @@ -198,7 +198,7 @@ license_desc=Vá buscá-lo em documentação antes de alterar quaisquer configurações. -require_db_desc=Forgejo requer MySQL, PostgreSQL, MSSQL, SQLite3 ou TiDB (protocolo MySQL). +require_db_desc=Forgejo requer MySQL, PostgreSQL, SQLite3 ou TiDB (protocolo MySQL). db_title=Configurações da base de dados db_type=Tipo de base de dados host=Servidor @@ -3256,7 +3256,6 @@ self_check.database_collation_mismatch=Supor que a base de dados usa a colação self_check.database_collation_case_insensitive=A base de dados está a usar a colação %s, que é insensível à diferença entre maiúsculas e minúsculas. Embora o Gitea possa trabalhar com ela, pode haver alguns casos raros que não funcionem como esperado. self_check.database_inconsistent_collation_columns=A base de dados está a usar a colação %s, mas estas colunas estão a usar colações diferentes. Isso poderá causar alguns problemas inesperados. self_check.database_fix_mysql=Para utilizadores do MySQL/MariaDB, pode usar o comando "gitea doctor convert" para resolver os problemas de colação. Também pode resolver o problema com comandos SQL "ALTER ... COLLATE ..." aplicados manualmente. -self_check.database_fix_mssql=Para utilizadores do MSSQL só pode resolver o problema aplicando comandos SQL "ALTER ... COLLATE ..." manualmente, por enquanto. [action] create_repo=criou o repositório %s diff --git a/options/locale/locale_ru-RU.ini b/options/locale/locale_ru-RU.ini index b1c330b27b..102eea9d13 100644 --- a/options/locale/locale_ru-RU.ini +++ b/options/locale/locale_ru-RU.ini @@ -217,7 +217,7 @@ license_desc=Всё это на документацией, прежде чем изменять любые настройки. -require_db_desc=Forgejo требует MySQL, PostgreSQL, MSSQL, SQLite3 или TiDB (по протоколу MySQL). +require_db_desc=Forgejo требует MySQL, PostgreSQL, SQLite3 или TiDB (по протоколу MySQL). db_title=Настройки базы данных db_type=Тип базы данных host=Хост @@ -3349,7 +3349,6 @@ notices.delete_success=Уведомления системы были удале self_check.no_problem_found = Пока проблем не обнаружено. auths.tip.gitea = Зарегистрируйте новое приложение OAuth2. Доступна инструкция: https://forgejo.org/docs/latest/user/oauth2-provider auths.tips.oauth2.general.tip = При регистрации нового приложения OAuth2 ссылка обратного перенаправления должна быть: -self_check.database_fix_mssql = В настоящий момент пользователи MSSQL могут исправить проблемы с сопоставлением только ручным прописыванием "ALTER ... COLLATE ..." в SQL. self_check.database_fix_mysql = Пользователи MySQL и MariaDB могут исправить проблемы с сопоставлением командой "gitea doctor convert". Также можно вручную вписать "ALTER ... COLLATE ..." в SQL. dashboard.cleanup_actions = Очистить устаревшие журналы и артефакты Действий dashboard.sync_repo_branches = Синхронизировать ветки из Git в базу данных diff --git a/options/locale/locale_sk-SK.ini b/options/locale/locale_sk-SK.ini index f6e44b085d..28c3c3cc21 100644 --- a/options/locale/locale_sk-SK.ini +++ b/options/locale/locale_sk-SK.ini @@ -196,7 +196,7 @@ license_desc=Získajte dokumentáciu pred zmenou akýchkoľvek nastavení. -require_db_desc=Forgejo vyžaduje MySQL, PostgreSQL, MSSQL, SQLite3 alebo TiDB (MySQL protokol). +require_db_desc=Forgejo vyžaduje MySQL, PostgreSQL, SQLite3 alebo TiDB (MySQL protokol). db_title=Nastavenie databázy db_type=Typ databázy host=Host diff --git a/options/locale/locale_sl.ini b/options/locale/locale_sl.ini index aba84b9352..cda98d17a4 100644 --- a/options/locale/locale_sl.ini +++ b/options/locale/locale_sl.ini @@ -133,7 +133,7 @@ pull_requests = Zahteve za umik [install] reinstall_confirm_check_3 = Potrjujete, da ste popolnoma prepričani, da se ta program Forgejo izvaja s pravilno lokacijo app.ini, in da ste prepričani, da ga morate znova namestiti. Potrjujete, da se zavedate zgoraj navedenih tveganj. -require_db_desc = Forgejo zahteva MySQL, PostgreSQL, MSSQL, SQLite3 ali TiDB (protokol MySQL). +require_db_desc = Forgejo zahteva MySQL, PostgreSQL, SQLite3 ali TiDB (protokol MySQL). password_algorithm_helper = Nastavite algoritem za stiskanje gesla. Algoritmi imajo različne zahteve in moč. Algoritem argon2 je precej varen, vendar porabi veliko pomnilnika in je lahko neprimeren za majhne sisteme. reinstall_confirm_message = Ponovna namestitev z obstoječo zbirko podatkov Forgejo lahko povzroči več težav. V večini primerov morate za zagon programa Forgejo uporabiti obstoječi "app.ini". Če veste, kaj počnete, potrdite naslednje: err_admin_name_is_reserved = Administrator Uporabniško ime je neveljavno, uporabniško ime je rezervirano diff --git a/options/locale/locale_tr-TR.ini b/options/locale/locale_tr-TR.ini index 54596b3278..0c9aa521c6 100644 --- a/options/locale/locale_tr-TR.ini +++ b/options/locale/locale_tr-TR.ini @@ -197,7 +197,7 @@ license_desc=Gidin ve belgeleri okuyun. -require_db_desc=Forgejo MySQL, PostgreSQL, MSSQL, SQLite3 veya TiDB (MySQL protokolü) gerektirir. +require_db_desc=Forgejo MySQL, PostgreSQL, SQLite3 veya TiDB (MySQL protokolü) gerektirir. db_title=Veritabanı Ayarları db_type=Veritabanı Türü host=Sunucu diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 7a15774140..f30759686e 100644 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -215,7 +215,7 @@ license_desc=所有的代码都开源在 官方文档 后再对本页面进行填写。 -require_db_desc=Forgejo 需要使用 MySQL、PostgreSQL、MSSQL、SQLite3 或 TiDB (MySQL协议) 等数据库 +require_db_desc=Forgejo 需要使用 MySQL、PostgreSQL、SQLite3 或 TiDB (MySQL协议) 等数据库 db_title=数据库设置 db_type=数据库类型 host=数据库主机 @@ -3377,14 +3377,12 @@ self_check.database_collation_mismatch = 期望数据库使用排序规则:%s self_check.database_collation_case_insensitive = 数据库正在使用 %s 排序规则,这是一种不敏感的排序规则。 尽管 Forgejo 可以使用它,但在极少数情况下可能无法按照预期工作。 self_check.database_inconsistent_collation_columns = 数据库正在使用 %s 排序规则,但与这些列使用的排序规则不匹配。 这可能会导致一些意想不到的问题。 self_check.database_fix_mysql = 对于 MySQL/MariaDB 用户,您可以使用 "gitea doctor convert" 命令来修复排序规则问题,也可以通过SQL命令 "ALTER ... COLLATE ..." 来手动修复问题。 -self_check.database_fix_mssql = 对于 MSSQL 用户,目前您只能通过SQL命令 "ALTER ... COLLATE ..." 来手动修复问题。 self_check.no_problem_found=尚未发现问题。 self_check.database_collation_mismatch=期望数据库使用的校验方式:%s self_check.database_collation_case_insensitive=数据库正在使用一个校验 %s, 这是一个不敏感的校验. 虽然Gitea可以与它合作,但可能有一些罕见的情况不如预期的那样起作用。 self_check.database_inconsistent_collation_columns=数据库正在使用%s的排序规则,但是这些列使用了不匹配的排序规则。这可能会造成一些意外问题。 self_check.database_fix_mysql=对于MySQL/MariaDB用户,您可以使用“gitea doctor convert”命令来解决校验问题。 或者您也可以通过 "ALTER ... COLLATE ..." 这样的SQL 来手动解决这个问题。 -self_check.database_fix_mssql=对于MSSQL用户,您现在只能通过"ALTER ... COLLATE ..."SQLs手动解决这个问题。 auths.tips.gmail_settings = Gmail 设置: auths.tip.gitlab_new = 在 https://gitlab.com/-/profile/applications 上注册新应用 config_settings = 设置 diff --git a/options/locale/locale_zh-TW.ini b/options/locale/locale_zh-TW.ini index 871fb11568..1faabf9b99 100644 --- a/options/locale/locale_zh-TW.ini +++ b/options/locale/locale_zh-TW.ini @@ -211,7 +211,7 @@ license_desc=取得 安裝指南再來調整設定。 -require_db_desc=Forgejo 需要 MySQL、PostgreSQL、SQLite3、MSSQL、TiDB (MySQL 協定) 等其中一項。 +require_db_desc=Forgejo 需要 MySQL、PostgreSQL、SQLite3、TiDB (MySQL 協定) 等其中一項。 db_title=資料庫設定 db_type=資料庫類型 host=主機 diff --git a/routers/web/web.go b/routers/web/web.go index 40f4ffc018..71d5efef2c 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -654,7 +654,7 @@ func registerRoutes(m *web.Route) { m.Get("/system_status", admin.SystemStatus) m.Post("", web.Bind(forms.AdminDashboardForm{}), admin.DashboardPost) - if setting.Database.Type.IsMySQL() || setting.Database.Type.IsMSSQL() { + if setting.Database.Type.IsMySQL() { m.Get("/self_check", admin.SelfCheck) } diff --git a/templates/admin/navbar.tmpl b/templates/admin/navbar.tmpl index 16ec1b4b5b..1ec703b296 100644 --- a/templates/admin/navbar.tmpl +++ b/templates/admin/navbar.tmpl @@ -4,7 +4,7 @@ {{ctx.Locale.Tr "admin.dashboard"}} - {{if or .DatabaseType.IsMySQL .DatabaseType.IsMSSQL}} + {{if .DatabaseType.IsMySQL}} {{ctx.Locale.Tr "admin.self_check"}} diff --git a/templates/admin/self_check.tmpl b/templates/admin/self_check.tmpl index 94c4673a49..5c154ac0d5 100644 --- a/templates/admin/self_check.tmpl +++ b/templates/admin/self_check.tmpl @@ -8,8 +8,6 @@ {{if .DatabaseCheckHasProblems}} {{if .DatabaseType.IsMySQL}}
{{ctx.Locale.Tr "admin.self_check.database_fix_mysql"}}
- {{else if .DatabaseType.IsMSSQL}} -
{{ctx.Locale.Tr "admin.self_check.database_fix_mssql"}}
{{end}} {{if .DatabaseCheckCollationMismatch}}
{{ctx.Locale.Tr "admin.self_check.database_collation_mismatch" .DatabaseCheckResult.ExpectedCollation}}
diff --git a/tests/e2e/README.md b/tests/e2e/README.md index e5fd1ca6c0..a0a9fc9ec9 100644 --- a/tests/e2e/README.md +++ b/tests/e2e/README.md @@ -7,7 +7,6 @@ They can be run with make commands for the appropriate backends, namely: make test-sqlite make test-pgsql make test-mysql -make test-mssql ``` Make sure to perform a clean front-end build before running tests: @@ -53,16 +52,6 @@ Start tests based on the database container TEST_PGSQL_HOST=localhost:5432 TEST_PGSQL_DBNAME=test TEST_PGSQL_USERNAME=postgres TEST_PGSQL_PASSWORD=postgres make test-e2e-pgsql ``` -## Run mssql e2e tests -Setup a mssql database inside docker -``` -docker run -e "ACCEPT_EULA=Y" -e "MSSQL_PID=Standard" -e "SA_PASSWORD=MwantsaSecurePassword1" -p 1433:1433 --rm --name mssql microsoft/mssql-server-linux:latest #(just ctrl-c to stop db and clean the container) -``` -Start tests based on the database container -``` -TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=gitea_test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-e2e-mssql -``` - ## Running individual tests Example command to run `example.test.e2e.js` test file: @@ -75,10 +64,10 @@ For SQLite: make test-e2e-sqlite#example ``` -For other databases(replace `mssql` to `mysql` or `pgsql`): +For PostgreSQL databases(replace `mysql` to `pgsql`): ``` -TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-e2e-mssql#example +TEST_MYSQL_HOST=localhost:1433 TEST_MYSQL_DBNAME=test TEST_MYSQL_USERNAME=sa TEST_MYSQL_PASSWORD=MwantsaSecurePassword1 make test-e2e-mysql#example ``` ## Visual testing diff --git a/tests/integration/README.md b/tests/integration/README.md index f6f74ca21f..d659d51b20 100644 --- a/tests/integration/README.md +++ b/tests/integration/README.md @@ -6,7 +6,6 @@ appropriate backends, namely: make test-sqlite make test-pgsql make test-mysql -make test-mssql ``` Make sure to perform a clean build before running tests: @@ -63,16 +62,6 @@ Start tests based on the database container TEST_PGSQL_HOST=localhost:5432 TEST_PGSQL_DBNAME=test TEST_PGSQL_USERNAME=postgres TEST_PGSQL_PASSWORD=postgres make test-pgsql ``` -## Run mssql integration tests -Setup a mssql database inside docker -``` -docker run -e "ACCEPT_EULA=Y" -e "MSSQL_PID=Standard" -e "SA_PASSWORD=MwantsaSecurePassword1" -p 1433:1433 --rm --name mssql microsoft/mssql-server-linux:latest #(just ctrl-c to stop db and clean the container) -``` -Start tests based on the database container -``` -TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=gitea_test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-mssql -``` - ## Running individual tests Example command to run GPG test: @@ -83,10 +72,10 @@ For SQLite: make test-sqlite#GPG ``` -For other databases(replace `mssql` to `mysql`, or `pgsql`): +For other databases (replace `mysql` to `pgsql`): ``` -TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-mssql#GPG +TEST_MYSQL_HOST=localhost:1433 TEST_MYSQL_DBNAME=test TEST_MYSQL_USERNAME=sa TEST_MYSQL_PASSWORD=MwantsaSecurePassword1 make test-mysql#GPG ``` ## Setting timeouts for declaring long-tests and long-flushes diff --git a/tests/integration/README_ZH.md b/tests/integration/README_ZH.md index 6aea4ab212..d0debf2fd6 100644 --- a/tests/integration/README_ZH.md +++ b/tests/integration/README_ZH.md @@ -59,16 +59,6 @@ docker run -e "POSTGRES_DB=test" -p 5432:5432 --rm --name pgsql postgres:14 #(ju TEST_PGSQL_HOST=localhost:5432 TEST_PGSQL_DBNAME=test TEST_PGSQL_USERNAME=postgres TEST_PGSQL_PASSWORD=postgres make test-pgsql ``` -## Run mssql integration tests -同上,首先在 docker 容器里部署一个 mssql 数据库 -``` -docker run -e "ACCEPT_EULA=Y" -e "MSSQL_PID=Standard" -e "SA_PASSWORD=MwantsaSecurePassword1" -p 1433:1433 --rm --name mssql microsoft/mssql-server-linux:latest #(just ctrl-c to stop db and clean the container) -``` -之后便可以基于这个数据库进行集成测试 -``` -TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=gitea_test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-mssql -``` - ## 如何进行自定义的集成测试 下面的示例展示了怎样在集成测试中只进行 GPG 测试: @@ -79,9 +69,9 @@ sqlite 数据库: make test-sqlite#GPG ``` -其它数据库(把 MSSQL 替换为 MYSQL, PGSQL): +其它数据库 (用 PGSQL 取代 MYSQL): ``` -TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-mssql#GPG +TEST_MYSQL_HOST=localhost:1433 TEST_MYSQL_DBNAME=test TEST_MYSQL_USERNAME=sa TEST_MYSQL_PASSWORD=MwantsaSecurePassword1 make test-mysql#GPG ``` diff --git a/tests/integration/db_collation_test.go b/tests/integration/db_collation_test.go index eee26d1ed1..4d822c45a6 100644 --- a/tests/integration/db_collation_test.go +++ b/tests/integration/db_collation_test.go @@ -39,7 +39,7 @@ func TestDatabaseCollationSelfCheckUI(t *testing.T) { htmlDoc.AssertElement(t, "a.item[href*='/admin/self_check']", exists) } - if setting.Database.Type.IsMySQL() || setting.Database.Type.IsMSSQL() { + if setting.Database.Type.IsMySQL() { assertSelfCheckExists(true) } else { assertSelfCheckExists(false) @@ -61,10 +61,9 @@ func TestDatabaseCollation(t *testing.T) { assert.EqualValues(t, 2, cnt) _, _ = x.Exec("DROP TABLE IF EXISTS test_collation_tbl") - // by default, SQLite3 and PostgreSQL are using case-sensitive collations, but MySQL and MSSQL are not - // the following tests are only for MySQL and MSSQL - if !setting.Database.Type.IsMySQL() && !setting.Database.Type.IsMSSQL() { - t.Skip("only MySQL and MSSQL requires the case-sensitive collation check at the moment") + // by default, SQLite3 and PostgreSQL are using case-sensitive collations, but MySQL is not. + if !setting.Database.Type.IsMySQL() { + t.Skip("only MySQL requires the case-sensitive collation check at the moment") return } @@ -86,20 +85,11 @@ func TestDatabaseCollation(t *testing.T) { assert.True(t, r.CollationEquals("abc", "abc")) assert.True(t, r.CollationEquals("abc", "utf8mb4_abc")) assert.False(t, r.CollationEquals("utf8mb4_general_ci", "utf8mb4_unicode_ci")) - } else if setting.Database.Type.IsMSSQL() { - assert.True(t, r.IsCollationCaseSensitive("Latin1_General_CS_AS")) - assert.False(t, r.IsCollationCaseSensitive("Latin1_General_CI_AS")) - assert.True(t, r.CollationEquals("abc", "abc")) - assert.False(t, r.CollationEquals("Latin1_General_CS_AS", "SQL_Latin1_General_CP1_CS_AS")) } else { assert.Fail(t, "unexpected database type") } }) - if setting.Database.Type.IsMSSQL() { - return // skip table converting tests because MSSQL doesn't have a simple solution at the moment - } - t.Run("Convert tables to utf8mb4_bin", func(t *testing.T) { defer tests.PrintCurrentTest(t)() diff --git a/tests/integration/migration-test/gitea-v1.6.4.mssql.sql.gz b/tests/integration/migration-test/gitea-v1.6.4.mssql.sql.gz deleted file mode 100644 index 1b676feda1cbced0754c4ce0751e159e4a078e6f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12969 zcmZ8^Lv$t#(`;p@OLZl7o#Ph3?`*{WN`K%xmtecU6McmBx&&9}PulgRfLJRX0;tS2t5% z{{248Lrm(ua|Or4+}NG56E{!$75afLTGubQ@I?ux*$c#W$iH(f=tA;Fo$HIRy0pf` z98d^cYZn!0q;dt5`XH0Z8x9r3?clwP`P{bDZ@-Z5%Im^Hu|1SMiwRx4G4NO=ln?pE z2rV-FmBoSw-}mKhzl`mJGCv)x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b/tests/integration/migration-test/gitea-v1.7.0.mssql.sql.gz deleted file mode 100644 index bd869cfa5836cddd10010afefa33cc000fefb44d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13068 zcmZ9OLwF?$*DgCr$F^a56A4*txhk*)q5|+5Y;=zvX;5o;WvVSdin_|JQx1)A2echKp^K zz{K_zG&e&4A3surMyM=wSZdHd5B0>uii}=S~{5_FtDLu$PQSkmXVT?l9H04 z{uJ=@(5E;Qd+Uavhsd+XaPyA2_9O8P{dKojaO#H=g1aBY>{xK?X6=dOi#p#|aEb+s zh&iAbtkokS*hs|=F8y9il{XwIgxk?;g~(H*EZGi-(aF=rLa{p%v3l_-(r9~`zlaI> zLG%7HI1@R4`F-Ft?`H+y3x$~`Quj1JU`~FoZ~=7O>iPE@u`Vyj#g4K2s^jY0*x(9k z%0}hRx>iwU5Yl-43%6EV^V0b!ZSH(P^vdIBL-k+p$2`89y;YV6@Y|s%Z{b0wrE*zm z=RVYNuW#tJx}YHQnT?aC{XPX-xQv+n1dF3l3$T443EfUq>go_G3(eo{*V#wt=1&OE z3pDJyo;}L{S;vm<)l2QXxn5+GybWJ#(L+q9Se8AxAHh<9zbbt2DVw1Rcv2_aI&bSz zqCAI3>?ybu2=9Xq0ME2s#|Tyn#=y#|cLkxxH=P%8gtYNR3(HBEzl86yMl>$nb+y-3 zd?76e@S#2S1EhC7n_iukZgoxR|Fo^Q-Q zx4p>TTq?$uR~I2j)+l>$UABgcVJ#Wj3c`ndfsDvrzbw1|fIxc@#D8Z+`wi~+{kU8S zJkMQ4gpZo z&?*Eq95<>}J2!CQQrL$ADNQ&yEf5|#36nf!BnT$g2B^x^I5eC?a@0cGKf(RGeDFGX zT`xNen2+!B9ueSoVcl|Q9Uqql#Md=(>TK8NO01{-YWj2T{b-e_TNz-CY?jY5Uk21J zdd9xtMc?_Nyir$zp%zz9YvFcm58FoQj$1vVuPOt=b_)aC?}e?p5#a3|y8*WM0+}GX zcAw9`F5WRHf+N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Z;t5(f1t|l?EdC31B}PSmr7l{EHU@@9}%>=pj=oos}R{g7|Y3AR8 z2~x+JjsneP7DnCZM6QO5pdL79170*ed`9j>1QKc+w5B1r&`2Hb4aW_mIovQ#v z^ng?y*H0X0`?L;3tBjbt^XY`j%aQVj`^`*0vVN2A6;T<_!mAOcX^mv&h>TWE9G*x3 z_8c8a9-;o=1wl8|)_?Dmbzda883i$m?&WOCNFD2xXS{KY%#Rr5>^v8E%l|YsfXUV# zoJ7-Z{tkx+iaP8R+&2qpx^IO3_2kQSZxU*$Ey1bWA$ZFImmkmuU9Q>O>4Okreh|yq z+4FQ@IimfI#>pb5VRl^ECPzR#_;doD&p$O_LN3fFK*JO#w5oql2^54d0$3}-?ZtlW VF(^bWpi;d%D5~?p!qkHP`aixxiG=_F diff --git a/tests/integration/migration-test/migration_test.go b/tests/integration/migration-test/migration_test.go index d1aa3f3eb8..e0e5620cd2 100644 --- a/tests/integration/migration-test/migration_test.go +++ b/tests/integration/migration-test/migration_test.go @@ -14,7 +14,6 @@ import ( "path/filepath" "regexp" "sort" - "strings" "testing" "code.gitea.io/gitea/models/db" @@ -258,31 +257,6 @@ func restoreOldDB(t *testing.T, version string) bool { _, err = db.Exec(data) assert.NoError(t, err) db.Close() - - case setting.Database.Type.IsMSSQL(): - host, port := setting.ParseMSSQLHostPort(setting.Database.Host) - db, err := sql.Open("mssql", fmt.Sprintf("server=%s; port=%s; database=%s; user id=%s; password=%s;", - host, port, "master", setting.Database.User, setting.Database.Passwd)) - assert.NoError(t, err) - defer db.Close() - - _, err = db.Exec("DROP DATABASE IF EXISTS [gitea]") - assert.NoError(t, err) - - statements := strings.Split(data, "\nGO\n") - for _, statement := range statements { - if len(statement) > 5 && statement[:5] == "USE [" { - dbname := statement[5 : len(statement)-1] - db.Close() - db, err = sql.Open("mssql", fmt.Sprintf("server=%s; port=%s; database=%s; user id=%s; password=%s;", - host, port, dbname, setting.Database.User, setting.Database.Passwd)) - assert.NoError(t, err) - defer db.Close() - } - _, err = db.Exec(statement) - assert.NoError(t, err, "Failure whilst running: %s\nError: %v", statement, err) - } - db.Close() } return true } diff --git a/tests/mssql.ini.tmpl b/tests/mssql.ini.tmpl deleted file mode 100644 index 9346f75874..0000000000 --- a/tests/mssql.ini.tmpl +++ /dev/null @@ -1,107 +0,0 @@ -APP_NAME = Gitea: Git with a cup of tea -RUN_MODE = prod - -[database] -DB_TYPE = mssql -HOST = {{TEST_MSSQL_HOST}} -NAME = {{TEST_MSSQL_DBNAME}} -USER = {{TEST_MSSQL_USERNAME}} -PASSWD = {{TEST_MSSQL_PASSWORD}} -SSL_MODE = disable - -[indexer] -REPO_INDEXER_ENABLED = true -REPO_INDEXER_PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mssql/indexers/repos.bleve - -[queue.issue_indexer] -TYPE = level -DATADIR = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mssql/indexers/issues.queue - -[queue] -TYPE = immediate - -[repository] -ROOT = {{REPO_TEST_DIR}}tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mssql/gitea-repositories - -[repository.local] -LOCAL_COPY_PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mssql/tmp/local-repo - -[repository.upload] -TEMP_PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mssql/tmp/uploads - -[repository.signing] -SIGNING_KEY = none - -[server] -SSH_DOMAIN = localhost -HTTP_PORT = 3003 -ROOT_URL = http://localhost:3003/ -DISABLE_SSH = false -SSH_LISTEN_HOST = localhost -SSH_PORT = 2201 -START_SSH_SERVER = true -LFS_START_SERVER = true -OFFLINE_MODE = false -LFS_JWT_SECRET = Tv_MjmZuHqpIY6GFl12ebgkRAMt4RlWt0v4EHKSXO0w -APP_DATA_PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mssql/data -BUILTIN_SSH_SERVER_USER = git -SSH_TRUSTED_USER_CA_KEYS = ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCb4DC1dMFnJ6pXWo7GMxTchtzmJHYzfN6sZ9FAPFR4ijMLfGki+olvOMO5Fql1/yGnGfbELQa1S6y4shSvj/5K+zUFScmEXYf3Gcr87RqilLkyk16RS+cHNB1u87xTHbETaa3nyCJeGQRpd4IQ4NKob745mwDZ7jQBH8AZEng50Oh8y8fi8skBBBzaYp1ilgvzG740L7uex6fHV62myq0SXeCa+oJUjq326FU8y+Vsa32H8A3e7tOgXZPdt2TVNltx2S9H2WO8RMi7LfaSwARNfy1zu+bfR50r6ef8Yx5YKCMz4wWb1SHU1GS800mjOjlInLQORYRNMlSwR1+vLlVDciOqFapDSbj+YOVOawR0R1aqlSKpZkt33DuOBPx9qe6CVnIi7Z+Px/KqM+OLCzlLY/RS+LbxQpDWcfTVRiP+S5qRTcE3M3UioN/e0BE/1+MpX90IGpvVkA63ILYbKEa4bM3ASL7ChTCr6xN5XT+GpVJveFKK1cfNx9ExHI4rzYE= - -[attachment] -PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mssql/data/attachments - -[mailer] -ENABLED = true -PROTOCOL = dummy -FROM = mssql-{{TEST_TYPE}}-test@gitea.io - -[service] -REGISTER_EMAIL_CONFIRM = false -REGISTER_MANUAL_CONFIRM = false -DISABLE_REGISTRATION = false -ENABLE_CAPTCHA = false -REQUIRE_SIGNIN_VIEW = false -DEFAULT_KEEP_EMAIL_PRIVATE = false -DEFAULT_ALLOW_CREATE_ORGANIZATION = true -NO_REPLY_ADDRESS = noreply.example.org -ENABLE_NOTIFY_MAIL = true - -[picture] -DISABLE_GRAVATAR = false -ENABLE_FEDERATED_AVATAR = false -AVATAR_UPLOAD_PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mssql/data/avatars -REPOSITORY_AVATAR_UPLOAD_PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mssql/data/repo-avatars - -[session] -PROVIDER = file -PROVIDER_CONFIG = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mssql/data/sessions - -[log] -MODE = {{TEST_LOGGER}} -ROOT_PATH = {{REPO_TEST_DIR}}mssql-log -ENABLE_SSH_LOG = true -logger.xorm.MODE = file - -[log.test] -LEVEL = Info -COLORIZE = true - -[log.file] -LEVEL = Debug - -[security] -PASSWORD_HASH_ALGO = argon2 -DISABLE_GIT_HOOKS = false -INSTALL_LOCK = true -SECRET_KEY = 9pCviYTWSb -INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE0OTU1NTE2MTh9.hhSVGOANkaKk3vfCd2jDOIww4pUk0xtg9JRde5UogyQ -DISABLE_QUERY_AUTH_TOKEN = true - -[lfs] -PATH = tests/{{TEST_TYPE}}/gitea-{{TEST_TYPE}}-mssql/data/lfs - -[packages] -ENABLED = true - -[actions] -ENABLED = true diff --git a/tests/test_utils.go b/tests/test_utils.go index 85d7462d73..af83f9027d 100644 --- a/tests/test_utils.go +++ b/tests/test_utils.go @@ -162,18 +162,6 @@ func InitTest(requireGitea bool) { log.Fatal("db.Exec: CREATE SCHEMA: %v", err) } } - - case setting.Database.Type.IsMSSQL(): - host, port := setting.ParseMSSQLHostPort(setting.Database.Host) - db, err := sql.Open("mssql", fmt.Sprintf("server=%s; port=%s; database=%s; user id=%s; password=%s;", - host, port, "master", setting.Database.User, setting.Database.Passwd)) - if err != nil { - log.Fatal("sql.Open: %v", err) - } - if _, err := db.Exec(fmt.Sprintf("If(db_id(N'%s') IS NULL) BEGIN CREATE DATABASE %s; END;", setting.Database.Name, setting.Database.Name)); err != nil { - log.Fatal("db.Exec: %v", err) - } - defer db.Close() } routers.InitWebInstalled(graceful.GetManager().HammerContext()) diff --git a/web_src/js/features/install.js b/web_src/js/features/install.js index 0c2246b933..897f5fb442 100644 --- a/web_src/js/features/install.js +++ b/web_src/js/features/install.js @@ -19,7 +19,6 @@ function initPreInstall() { const defaultDbHosts = { mysql: '127.0.0.1:3306', postgres: '127.0.0.1:5432', - mssql: '127.0.0.1:1433', }; const dbHost = document.getElementById('db_host');