Fix migration query for postgres
continuous-integration/drone/pr Build was killed
Details
continuous-integration/drone/pr Build was killed
Details
This commit is contained in:
parent
1b8b1c0539
commit
bf97c0023c
|
@ -44,12 +44,7 @@ func changeColumnToBigint(x *xorm.Session, table, column string, nullable, defau
|
|||
return err
|
||||
}
|
||||
case "postgres":
|
||||
var notnull = " ALTER COLUMN `" + column + "` SET "
|
||||
if !nullable {
|
||||
notnull = "NOT"
|
||||
}
|
||||
notnull += " NULL"
|
||||
_, err := x.Exec("ALTER TABLE " + table + " ALTER COLUMN `" + column + "` TYPE BIGINT" + notnull)
|
||||
_, err := x.Exec("ALTER TABLE " + table + " ALTER COLUMN `" + column + "` TYPE BIGINT using `" + column + "`::bigint")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue