Added the last_seen_at column to members

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

- This migration adds a column to store when a members was last seen
- The utils.js e2e test file was refactored according to the commit 06dd9bac59
This commit is contained in:
Thibaut Patel 2022-02-07 16:04:38 +01:00 committed by Thibaut Patel
parent 21c43f3b10
commit 479df36a48
4 changed files with 30 additions and 7 deletions

View File

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

View File

@ -369,6 +369,7 @@ module.exports = {
email_count: {type: 'integer', unsigned: true, nullable: false, defaultTo: 0},
email_opened_count: {type: 'integer', unsigned: true, nullable: false, defaultTo: 0},
email_open_rate: {type: 'integer', unsigned: true, nullable: true, index: true},
last_seen_at: {type: 'dateTime',nullable: true},
created_at: {type: 'dateTime', nullable: false},
created_by: {type: 'string', maxlength: 24, nullable: false},
updated_at: {type: 'dateTime', nullable: true},

View File

@ -131,12 +131,24 @@ const expectedProperties = {
subscriber: _(schema.subscribers)
.keys()
,
member: _(schema.members)
.keys()
.concat('avatar_image')
.concat('comped')
.concat('labels')
,
member: [
'id',
'uuid',
'email',
'status',
'name',
'note',
'geolocation',
'subscribed',
'email_count',
'email_opened_count',
'email_open_rate',
'created_at',
'updated_at',
'avatar_image',
'comped',
'labels'
],
member_signin_url: ['member_id', 'url'],
role: _(schema.roles)
.keys()

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 = '9e4eeb5c260047fe21d1f93c523bd771';
const currentSchemaHash = 'c8442427463a0bf25ecca871b01016dc';
const currentFixturesHash = 'beb040c0376a492c2a44767fdd825a3e';
const currentSettingsHash = '437d4c6da8759f5c35f11f811b86e5bc';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';