Added note to webhooks.api_version column

refs https://github.com/TryGhost/Team/issues/513
refs https://github.com/TryGhost/Team/issues/477

- We have skipped work to improve the 'defaultTo' value when working on Ghost 4.0 release, so adding this comment while context loaded
-  defaultTo should not be set to anything as it leads to more maintenance work during major version bump
- having validation might make sense but could lead to similar maintenance work unless it's linked to some global nosion of "supported API versions" used everywhere
This commit is contained in:
Naz 2021-03-04 13:09:31 +13:00
parent e7e5f0ad15
commit 2e2d185087

View File

@ -264,6 +264,8 @@ module.exports = {
target_url: {type: 'string', maxlength: 2000, nullable: false},
name: {type: 'string', maxlength: 191, nullable: true},
secret: {type: 'string', maxlength: 191, nullable: true},
// NOTE: the defaultTo does not make sense to set on DB layer as it leads to unnecessary maintenance every major release
// it might make sense to introduce "isIn" validation checking if it's a valid version e.g: 'v3', 'v4', 'canary'
api_version: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'v2'},
integration_id: {type: 'string', maxlength: 24, nullable: true},
status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'available'},