2016-10-03 13:31:29 +01:00
|
|
|
import co from 'co';
|
2020-01-18 10:19:20 +00:00
|
|
|
import models from '../models/index.cjs';
|
2016-10-03 13:31:29 +01:00
|
|
|
|
|
|
|
import debugname from 'debug';
|
2020-01-18 10:19:20 +00:00
|
|
|
const debug = debugname('combine.fm:db');
|
2016-10-03 13:31:29 +01:00
|
|
|
|
2018-04-30 22:20:01 +01:00
|
|
|
co(async function sync() {
|
2016-10-03 13:31:29 +01:00
|
|
|
debug('Syncing schema');
|
2018-04-30 22:20:01 +01:00
|
|
|
await models.sequelize.sync();
|
2016-10-03 13:31:29 +01:00
|
|
|
debug('Schema synced');
|
2020-01-18 10:19:20 +00:00
|
|
|
models.sequelize.close();
|
2016-10-03 13:31:29 +01:00
|
|
|
});
|