Fix error on launch when using a fresh database
parent
2b6061faf8
commit
200b236c75
|
@ -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!');
|
||||
|
|
Loading…
Reference in New Issue