mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Excluded sessions table from exporter (#9961)
refs #9865 - Made sessions table to be skipped during the export process
This commit is contained in:
parent
c638863cb9
commit
49a729f77f
3 changed files with 6 additions and 6 deletions
|
@ -6,7 +6,7 @@ var _ = require('lodash'),
|
|||
common = require('../../lib/common'),
|
||||
security = require('../../lib/security'),
|
||||
models = require('../../models'),
|
||||
EXCLUDED_TABLES = ['accesstokens', 'refreshtokens', 'clients', 'client_trusted_domains'],
|
||||
EXCLUDED_TABLES = ['accesstokens', 'refreshtokens', 'clients', 'client_trusted_domains', 'sessions'],
|
||||
EXCLUDED_FIELDS_CONDITIONS = {
|
||||
settings: [{
|
||||
operator: 'whereNot',
|
||||
|
|
|
@ -87,7 +87,7 @@ describe('DB API', function () {
|
|||
var jsonResponse = res.body;
|
||||
should.exist(jsonResponse.db);
|
||||
jsonResponse.db.should.have.length(1);
|
||||
Object.keys(jsonResponse.db[0].data).length.should.eql(25);
|
||||
Object.keys(jsonResponse.db[0].data).length.should.eql(24);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
@ -105,7 +105,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(27);
|
||||
Object.keys(jsonResponse.db[0].data).length.should.eql(26);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -49,7 +49,7 @@ describe('Exporter', function () {
|
|||
// Execute
|
||||
exporter.doExport().then(function (exportData) {
|
||||
// No tables, less the number of excluded tables
|
||||
var expectedCallCount = schemaTables.length - 4;
|
||||
var expectedCallCount = schemaTables.length - exporter.EXCLUDED_TABLES.length;
|
||||
|
||||
should.exist(exportData);
|
||||
|
||||
|
@ -94,8 +94,8 @@ describe('Exporter', function () {
|
|||
|
||||
// Execute
|
||||
exporter.doExport({include: ['clients', 'client_trusted_domains']}).then(function (exportData) {
|
||||
// all tables, except of the tokens
|
||||
const expectedCallCount = schemaTables.length - 2;
|
||||
// all tables, except of the tokes and sessions
|
||||
const expectedCallCount = schemaTables.length - (exporter.EXCLUDED_TABLES.length - 2);
|
||||
|
||||
should.exist(exportData);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue