mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Updated backup file names to include timestamp (#10607)
no-issue Currently if you run two migrations on the same day, the backup is overwritten. This change adds the `HH-mm-ss` to the file name, meaning that you get a unique backup for each migration.
This commit is contained in:
parent
1d64090f5e
commit
56b6c633f6
2 changed files with 4 additions and 4 deletions
|
@ -25,7 +25,7 @@ var _ = require('lodash'),
|
|||
exportFileName;
|
||||
|
||||
exportFileName = function exportFileName(options) {
|
||||
var datetime = (new Date()).toJSON().substring(0, 10),
|
||||
var datetime = require('moment')().format('YYYY-MM-DD-HH-mm-ss'),
|
||||
title = '';
|
||||
|
||||
options = options || {};
|
||||
|
|
|
@ -160,7 +160,7 @@ describe('Exporter', function () {
|
|||
exporter.fileName().then(function (result) {
|
||||
should.exist(result);
|
||||
settingsStub.calledOnce.should.be.true();
|
||||
result.should.match(/^testblog\.ghost\.[0-9]{4}-[0-9]{2}-[0-9]{2}\.json$/);
|
||||
result.should.match(/^testblog\.ghost\.[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.json$/);
|
||||
|
||||
done();
|
||||
}).catch(done);
|
||||
|
@ -174,7 +174,7 @@ describe('Exporter', function () {
|
|||
exporter.fileName().then(function (result) {
|
||||
should.exist(result);
|
||||
settingsStub.calledOnce.should.be.true();
|
||||
result.should.match(/^ghost\.[0-9]{4}-[0-9]{2}-[0-9]{2}\.json$/);
|
||||
result.should.match(/^ghost\.[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.json$/);
|
||||
|
||||
done();
|
||||
}).catch(done);
|
||||
|
@ -188,7 +188,7 @@ describe('Exporter', function () {
|
|||
exporter.fileName().then(function (result) {
|
||||
should.exist(result);
|
||||
settingsStub.calledOnce.should.be.true();
|
||||
result.should.match(/^ghost\.[0-9]{4}-[0-9]{2}-[0-9]{2}\.json$/);
|
||||
result.should.match(/^ghost\.[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}\.json$/);
|
||||
|
||||
done();
|
||||
}).catch(done);
|
||||
|
|
Loading…
Reference in a new issue