1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: drop_badges_column migration for sqlite

This commit is contained in:
Steven Tang 2021-02-16 19:23:18 +11:00
parent 759e8e4dfd
commit c149766ecc
No known key found for this signature in database
GPG Key ID: AA0C5A4496B7ADF5
2 changed files with 10 additions and 3 deletions

View File

@ -37,11 +37,18 @@ func init() {
return err
}
// do not drop column for sqlite, fixes #128:
// [ERROR] migration '20210206_drop_badges_column_add_sharing_flags' failed table users already exists
// https://stackoverflow.com/a/8442173
if cfg.Db.Dialect == config.SQLDialectSqlite {
logbuch.Info("not attempting to drop and regenerate constraints on sqlite")
return nil
}
if err := migrator.DropColumn(&models.User{}, "badges_enabled"); err != nil {
return err
} else {
logbuch.Info("dropped column 'badges_enabled' after substituting it by sharing indicators")
}
logbuch.Info("dropped column 'badges_enabled' after substituting it by sharing indicators")
return nil
},

View File

@ -1 +1 @@
1.24.2
1.24.3