Fix error on launch when using a fresh database

master
Dragory 2020-05-25 02:45:07 +03:00
parent 2b6061faf8
commit 200b236c75
No known key found for this signature in database
GPG Key ID: 5F387BA66DF8AAC1
1 changed files with 2 additions and 2 deletions

View File

@ -61,8 +61,8 @@ process.on('unhandledRejection', err => {
(async function() { (async function() {
// Make sure the database is up to date // Make sure the database is up to date
const migrationDelta = await knex.migrate.status(); const [completed, newMigrations] = await knex.migrate.list();
if (migrationDelta !== 0) { if (newMigrations.length > 0) {
console.log('Updating database. This can take a while. Don\'t close the bot!'); console.log('Updating database. This can take a while. Don\'t close the bot!');
await knex.migrate.latest(); await knex.migrate.latest();
console.log('Done!'); console.log('Done!');