0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/core/server/data/migrations/init/1-create-tables.js
Katharina Irrgang c4fa34224f Migration runner - first iteration (#7501)
refs #7489
- add independent migratio runner
- add init script
- this is not connected to Ghost yet, but next PR will
2016-10-10 13:27:31 +01:00

14 lines
489 B
JavaScript

var Promise = require('bluebird'),
commands = require('../../schema').commands,
logging = require('../../../logging'),
schema = require('../../schema').tables,
schemaTables = Object.keys(schema);
module.exports = function createTables(options) {
var database = options.database;
return Promise.mapSeries(schemaTables, function createTable(table) {
logging.info('Creating table: ' + table);
return commands.createTable(table, database);
});
};