fix: auto increment in bigint migration

This commit is contained in:
Ferdinand Mütsch 2021-12-15 13:17:07 +01:00
parent adcd7b35ae
commit 821ae94c1e
1 changed files with 2 additions and 2 deletions

View File

@ -17,10 +17,10 @@ func init() {
if cfg.Db.IsMySQL() {
tx := db.Begin()
if err := tx.Exec("ALTER TABLE heartbeats MODIFY COLUMN id BIGINT UNSIGNED").Error; err != nil {
if err := tx.Exec("ALTER TABLE heartbeats MODIFY COLUMN id BIGINT UNSIGNED AUTO_INCREMENT").Error; err != nil {
return err
}
if err := tx.Exec("ALTER TABLE summary_items MODIFY COLUMN id BIGINT UNSIGNED").Error; err != nil {
if err := tx.Exec("ALTER TABLE summary_items MODIFY COLUMN id BIGINT UNSIGNED AUTO_INCREMENT").Error; err != nil {
return err
}
tx.Commit()