mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-30 18:11:52 +02:00
Fix migrationMeta database version initial value, and move isDatabaseNew logic inside MigrationManager
This commit is contained in:
+2
-2
@@ -171,9 +171,9 @@ class Database {
|
||||
}
|
||||
|
||||
try {
|
||||
const migrationManager = new MigrationManager(this.sequelize, global.ConfigPath)
|
||||
const migrationManager = new MigrationManager(this.sequelize, this.isNew, global.ConfigPath)
|
||||
await migrationManager.init(packageJson.version)
|
||||
if (!this.isNew) await migrationManager.runMigrations()
|
||||
await migrationManager.runMigrations()
|
||||
} catch (error) {
|
||||
Logger.error(`[Database] Failed to run migrations`, error)
|
||||
throw new Error('Database migration failed')
|
||||
|
||||
Reference in New Issue
Block a user