0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Added columns to store feature image metadata for revision

We need this to correctly display the difference with feature images and to
restore them.
This commit is contained in:
Fabien "egg" O'Carroll 2023-04-21 14:10:17 +01:00
parent f68936900c
commit bbdbcd02ef
4 changed files with 20 additions and 4 deletions

View file

@ -0,0 +1,14 @@
const {combineNonTransactionalMigrations,createAddColumnMigration} = require('../../utils');
module.exports = combineNonTransactionalMigrations(
createAddColumnMigration('post_revisions', 'feature_image_caption', {
type: 'string',
maxlength: 65535,
nullable: true
}),
createAddColumnMigration('post_revisions', 'feature_image_alt', {
type: 'string',
maxlength: 191,
nullable: true
})
);

View file

@ -407,7 +407,9 @@ module.exports = {
title: {type: 'string', maxlength: 2000, nullable: true, validations: {isLength: {max: 255}}},
post_status: {type: 'string', maxlength: 50, nullable: true, validations: {isIn: [['draft', 'published', 'scheduled', 'sent']]}},
reason: {type: 'string', maxlength: 50, nullable: true},
feature_image: {type: 'string', maxlength: 2000, nullable: true}
feature_image: {type: 'string', maxlength: 2000, nullable: true},
feature_image_alt: {type: 'string', maxlength: 191, nullable: true, validations: {isLength: {max: 125}}},
feature_image_caption: {type: 'text', maxlength: 65535, nullable: true}
},
members: {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},

View file

@ -831,7 +831,7 @@ exports[`Posts API Create Can create a post with lexical 2: [headers] 1`] = `
Object {
"access-control-allow-origin": "http://127.0.0.1:2369",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
"content-length": "5312",
"content-length": "5363",
"content-type": "application/json; charset=utf-8",
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
@ -1371,7 +1371,7 @@ exports[`Posts API Update Can update a post with lexical 4: [headers] 1`] = `
Object {
"access-control-allow-origin": "http://127.0.0.1:2369",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
"content-length": "6517",
"content-length": "6619",
"content-type": "application/json; charset=utf-8",
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,

View file

@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
*/
describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = 'c3b0d8e83f681893057906495ac051e1';
const currentSchemaHash = '2445c734ffb514d11b56e74591bcde4e';
const currentFixturesHash = '869ceb3302303494c645f4201540ead3';
const currentSettingsHash = 'f9db81a9d2fe2fed5e9cfda1ccd2b3cc';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';