1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 13:19:44 +02:00
planka/server/db/init.js
Maksim Eltyshev 2ee1166747 feat: Version 2
Closes #627, closes #1047
2025-05-10 02:09:06 +02:00

22 lines
452 B
JavaScript

/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
const initKnex = require('knex');
const knexfile = require('./knexfile');
const knex = initKnex(knexfile);
(async () => {
try {
await knex.migrate.latest();
await knex.seed.run();
} catch (error) {
process.exitCode = 1;
throw error;
} finally {
knex.destroy();
}
})();