mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 12:21:36 +03:00
Added posts.lexical
database field (#15397)
closes https://github.com/TryGhost/Team/issues/1884 - adds `post.lexical` ready for use by the lexical-powered editor re-write - fulfils the same purpose as `posts.mobiledoc` so uses the same field properties - added `lexical` to allowed formats in Post model so it won't be included by default in API responses meaning tests/snapshots don't need updating at present
This commit is contained in:
parent
890279a95b
commit
8cdd2e10b7
@ -0,0 +1,8 @@
|
|||||||
|
const {createAddColumnMigration} = require('../../utils');
|
||||||
|
|
||||||
|
module.exports = createAddColumnMigration('posts', 'lexical', {
|
||||||
|
type: 'text',
|
||||||
|
maxlength: 1000000000,
|
||||||
|
fieldtype: 'long',
|
||||||
|
nullable: true
|
||||||
|
});
|
@ -45,6 +45,7 @@ module.exports = {
|
|||||||
title: {type: 'string', maxlength: 2000, nullable: false, validations: {isLength: {max: 255}}},
|
title: {type: 'string', maxlength: 2000, nullable: false, validations: {isLength: {max: 255}}},
|
||||||
slug: {type: 'string', maxlength: 191, nullable: false},
|
slug: {type: 'string', maxlength: 191, nullable: false},
|
||||||
mobiledoc: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
mobiledoc: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
||||||
|
lexical: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
||||||
html: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
html: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
||||||
comment_id: {type: 'string', maxlength: 50, nullable: true},
|
comment_id: {type: 'string', maxlength: 50, nullable: true},
|
||||||
plaintext: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
plaintext: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
||||||
|
@ -974,7 +974,7 @@ Post = ghostBookshelf.Model.extend({
|
|||||||
return filter;
|
return filter;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
allowedFormats: ['mobiledoc', 'html', 'plaintext'],
|
allowedFormats: ['mobiledoc', 'lexical', 'html', 'plaintext'],
|
||||||
|
|
||||||
orderDefaultOptions: function orderDefaultOptions() {
|
orderDefaultOptions: function orderDefaultOptions() {
|
||||||
return {
|
return {
|
||||||
|
@ -12,6 +12,7 @@ module.exports = [
|
|||||||
exclude: [
|
exclude: [
|
||||||
'title',
|
'title',
|
||||||
'mobiledoc',
|
'mobiledoc',
|
||||||
|
'lexical',
|
||||||
'html',
|
'html',
|
||||||
'plaintext',
|
'plaintext',
|
||||||
// @TODO: https://github.com/TryGhost/Ghost/issues/10335
|
// @TODO: https://github.com/TryGhost/Ghost/issues/10335
|
||||||
@ -55,6 +56,7 @@ module.exports = [
|
|||||||
exclude: [
|
exclude: [
|
||||||
'title',
|
'title',
|
||||||
'mobiledoc',
|
'mobiledoc',
|
||||||
|
'lexical',
|
||||||
'html',
|
'html',
|
||||||
'plaintext',
|
'plaintext',
|
||||||
// @TODO: https://github.com/TryGhost/Ghost/issues/10335
|
// @TODO: https://github.com/TryGhost/Ghost/issues/10335
|
||||||
|
@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
|
|||||||
*/
|
*/
|
||||||
describe('DB version integrity', function () {
|
describe('DB version integrity', function () {
|
||||||
// Only these variables should need updating
|
// Only these variables should need updating
|
||||||
const currentSchemaHash = '823828c5eafb58c0916307d41e834538';
|
const currentSchemaHash = '9cc4c1dae2237d960081d77aa4a528cc';
|
||||||
const currentFixturesHash = '8cf221f0ed930ac1fe8030a58e60d64b';
|
const currentFixturesHash = '8cf221f0ed930ac1fe8030a58e60d64b';
|
||||||
const currentSettingsHash = 'd54210758b7054e2174fd34aa2320ad7';
|
const currentSettingsHash = 'd54210758b7054e2174fd34aa2320ad7';
|
||||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||||
|
Loading…
Reference in New Issue
Block a user