mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-24 08:02:18 +02:00
use same sql for set default statement on mysql/mariadb and postgres (#1540)
introduced by #1027 so it does not need a changelog or backport
This commit is contained in:
parent
fecb0354bb
commit
c276bc8937
@ -215,10 +215,7 @@ func dropTableColumns(sess *xorm.Session, tableName string, columnNames ...strin
|
||||
func alterColumnDefault(sess *xorm.Session, table, column, defValue string) error {
|
||||
dialect := sess.Engine().Dialect().URI().DBType
|
||||
switch dialect {
|
||||
case schemas.MYSQL:
|
||||
_, err := sess.Exec(fmt.Sprintf("ALTER TABLE `%s` COLUMN `%s` SET DEFAULT %s;", table, column, defValue))
|
||||
return err
|
||||
case schemas.POSTGRES:
|
||||
case schemas.MYSQL, schemas.POSTGRES:
|
||||
_, err := sess.Exec(fmt.Sprintf("ALTER TABLE `%s` ALTER COLUMN `%s` SET DEFAULT %s;", table, column, defValue))
|
||||
return err
|
||||
case schemas.SQLITE:
|
||||
|
Loading…
Reference in New Issue
Block a user