mirror of
https://github.com/plankanban/planka.git
synced 2025-12-22 01:11:29 +03:00
Docker, update readme, update dependencies
This commit is contained in:
19
server/db/init.js
Normal file
19
server/db/init.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const config = require('./knexfile');
|
||||
const knex = require('knex')(config);
|
||||
|
||||
(async function () {
|
||||
try {
|
||||
const exists = await knex.schema.hasTable(config.migrations.tableName);
|
||||
|
||||
if (!exists) {
|
||||
await knex.migrate.latest();
|
||||
await knex.seed.run();
|
||||
}
|
||||
} catch (error) {
|
||||
process.exitCode = 1;
|
||||
|
||||
throw error;
|
||||
} finally {
|
||||
knex.destroy();
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user