feat: Alway apply migrations on start-up (#172)

pull/217/head
Arcady "RKD" Chumachenko 4 years ago committed by GitHub
parent 16a822cc7d
commit 5049034ae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -6,8 +6,8 @@ const knex = require('knex')(config); // eslint-disable-line import/order
try {
const isExists = await knex.schema.hasTable(config.migrations.tableName);
await knex.migrate.latest();
if (!isExists) {
await knex.migrate.latest();
await knex.seed.run();
}
} catch (error) {

Loading…
Cancel
Save