From f745fa76215c827679f4fbf6799ba76a52b4c77c Mon Sep 17 00:00:00 2001 From: Fabien 'egg' O'Carroll Date: Thu, 11 Feb 2021 12:45:18 +0000 Subject: [PATCH] Updated members_paid_subscription_events table (#12636) refs https://github.com/TryGhost/Ghost/issues/12602 This allows us to store the stripe_id of the subscription events --- .../4.0/11-add-members-paid-subscription-events-table.js | 4 ++-- core/server/data/schema/schema.js | 4 ++-- test/unit/data/schema/integrity_spec.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/server/data/migrations/versions/4.0/11-add-members-paid-subscription-events-table.js b/core/server/data/migrations/versions/4.0/11-add-members-paid-subscription-events-table.js index 9bd654351f..448e6bc20e 100644 --- a/core/server/data/migrations/versions/4.0/11-add-members-paid-subscription-events-table.js +++ b/core/server/data/migrations/versions/4.0/11-add-members-paid-subscription-events-table.js @@ -3,8 +3,8 @@ const {addTable} = require('../../utils'); module.exports = addTable('members_paid_subscription_events', { id: {type: 'string', maxlength: 24, nullable: false, primary: true}, member_id: {type: 'string', maxlength: 24, nullable: false, references: 'members.id', cascadeDelete: true}, - from_plan: {type: 'string', maxlength: 50, nullable: true}, - to_plan: {type: 'string', maxlength: 50, nullable: true}, + from_plan: {type: 'string', maxlength: 255, nullable: true}, + to_plan: {type: 'string', maxlength: 255, nullable: true}, currency: {type: 'string', maxLength: 3, nullable: false}, source: {type: 'string', maxlength: 50, nullable: false}, mrr_delta: {type: 'integer', nullable: false}, diff --git a/core/server/data/schema/schema.js b/core/server/data/schema/schema.js index 42a4342b55..ba94400f24 100644 --- a/core/server/data/schema/schema.js +++ b/core/server/data/schema/schema.js @@ -387,8 +387,8 @@ module.exports = { members_paid_subscription_events: { id: {type: 'string', maxlength: 24, nullable: false, primary: true}, member_id: {type: 'string', maxlength: 24, nullable: false, references: 'members.id', cascadeDelete: true}, - from_plan: {type: 'string', maxlength: 50, nullable: true}, - to_plan: {type: 'string', maxlength: 50, nullable: true}, + from_plan: {type: 'string', maxlength: 255, nullable: true}, + to_plan: {type: 'string', maxlength: 255, nullable: true}, currency: {type: 'string', maxLength: 3, nullable: false}, source: { type: 'string', maxlength: 50, nullable: false, validations: { diff --git a/test/unit/data/schema/integrity_spec.js b/test/unit/data/schema/integrity_spec.js index dedae93d06..a69c36e06a 100644 --- a/test/unit/data/schema/integrity_spec.js +++ b/test/unit/data/schema/integrity_spec.js @@ -32,7 +32,7 @@ const defaultSettings = require('../../../../core/server/data/schema/default-set */ describe('DB version integrity', function () { // Only these variables should need updating - const currentSchemaHash = '091a6cf44f3eb51115f0e1e422db4db6'; + const currentSchemaHash = '801faa4e969102a3840191b19e339e55'; const currentFixturesHash = '370d0da0ab7c45050b2ff30bce8896ba'; const currentSettingsHash = '162f9294cc427eb32bc0577006c385ce'; const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';