Skip to content

Commit 2ad9ef4

Browse files
authored
Fix some bug on migrations (#30647)
Fix #23894 (comment)
1 parent 1a2ae64 commit 2ad9ef4

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

models/migrations/v1_16/v210.go

-5
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ func RemigrateU2FCredentials(x *xorm.Engine) error {
4343
if err != nil {
4444
return err
4545
}
46-
case schemas.ORACLE:
47-
_, err := x.Exec("ALTER TABLE webauthn_credential MODIFY credential_id VARCHAR(410)")
48-
if err != nil {
49-
return err
50-
}
5146
case schemas.MSSQL:
5247
// This column has an index on it. I could write all of the code to attempt to change the index OR
5348
// I could just use recreate table.

models/migrations/v1_22/v286.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func expandHashReferencesToSha256(x *xorm.Engine) error {
5353
if setting.Database.Type.IsMySQL() {
5454
_, err = db.Exec(fmt.Sprintf("ALTER TABLE `%s` MODIFY COLUMN `%s` VARCHAR(64)", alts[0], alts[1]))
5555
} else if setting.Database.Type.IsMSSQL() {
56-
_, err = db.Exec(fmt.Sprintf("ALTER TABLE [%s] ALTER COLUMN [%s] VARCHAR(64)", alts[0], alts[1]))
56+
_, err = db.Exec(fmt.Sprintf("ALTER TABLE [%s] ALTER COLUMN [%s] NVARCHAR(64)", alts[0], alts[1]))
5757
} else {
5858
_, err = db.Exec(fmt.Sprintf("ALTER TABLE `%s` ALTER COLUMN `%s` TYPE VARCHAR(64)", alts[0], alts[1]))
5959
}

0 commit comments

Comments
 (0)