0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Added expiry column for complimentary subscriptions (#15241)

refs https://github.com/TryGhost/Team/issues/1727

- allows adding expiry date to complimentary subscriptions, effectively allowing cardless trials.
- expiry is stored in members<>products mapping table
This commit is contained in:
Rishabh Garg 2022-08-19 08:41:40 +05:30 committed by GitHub
parent 27f1795a5d
commit 43b8ad5069
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View file

@ -0,0 +1,6 @@
const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('members_products', 'expiry_at', {
type: 'dateTime',
nullable: true
});

View file

@ -466,7 +466,8 @@ module.exports = {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
member_id: {type: 'string', maxlength: 24, nullable: false, references: 'members.id', cascadeDelete: true},
product_id: {type: 'string', maxlength: 24, nullable: false, references: 'products.id', cascadeDelete: true},
sort_order: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0}
sort_order: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0},
expiry_at: {type: 'dateTime', nullable: true}
},
posts_products: {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},

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 = '36796d1729450e8d2184bb5360067919';
const currentSchemaHash = '75ee5448311cbfb4c65e3843b6750d29';
const currentFixturesHash = '0ae1887dd0b42508be946bdbd20d41c8';
const currentSettingsHash = 'd54210758b7054e2174fd34aa2320ad7';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';