mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Insert new info post fixture for upgrades
no issue - Inserts an extra post fixture into the DB only when upgrading - Post fixture is a draft and will appear at the top of the list
This commit is contained in:
parent
a3f107da8e
commit
b2204f404d
2 changed files with 28 additions and 0 deletions
|
@ -21,6 +21,21 @@
|
|||
}
|
||||
],
|
||||
|
||||
"posts_0_7": [
|
||||
{
|
||||
"title": "You've been upgraded to the latest version of Ghost",
|
||||
"slug": "ghost-0-7",
|
||||
"markdown": "You've just upgraded to the latest version of Ghost and we've made a few changes that you should probably know about!\n\n## Woah, why does everything look different?\n\nAfter two years and hundreds of thousands of users, we learned a great deal about what was (and wasn't) working in the old Ghost admin user interface. What you're looking at is Ghost's first major UI refresh, with a strong focus on being more usable and robust all round.\n\n![New Design](https://ghost.org/images/zelda.png)\n\nThe main navigation menu, previously located at the top of your screen, has now moved over to the left. This makes it way easier to work with on mobile devices, and has the added benefit of providing ample space for upcoming features!\n\n## Lost and found: Your old posts\n\nFrom talking to many of you we understand that finding old posts in the admin area was a real pain; so we've added a new magical search bar which lets you quickly find posts for editing, without having to scroll endlessly. Take it for a spin!\n\n![Search](https://ghost.org/images/search.gif)\n\nQuestions? Comments? Send us a tweet [@TryGhost](https://twitter.com/tryghost)\n\nOh, and yes – you can safely delete this draft post!",
|
||||
"image": null,
|
||||
"featured": false,
|
||||
"page": false,
|
||||
"status": "draft",
|
||||
"language": "en_US",
|
||||
"meta_title": null,
|
||||
"meta_description": null
|
||||
}
|
||||
],
|
||||
|
||||
"tags": [
|
||||
{
|
||||
"name": "Getting Started",
|
||||
|
|
|
@ -290,6 +290,19 @@ to004 = function to004() {
|
|||
});
|
||||
ops.push(upgradeOp);
|
||||
|
||||
// Add a new draft post
|
||||
upgradeOp = models.Post.findOne({slug: fixtures.posts_0_7[0].slug, status: 'all'}, options).then(function (post) {
|
||||
if (!post) {
|
||||
logInfo('Adding 0.7 upgrade post fixture');
|
||||
// Set the published_at timestamp, but keep the post as a draft so doesn't appear on the frontend
|
||||
// This is a hack to ensure that this post appears at the very top of the drafts list, because
|
||||
// unpublished posts always appear first
|
||||
fixtures.posts_0_7[0].published_at = Date.now();
|
||||
return models.Post.add(fixtures.posts_0_7[0], options);
|
||||
}
|
||||
});
|
||||
ops.push(upgradeOp);
|
||||
|
||||
return Promise.all(ops);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue