Added type column to posts table

refs #10922

This column is limited to the two values 'post' and 'page'
This commit is contained in:
Fabien O'Carroll 2019-07-23 15:23:54 +08:00
parent c713847718
commit 9b85fc6a69
3 changed files with 7 additions and 0 deletions

View File

@ -20,6 +20,7 @@ module.exports = {
feature_image: {type: 'string', maxlength: 2000, nullable: true},
featured: {type: 'bool', nullable: false, defaultTo: false},
page: {type: 'bool', nullable: false, defaultTo: false},
type: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'post', validations: {isIn: [['post', 'page']]}},
status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'draft'},
locale: {type: 'string', maxlength: 6, nullable: true},
visibility: {

View File

@ -31,6 +31,8 @@ const expectedProperties = {
.without('visibility')
.without('locale')
.without('page')
// v2 API doesn't return new type field
.without('type')
// deprecated
.without('author_id')
// always returns computed properties
@ -46,6 +48,8 @@ const expectedProperties = {
.without('visibility')
.without('locale')
.without('page')
// v2 API doesn't return new type field
.without('type')
// deprecated
.without('author_id')
// always returns computed properties

View File

@ -23,6 +23,8 @@ const expectedProperties = {
.without('locale', 'visibility')
// These fields aren't useful as they always have known values
.without('status')
// v2 API doesn't return new type field
.without('type')
// @TODO: https://github.com/TryGhost/Ghost/issues/10335
// .without('page')
// v2 returns a calculated excerpt field