From 200b236c75c790563f0ee66eb3d27c16f51a1533 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Mon, 25 May 2020 02:45:07 +0300 Subject: [PATCH] Fix error on launch when using a fresh database --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index f43c33f..3e1615e 100644 --- a/src/index.js +++ b/src/index.js @@ -61,8 +61,8 @@ process.on('unhandledRejection', err => { (async function() { // Make sure the database is up to date - const migrationDelta = await knex.migrate.status(); - if (migrationDelta !== 0) { + const [completed, newMigrations] = await knex.migrate.list(); + if (newMigrations.length > 0) { console.log('Updating database. This can take a while. Don\'t close the bot!'); await knex.migrate.latest(); console.log('Done!');