mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
Merge pull request #6501 from cobbspur/backup
Backup database before deletion
This commit is contained in:
commit
7c47249ac7
2 changed files with 5 additions and 2 deletions
|
@ -4,6 +4,7 @@ var _ = require('lodash'),
|
||||||
Promise = require('bluebird'),
|
Promise = require('bluebird'),
|
||||||
dataExport = require('../data/export'),
|
dataExport = require('../data/export'),
|
||||||
importer = require('../data/importer'),
|
importer = require('../data/importer'),
|
||||||
|
backupDatabase = require('../data/migration').backupDatabase,
|
||||||
models = require('../models'),
|
models = require('../models'),
|
||||||
errors = require('../errors'),
|
errors = require('../errors'),
|
||||||
utils = require('./utils'),
|
utils = require('./utils'),
|
||||||
|
@ -122,6 +123,7 @@ db = {
|
||||||
|
|
||||||
tasks = [
|
tasks = [
|
||||||
utils.handlePermissions(docName, 'deleteAllContent'),
|
utils.handlePermissions(docName, 'deleteAllContent'),
|
||||||
|
backupDatabase,
|
||||||
deleteContent
|
deleteContent
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -20,14 +20,14 @@ var _ = require('lodash'),
|
||||||
// private
|
// private
|
||||||
logInfo,
|
logInfo,
|
||||||
populateDefaultSettings,
|
populateDefaultSettings,
|
||||||
backupDatabase,
|
|
||||||
fixClientSecret,
|
fixClientSecret,
|
||||||
|
|
||||||
// public
|
// public
|
||||||
init,
|
init,
|
||||||
reset,
|
reset,
|
||||||
migrateUp,
|
migrateUp,
|
||||||
migrateUpFreshDb;
|
migrateUpFreshDb,
|
||||||
|
backupDatabase;
|
||||||
|
|
||||||
logInfo = function logInfo(message) {
|
logInfo = function logInfo(message) {
|
||||||
errors.logInfo(i18n.t('notices.data.migration.index.migrations'), message);
|
errors.logInfo(i18n.t('notices.data.migration.index.migrations'), message);
|
||||||
|
@ -208,6 +208,7 @@ migrateUp = function (fromVersion, toVersion) {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
init: init,
|
init: init,
|
||||||
reset: reset,
|
reset: reset,
|
||||||
|
backupDatabase: backupDatabase,
|
||||||
migrateUp: migrateUp,
|
migrateUp: migrateUp,
|
||||||
migrateUpFreshDb: migrateUpFreshDb
|
migrateUpFreshDb: migrateUpFreshDb
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue