mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-30 12:20:33 +00: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
1 changed files with 1 additions and 4 deletions
|
@ -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 a new issue