mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-07 09:51:37 +00:00
handle postgres alias casing in migration metadata
This commit is contained in:
parent
f31826c256
commit
920a7434f1
1 changed files with 4 additions and 4 deletions
|
|
@ -202,15 +202,15 @@ class MigrationManager {
|
||||||
const migrationsMetaTable = `"${MigrationManager.MIGRATIONS_META_TABLE}"`
|
const migrationsMetaTable = `"${MigrationManager.MIGRATIONS_META_TABLE}"`
|
||||||
await this.checkOrCreateMigrationsMetaTable()
|
await this.checkOrCreateMigrationsMetaTable()
|
||||||
|
|
||||||
const [{ version }] = await this.sequelize.query(`SELECT value as version FROM ${migrationsMetaTable} WHERE key = 'version'`, {
|
const [versionRow] = await this.sequelize.query(`SELECT value as version FROM ${migrationsMetaTable} WHERE key = 'version'`, {
|
||||||
type: Sequelize.QueryTypes.SELECT
|
type: Sequelize.QueryTypes.SELECT
|
||||||
})
|
})
|
||||||
this.databaseVersion = version
|
this.databaseVersion = versionRow?.version
|
||||||
|
|
||||||
const [{ maxVersion }] = await this.sequelize.query(`SELECT value as maxVersion FROM ${migrationsMetaTable} WHERE key = 'maxVersion'`, {
|
const [maxVersionRow] = await this.sequelize.query(`SELECT value as maxVersion FROM ${migrationsMetaTable} WHERE key = 'maxVersion'`, {
|
||||||
type: Sequelize.QueryTypes.SELECT
|
type: Sequelize.QueryTypes.SELECT
|
||||||
})
|
})
|
||||||
this.maxVersion = maxVersion
|
this.maxVersion = maxVersionRow?.maxVersion || maxVersionRow?.maxversion
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkOrCreateMigrationsMetaTable() {
|
async checkOrCreateMigrationsMetaTable() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue