prevent lossy postgres migration edge cases

This commit is contained in:
Kevin Gatera 2026-03-02 17:45:32 -05:00
parent 8593721c35
commit cb31fd34d5
No known key found for this signature in database
GPG key ID: F0D9F5932458CFB9
5 changed files with 372 additions and 23 deletions

View file

@ -412,6 +412,11 @@ class Database {
require('./models/CustomMetadataProvider').init(this.sequelize)
require('./models/MediaItemShare').init(this.sequelize)
if (this.isPostgresDialect() && !force && !this.isNew) {
Logger.info('[Database] Skipping sequelize.sync for existing postgres schema')
return Promise.resolve()
}
return this.sequelize.sync({ force, alter: false })
}