mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +00:00
[CHORE] Remove Microsoft SQL Server Support
- Per https://codeberg.org/forgejo/discussions/issues/122
This commit is contained in:
parent
af47c583b4
commit
2d9afd0c21
70 changed files with 70 additions and 789 deletions
|
@ -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")
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue