mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 03:12:54 +03:00
3e21940b18
hooking into when ghost has finished loading addresses item 9 in #2078 and makes progress on #2182 - has files that startup ghost return a promise that is resolved once ghost has finished loading - moves getSocket into config file - removes models.reset() as it's not used anywhere - update functions in server startup - remove unused version hash variable
35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
var migrations = require('../data/migration'),
|
|
_ = require('lodash');
|
|
|
|
module.exports = {
|
|
Post: require('./post').Post,
|
|
User: require('./user').User,
|
|
Role: require('./role').Role,
|
|
Permission: require('./permission').Permission,
|
|
Settings: require('./settings').Settings,
|
|
Tag: require('./tag').Tag,
|
|
Base: require('./base'),
|
|
Session: require('./session').Session,
|
|
|
|
init: function () {
|
|
return migrations.init();
|
|
},
|
|
// ### deleteAllContent
|
|
// Delete all content from the database (posts, tags, tags_posts)
|
|
deleteAllContent: function () {
|
|
var self = this;
|
|
|
|
return self.Post.browse().then(function (posts) {
|
|
_.each(posts.toJSON(), function (post) {
|
|
self.Post.destroy(post.id);
|
|
});
|
|
}).then(function () {
|
|
self.Tag.browse().then(function (tags) {
|
|
_.each(tags.toJSON(), function (tag) {
|
|
self.Tag.destroy(tag.id);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
};
|