Removed "object" as a valid value for settings type

refs https://github.com/TryGhost/Ghost/issues/10318

- Storing JSON object in settings has caused multiple bugs in the past and was considered an antipattern
- This is a last bit in the long process of getting rid of "object" settings in the database. At this point there should be no settings with this type. Yey!
This commit is contained in:
Naz 2021-02-18 11:24:19 +13:00 committed by naz
parent 176433e307
commit ce50653f89

View File

@ -175,6 +175,7 @@ module.exports = {
}
},
key: {type: 'string', maxlength: 50, nullable: false, unique: true},
// NOTE: as JSON objects are no longer stored in `value` we could pottentialy reduce the maxlength
value: {type: 'text', maxlength: 65535, nullable: true},
type: {
type: 'string',
@ -185,9 +186,7 @@ module.exports = {
'array',
'string',
'number',
'boolean',
// TODO: `object` type needs to be removed once all existing object settings are removed
'object'
'boolean'
]]
}
},