1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00

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

This commit is contained in:
Arcady "RKD" Chumachenko 2022-04-20 00:52:42 +01:00 committed by GitHub
parent 938ced9721
commit ce21925a70

View file

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