diff --git a/core/server/data/migrations/versions/4.44/2022-04-15-07-53-add-offer-id-to-subscriptions.js b/core/server/data/migrations/versions/4.44/2022-04-15-07-53-add-offer-id-to-subscriptions.js new file mode 100644 index 0000000000..8204b6e35d --- /dev/null +++ b/core/server/data/migrations/versions/4.44/2022-04-15-07-53-add-offer-id-to-subscriptions.js @@ -0,0 +1,9 @@ +const {createAddColumnMigration} = require('../../utils'); + +module.exports = createAddColumnMigration('members_stripe_customers_subscriptions', 'offer_id', { + type: 'string', + maxlength: 24, + nullable: true, + unique: false, + references: 'offers.id' +}); diff --git a/core/server/data/schema/schema.js b/core/server/data/schema/schema.js index de382810c3..2b24f3a46e 100644 --- a/core/server/data/schema/schema.js +++ b/core/server/data/schema/schema.js @@ -576,6 +576,7 @@ module.exports = { updated_at: {type: 'dateTime', nullable: true}, updated_by: {type: 'string', maxlength: 24, nullable: true}, mrr: {type: 'integer', unsigned: true, nullable: false, defaultTo: 0}, + offer_id: {type: 'string', maxlength: 24, nullable: true, unique: false, references: 'offers.id'}, /* Below fields are now redundant as we link prie_id to stripe_prices table */ plan_id: {type: 'string', maxlength: 255, nullable: false, unique: false}, plan_nickname: {type: 'string', maxlength: 50, nullable: false}, diff --git a/test/unit/server/data/schema/integrity.test.js b/test/unit/server/data/schema/integrity.test.js index d97166b5d6..5a44ec57f0 100644 --- a/test/unit/server/data/schema/integrity.test.js +++ b/test/unit/server/data/schema/integrity.test.js @@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route */ describe('DB version integrity', function () { // Only these variables should need updating - const currentSchemaHash = '026d0bffc2be9420c1d9fccf76656dac'; + const currentSchemaHash = 'ae71340a8c89f6580b2eb06101f003b4'; const currentFixturesHash = '2fb171312dfdd1dc3a569dfb845ac6f5'; const currentSettingsHash = '71fa38d0c805c18ceebe0fda80886230'; const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';