mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
17 lines
460 B
JavaScript
17 lines
460 B
JavaScript
|
var commands = require('../../schema').commands,
|
||
|
db = require('../../db'),
|
||
|
|
||
|
table = 'subscribers',
|
||
|
message = 'Creating table: ' + table;
|
||
|
|
||
|
module.exports = function addSubscribersTable(logger) {
|
||
|
return db.knex.schema.hasTable(table).then(function (exists) {
|
||
|
if (!exists) {
|
||
|
logger.info(message);
|
||
|
return commands.createTable(table);
|
||
|
} else {
|
||
|
logger.warn(message);
|
||
|
}
|
||
|
});
|
||
|
};
|