Skip to content

Commit

Permalink
Backup database before deletion
Browse files Browse the repository at this point in the history
No issue

- a json object is now created when a user deletes content in labs
  • Loading branch information
cobbspur committed Feb 14, 2016
1 parent d593425 commit 8025325
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions core/server/api/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var _ = require('lodash'),
Promise = require('bluebird'),
dataExport = require('../data/export'),
importer = require('../data/importer'),
backupDatabase = require('../data/migration').backupDatabase,
models = require('../models'),
errors = require('../errors'),
utils = require('./utils'),
Expand Down Expand Up @@ -122,6 +123,7 @@ db = {

tasks = [
utils.handlePermissions(docName, 'deleteAllContent'),
backupDatabase,
deleteContent
];

Expand Down
5 changes: 3 additions & 2 deletions core/server/data/migration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ var _ = require('lodash'),
// private
logInfo,
populateDefaultSettings,
backupDatabase,
fixClientSecret,

// public
init,
reset,
migrateUp,
migrateUpFreshDb;
migrateUpFreshDb,
backupDatabase;

logInfo = function logInfo(message) {
errors.logInfo(i18n.t('notices.data.migration.index.migrations'), message);
Expand Down Expand Up @@ -208,6 +208,7 @@ migrateUp = function (fromVersion, toVersion) {
module.exports = {
init: init,
reset: reset,
backupDatabase: backupDatabase,
migrateUp: migrateUp,
migrateUpFreshDb: migrateUpFreshDb
};

0 comments on commit 8025325

Please sign in to comment.