Dropped nullable status on subscriptions.tier_id

fixes https://github.com/TryGhost/Team/issues/2102

- this column was added with `nullable: true` but it should never be
  nullable, so we should drop the nullable status whilst it's easy to
This commit is contained in:
Daniel Lockyer 2022-10-18 12:46:18 +07:00 committed by Daniel Lockyer
parent 2d324ea315
commit 3858f255b9
3 changed files with 5 additions and 2 deletions

View File

@ -0,0 +1,3 @@
const {createDropNullableMigration} = require('../../utils');
module.exports = createDropNullableMigration('subscriptions', 'tier_id');

View File

@ -630,7 +630,7 @@ module.exports = {
}
},
member_id: {type: 'string', maxlength: 24, nullable: false, unique: false, references: 'members.id', cascadeDelete: true},
tier_id: {type: 'string', maxlength: 24, nullable: true, unique: false, references: 'products.id'},
tier_id: {type: 'string', maxlength: 24, nullable: false, unique: false, references: 'products.id'},
// These are null if type !== 'paid'
cadence: {

View File

@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
*/
describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = '6ef3c7b8634a7c2708ddf22a0e651b8c';
const currentSchemaHash = '76cfd2230c02c428e9505f6b9a3936ec';
const currentFixturesHash = '05e2151eeba95aac474f0a7a7e63297f';
const currentSettingsHash = '2978a5684a2d5fcf089f61f5d368a0c0';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';