1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/migrator.js

18 lines
428 B
JavaScript
Raw Normal View History

'use strict';
2016-12-13 13:59:52 +01:00
require('db-migrate-shared').log.setLogLevel('error');
2016-11-13 15:15:33 +01:00
const { getInstance } = require('db-migrate');
function migrateDb({ db, databaseSchema = 'public' }) {
const custom = Object.assign({}, db, { schema: databaseSchema });
2016-11-13 15:15:33 +01:00
const dbmigrate = getInstance(true, {
2016-11-10 21:15:16 +01:00
cwd: __dirname,
2016-11-12 11:21:40 +01:00
config: { custom },
env: 'custom',
});
return dbmigrate.up();
}
2016-11-13 15:15:33 +01:00
module.exports = migrateDb;