From 2e2d18508791bcfb06ecadffae66174dc903b97a Mon Sep 17 00:00:00 2001 From: Naz Date: Thu, 4 Mar 2021 13:09:31 +1300 Subject: [PATCH] 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 --- core/server/data/schema/schema.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/server/data/schema/schema.js b/core/server/data/schema/schema.js index 0745d881bc..d146fcbf42 100644 --- a/core/server/data/schema/schema.js +++ b/core/server/data/schema/schema.js @@ -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'},