Excluded member events tables from site exports

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

We expect the member event tables to be large, and they contain what is
considered metadata. For this reason we do not want to include them in
the export of sites.
This commit is contained in:
Fabien O'Carroll 2021-03-05 11:38:45 +00:00
parent 6594741c11
commit f03e1dd863
2 changed files with 13 additions and 2 deletions

View File

@ -8,7 +8,18 @@ const logging = require('../../../shared/logging');
const errors = require('@tryghost/errors'); const errors = require('@tryghost/errors');
const security = require('@tryghost/security'); const security = require('@tryghost/security');
const models = require('../../models'); const models = require('../../models');
const EXCLUDED_TABLES = ['sessions', 'mobiledoc_revisions', 'email_batches', 'email_recipients']; const EXCLUDED_TABLES = [
'sessions',
'mobiledoc_revisions',
'email_batches',
'email_recipients',
'members_payment_events',
'members_login_events',
'members_email_change_events',
'members_status_events',
'members_paid_subscription_events',
'members_subscribe_events'
];
const EXCLUDED_SETTING_KEYS = [ const EXCLUDED_SETTING_KEYS = [
'stripe_connect_publishable_key', 'stripe_connect_publishable_key',
'stripe_connect_secret_key', 'stripe_connect_secret_key',

View File

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