mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Fixed post meta migration for 3.x (#11438)
no issue Since we added `email_subject` to `posts_meta` table in `3.1`, the migration tries to add `email_subject` column from post table, which does not exist and thus tries adding `undefined` value for column. Since sqlite expects default values while inserting new columns, this breaks any migration directly from `1.x`/`2.x` to 3.x. The fix adds a default `null` value for any post_schema entry which doesn't has a value.
This commit is contained in:
parent
a3c2209420
commit
169daead1f
1 changed files with 1 additions and 1 deletions
|
@ -35,7 +35,7 @@ module.exports.up = (options) => {
|
|||
let postsMetaEntries = _.map(posts, (post) => {
|
||||
let postsMetaEntry = metaAttrs.reduce(function (obj, entry) {
|
||||
return Object.assign(obj, {
|
||||
[entry]: post.get(entry)
|
||||
[entry]: post.get(entry) || null
|
||||
});
|
||||
}, {});
|
||||
postsMetaEntry.post_id = post.get('id');
|
||||
|
|
Loading…
Add table
Reference in a new issue