mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-27 04:43:12 +03:00
6ab8109f40
Closes #219. Self-explanatory, look at the code.
21 lines
733 B
JavaScript
21 lines
733 B
JavaScript
var GhostBookshelf = require('./base'),
|
|
errors = require('../errorHandling'),
|
|
knex = GhostBookshelf.Knex;
|
|
|
|
module.exports = {
|
|
Post: require('./post').Post,
|
|
User: require('./user').User,
|
|
Role: require('./role').Role,
|
|
Permission: require('./permission').Permission,
|
|
Settings: require('./settings').Settings,
|
|
init: function () {
|
|
return knex.Schema.hasTable('posts').then(null, function () {
|
|
// Simple bootstraping of the data model for now.
|
|
var migration = require('../data/migration/001');
|
|
return migration.down().then(function () {
|
|
return migration.up();
|
|
}, errors.logAndThrowError);
|
|
}, errors.logAndThrowError);
|
|
}
|
|
};
|