fix: Replace reserved keywords in database schemas

Port migration to mariadb
This commit is contained in:
2024-11-21 15:02:30 +01:00
parent 7f43c88a39
commit 35bd7739c6
11 changed files with 222 additions and 65 deletions

View File

@@ -114,6 +114,14 @@ func MigrateDB(backend string, db string) error {
return err
}
v, dirty, err := m.Version()
log.Infof("unsupported database version %d, need %d.\nPlease backup your database file and run cc-backend -migrate-db", v, Version)
if dirty {
return fmt.Errorf("last migration to version %d has failed, please fix the db manually and force version with -force-db flag", Version)
}
if err := m.Up(); err != nil {
if err == migrate.ErrNoChange {
log.Info("DB already up to date!")