summaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-04-24 09:58:24 +0800
committerGitHub <noreply@github.com>2024-04-24 01:58:24 +0000
commit2ad9ef4984f0b68ef38241fd6b557d8427d851d8 (patch)
treecdf58cbabc25ba3acd4b1e650a7234e0abd91f0a /models/migrations
parent1a2ae64b16f10b8d1e17197d18b9eb373faf58db (diff)
downloadgitea-2ad9ef4984f0b68ef38241fd6b557d8427d851d8.tar.gz
gitea-2ad9ef4984f0b68ef38241fd6b557d8427d851d8.zip
Fix some bug on migrations (#30647)
Fix https://github.com/go-gitea/gitea/pull/23894#discussion_r1573718690
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/v1_16/v210.go5
-rw-r--r--models/migrations/v1_22/v286.go2
2 files changed, 1 insertions, 6 deletions
diff --git a/models/migrations/v1_16/v210.go b/models/migrations/v1_16/v210.go
index 533bb4bf80..51b7d81e99 100644
--- a/models/migrations/v1_16/v210.go
+++ b/models/migrations/v1_16/v210.go
@@ -43,11 +43,6 @@ func RemigrateU2FCredentials(x *xorm.Engine) error {
if err != nil {
return err
}
- case schemas.ORACLE:
- _, err := x.Exec("ALTER TABLE webauthn_credential MODIFY credential_id VARCHAR(410)")
- 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.
diff --git a/models/migrations/v1_22/v286.go b/models/migrations/v1_22/v286.go
index fbbd87344f..f46d494dfe 100644
--- a/models/migrations/v1_22/v286.go
+++ b/models/migrations/v1_22/v286.go
@@ -53,7 +53,7 @@ func expandHashReferencesToSha256(x *xorm.Engine) 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]))
+ _, err = db.Exec(fmt.Sprintf("ALTER TABLE [%s] ALTER COLUMN [%s] NVARCHAR(64)", alts[0], alts[1]))
} else {
_, err = db.Exec(fmt.Sprintf("ALTER TABLE `%s` ALTER COLUMN `%s` TYPE VARCHAR(64)", alts[0], alts[1]))
}