1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 05:09:43 +02:00
planka/server/db/init.js

23 lines
452 B
JavaScript
Raw Normal View History

/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
2022-06-20 18:27:39 +02:00
const initKnex = require('knex');
2022-06-20 18:27:39 +02:00
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();
}
})();