mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-08 10:21:38 +00:00
prevent lossy postgres migration edge cases
This commit is contained in:
parent
8593721c35
commit
cb31fd34d5
5 changed files with 372 additions and 23 deletions
|
|
@ -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 })
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue