-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 Preparation for going alpha (#7404)
- Don't let people start Ghost Alpha with non-alpha databases. - Provide a new welcome message for development mode (a little bit of positive reinforcment) - Provide a RED WARNING when in production mode (will still be used for developing, but we can ignore) - Change package.json to 1.0.0-alpha.0, we won't relelase this, will bump to .1 for release
- Loading branch information
Showing
11 changed files
with
110 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var Promise = require('bluebird'), | ||
versioning = require('./versioning'), | ||
migrations = require('../migration'), | ||
errors = require('./../../errors'); | ||
|
||
module.exports = function bootUp() { | ||
return versioning | ||
.getDatabaseVersion() | ||
.then(function successHandler(result) { | ||
if (!/^alpha/.test(result)) { | ||
// This database was not created with Ghost alpha, and is not compatible | ||
throw new errors.DatabaseVersion( | ||
'Your database version is not compatible with Ghost 1.0.0 Alpha (master branch)', | ||
'Want to keep your DB? Use Ghost < 1.0.0 or the "stable" branch. Otherwise please delete your DB and restart Ghost', | ||
'More information on the Ghost 1.0.0 Alpha at https://support.ghost.org/v1-0-alpha' | ||
); | ||
} | ||
}, | ||
// We don't use .catch here, as it would catch the error from the successHandler | ||
function errorHandler(err) { | ||
if (err instanceof errors.DatabaseNotPopulated) { | ||
return migrations.populate(); | ||
} | ||
|
||
return Promise.reject(err); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
var schema = require('./schema'), | ||
checks = require('./checks'), | ||
commands = require('./commands'), | ||
versioning = require('./versioning'), | ||
defaultSettings = require('./default-settings'); | ||
|
||
module.exports.tables = schema; | ||
module.exports.checks = checks; | ||
module.exports.commands = commands; | ||
module.exports.versioning = versioning; | ||
module.exports.defaultSettings = defaultSettings; | ||
module.exports.tables = require('./schema'); | ||
module.exports.checks = require('./checks'); | ||
module.exports.commands = require('./commands'); | ||
module.exports.versioning = require('./versioning'); | ||
module.exports.defaultSettings = require('./default-settings'); | ||
module.exports.bootUp = require('./bootup'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters