From 7583d379be7ff86ee18a0559e330cdfb45a894db Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Wed, 27 Apr 2022 20:01:32 +0100 Subject: [PATCH] Revert "Dropped nullable from subscribe events' newsletter id (#14598)" This reverts commit dc12e6490aaf7fb9725e1a1652361a925651887c. --- ...-04-27-08-16-drop-nullable-subscribe-event-newsletter-id.js | 3 --- core/server/data/schema/schema.js | 2 +- test/unit/server/data/schema/integrity.test.js | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 core/server/data/migrations/versions/4.46/2022-04-27-08-16-drop-nullable-subscribe-event-newsletter-id.js diff --git a/core/server/data/migrations/versions/4.46/2022-04-27-08-16-drop-nullable-subscribe-event-newsletter-id.js b/core/server/data/migrations/versions/4.46/2022-04-27-08-16-drop-nullable-subscribe-event-newsletter-id.js deleted file mode 100644 index 38b3fd215c..0000000000 --- a/core/server/data/migrations/versions/4.46/2022-04-27-08-16-drop-nullable-subscribe-event-newsletter-id.js +++ /dev/null @@ -1,3 +0,0 @@ -const {createDropNullableMigration} = require('../../utils'); - -module.exports = createDropNullableMigration('members_subscribe_events', 'newsletter_id'); diff --git a/core/server/data/schema/schema.js b/core/server/data/schema/schema.js index 9bf7928892..927c7447ad 100644 --- a/core/server/data/schema/schema.js +++ b/core/server/data/schema/schema.js @@ -601,7 +601,7 @@ module.exports = { subscribed: {type: 'bool', nullable: false, defaultTo: true}, created_at: {type: 'dateTime', nullable: false}, source: {type: 'string', maxlength: 50, nullable: true}, - newsletter_id: {type: 'string', maxlength: 24, nullable: false, references: 'newsletters.id', cascadeDelete: false} + newsletter_id: {type: 'string', maxlength: 24, nullable: true, references: 'newsletters.id', cascadeDelete: false} }, stripe_products: { id: {type: 'string', maxlength: 24, nullable: false, primary: true}, diff --git a/test/unit/server/data/schema/integrity.test.js b/test/unit/server/data/schema/integrity.test.js index 729960412b..dd85085af8 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 = '2524eac55c153eca7ee300e094fbd3fe'; + const currentSchemaHash = 'cad4a9890ab928de593e4c682a2cd326'; const currentFixturesHash = '4924616fbc51dd0ccef62ae04b4708f9'; const currentSettingsHash = 'ffd899a82b0ad2886e92d8244bcbca6a'; const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';