mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
20 lines
415 B
JavaScript
20 lines
415 B
JavaScript
const config = require('./knexfile');
|
|
|
|
const knex = require('knex')(config); // eslint-disable-line import/order
|
|
|
|
(async () => {
|
|
try {
|
|
const isExists = await knex.schema.hasTable(config.migrations.tableName);
|
|
|
|
if (!isExists) {
|
|
await knex.migrate.latest();
|
|
await knex.seed.run();
|
|
}
|
|
} catch (error) {
|
|
process.exitCode = 1;
|
|
|
|
throw error;
|
|
} finally {
|
|
knex.destroy();
|
|
}
|
|
})();
|