ERROR: relation "users" does not exist

This commit is contained in:
lesion 2022-06-24 15:57:50 +02:00
parent 8b69a3cb0b
commit cf71d17f2f
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -2,6 +2,7 @@ const Sequelize = require('sequelize')
const Umzug = require('umzug')
const path = require('path')
const config = require('../../config')
const { col } = require('../../helpers')
const log = require('../../log')
const settingsController = require('../controller/settings')
@ -30,7 +31,7 @@ const db = {
return db.sequelize.authenticate()
},
async isEmpty () {
const users = await db.sequelize.query('SELECT * from users').catch(e => {})
const users = await db.sequelize.query(`SELECT * from ${col('users')}`).catch(e => {})
return !(users && users.length)
},
async runMigrations () {