mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Added post-status
and reason
col to post_revisions
(#16693)
refs https://github.com/TryGhost/Team/issues/3099 <!-- Leave the line below if you'd like GitHub Copilot to generate a summary from your commit --> <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at 83140b5</samp> This pull request adds a new column `post_status` to the `post_revisions` table to store the status of the post revision. It also updates the schema definition, the migration file, and the integrity test to reflect the new column.
This commit is contained in:
parent
b893ec13ab
commit
3cf6800e3e
4 changed files with 23 additions and 4 deletions
|
@ -0,0 +1,17 @@
|
|||
// For information on writing migrations, see https://www.notion.so/ghost/Database-migrations-eb5b78c435d741d2b34a582d57c24253
|
||||
|
||||
const {combineNonTransactionalMigrations,createAddColumnMigration} = require('../../utils');
|
||||
|
||||
module.exports = combineNonTransactionalMigrations(
|
||||
createAddColumnMigration('post_revisions', 'post_status', {
|
||||
type: 'string',
|
||||
maxlength: 50,
|
||||
nullable: true,
|
||||
defaultTo: 'draft'
|
||||
}),
|
||||
createAddColumnMigration('post_revisions', 'reason', {
|
||||
type: 'string',
|
||||
maxlength: 50,
|
||||
nullable: true
|
||||
})
|
||||
);
|
|
@ -405,6 +405,8 @@ module.exports = {
|
|||
created_at: {type: 'dateTime', nullable: false},
|
||||
author_id: {type: 'string', maxlength: 24, nullable: true, references: 'users.id', cascadeDelete: false, constraintName: 'post_revs_author_id_foreign'},
|
||||
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}
|
||||
},
|
||||
members: {
|
||||
|
|
|
@ -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": "5262",
|
||||
"content-length": "5295",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
|
@ -1261,7 +1261,7 @@ exports[`Posts API Update Can update 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": "5199",
|
||||
"content-length": "5232",
|
||||
"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": "6420",
|
||||
"content-length": "6486",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
|
|
|
@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
|
|||
*/
|
||||
describe('DB version integrity', function () {
|
||||
// Only these variables should need updating
|
||||
const currentSchemaHash = '05bb5d84875ec3b6ed6aca8228dec986';
|
||||
const currentSchemaHash = 'c3b0d8e83f681893057906495ac051e1';
|
||||
const currentFixturesHash = '869ceb3302303494c645f4201540ead3';
|
||||
const currentSettingsHash = 'f9db81a9d2fe2fed5e9cfda1ccd2b3cc';
|
||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||
|
|
Loading…
Add table
Reference in a new issue