0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/server/data/migration/005/05-add-subscribers-table.js
Hannah Wolfe c41c09ef97 Subscribers: Migrations for new table + perms
refs #6301

- add new subscribers table with tests
- add permissions for subscribers endpoint
- minor improvments to test code
2016-05-11 10:28:10 +02:00

16 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);
}
});
};