0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/core/shared/models/index.js

28 lines
859 B
JavaScript
Raw Normal View History

2013-06-01 10:47:41 -04:00
/*global require, module */
(function () {
"use strict";
var GhostBookshelf = require('./base'),
knex = GhostBookshelf.Knex;
module.exports = {
Post: require('./post').Post,
User: require('./user').User,
Role: require('./role').Role,
Permission: require('./permission').Permission,
2013-06-01 10:47:41 -04:00
Setting: require('./setting').Setting,
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();
});
}).then(function () {
console.log('models loaded');
});
}
};
}());