Added members_subscribe_events table

refs https://github.com/TryGhost/Ghost/issues/12602
This commit is contained in:
Fabien O'Carroll 2021-02-03 16:15:04 +00:00 committed by Fabien 'egg' O'Carroll
parent 873d21d975
commit e39644bd2d
4 changed files with 18 additions and 2 deletions

View File

@ -0,0 +1,9 @@
const {addTable} = require('../../utils');
module.exports = addTable('members_subscribe_events', {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
member_id: {type: 'string', maxlength: 24, nullable: false, unique: false, references: 'members.id', cascadeDelete: true},
subscribed: {type: 'bool', nullable: false, defaultTo: true},
created_at: {type: 'dateTime', nullable: false},
source: {type: 'string', maxlength: 50, nullable: true}
});

View File

@ -397,6 +397,13 @@ module.exports = {
plan_amount: {type: 'integer', nullable: false},
plan_currency: {type: 'string', maxLength: 3, nullable: false}
},
members_subscribe_events: {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
member_id: {type: 'string', maxlength: 24, nullable: false, unique: false, references: 'members.id', cascadeDelete: true},
subscribed: {type: 'bool', nullable: false, defaultTo: true},
created_at: {type: 'dateTime', nullable: false},
source: {type: 'string', maxlength: 50, nullable: true}
},
actions: {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
resource_id: {type: 'string', maxlength: 24, nullable: true},

View File

@ -47,7 +47,7 @@ describe('DB API', function () {
const jsonResponse = res.body;
should.exist(jsonResponse.db);
jsonResponse.db.should.have.length(1);
Object.keys(jsonResponse.db[0].data).length.should.eql(28);
Object.keys(jsonResponse.db[0].data).length.should.eql(29);
});
it('Can import a JSON database', async function () {

View File

@ -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 = '0970e14fcf8d91daaf636da382e3da29';
const currentSchemaHash = '41fb7edf55c023f7b21fc5f3b7899d0f';
const currentFixturesHash = '370d0da0ab7c45050b2ff30bce8896ba';
const currentSettingsHash = '162f9294cc427eb32bc0577006c385ce';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';