mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
15 lines
489 B
JavaScript
15 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);
|
||
|
});
|
||
|
};
|