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

Added post_revisions table (#15420)

no issue

- initially this will perform the same function as `mobiledoc_revisions` but storing `lexical` instead of `mobiledoc`
- naming is intentionally generic ready for later expansions
This commit is contained in:
Kevin Ansfield 2022-09-16 10:19:05 +01:00 committed by GitHub
parent f9e5d57f0d
commit 1581f439e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 1 deletions

View file

@ -21,6 +21,7 @@ const BACKUP_TABLES = [
'tokens',
'sessions',
'mobiledoc_revisions',
'post_revisions',
'email_batches',
'email_recipients',
'members_cancel_events',

View file

@ -0,0 +1,9 @@
const {addTable} = require('../../utils');
module.exports = addTable('post_revisions', {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
post_id: {type: 'string', maxlength: 24, nullable: false, index: true},
lexical: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
created_at_ts: {type: 'bigInteger', nullable: false},
created_at: {type: 'dateTime', nullable: false}
});

View file

@ -387,6 +387,13 @@ module.exports = {
created_at_ts: {type: 'bigInteger', nullable: false},
created_at: {type: 'dateTime', nullable: false}
},
post_revisions: {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
post_id: {type: 'string', maxlength: 24, nullable: false, index: true},
lexical: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
created_at_ts: {type: 'bigInteger', nullable: false},
created_at: {type: 'dateTime', nullable: false}
},
members: {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
uuid: {type: 'string', maxlength: 36, nullable: true, unique: true, validations: {isUUID: true}},

View file

@ -61,6 +61,7 @@ describe('Exporter', function () {
'permissions',
'permissions_roles',
'permissions_users',
'post_revisions',
'posts',
'posts_authors',
'posts_meta',

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 = '9cc4c1dae2237d960081d77aa4a528cc';
const currentSchemaHash = 'cd7c94ce33c1e22b05335f05ab4fd86c';
const currentFixturesHash = '8cf221f0ed930ac1fe8030a58e60d64b';
const currentSettingsHash = '2978a5684a2d5fcf089f61f5d368a0c0';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';