[CHORE] Remove Microsoft SQL Server Support

- Per https://codeberg.org/forgejo/discussions/issues/122
This commit is contained in:
Gusted 2024-04-04 18:02:24 +02:00
parent af47c583b4
commit 2d9afd0c21
No known key found for this signature in database
GPG key ID: FD821B732837125F
70 changed files with 70 additions and 789 deletions

View file

@ -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)()