mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 19:36:20 +00:00
Change wording
This commit is contained in:
parent
b17d1a29b2
commit
df5b9f3dab
@ -9,11 +9,13 @@ const logger = require('strapi-utils').logger;
|
||||
module.exports = (scope, success, error) => {
|
||||
const knex = require(`${scope.rootPath}_/node_modules/knex`)({
|
||||
client: scope.client.module,
|
||||
connection: scope.database
|
||||
connection: Object.assign(scope.database, {
|
||||
user: scope.database.username
|
||||
})
|
||||
});
|
||||
|
||||
knex.raw('select 1+1 as result').then(() => {
|
||||
logger.info('Database connection is a success!');
|
||||
logger.info('The app has been connected to the database successfully');
|
||||
knex.destroy();
|
||||
execSync(`rm -r ${scope.rootPath}_`);
|
||||
|
||||
@ -22,7 +24,7 @@ module.exports = (scope, success, error) => {
|
||||
success();
|
||||
})
|
||||
.catch(() => {
|
||||
logger.warn('Database connection failed!');
|
||||
logger.warn('Database connection has failed! Make sure your database is running.');
|
||||
error();
|
||||
});
|
||||
};
|
||||
|
||||
@ -53,7 +53,7 @@ module.exports = (scope, cb) => {
|
||||
scope.database = {};
|
||||
|
||||
const connectionValidation = () => {
|
||||
const databaseChoises = [
|
||||
const databaseChoices = [
|
||||
{
|
||||
name: 'MongoDB (highly recommended)',
|
||||
value: {
|
||||
@ -100,11 +100,11 @@ module.exports = (scope, cb) => {
|
||||
type: 'list',
|
||||
prefix: '',
|
||||
name: 'client',
|
||||
message: 'Choose your database:',
|
||||
choices: databaseChoises,
|
||||
message: 'Choose your main database:',
|
||||
choices: databaseChoices,
|
||||
default: () => {
|
||||
if (scope.client) {
|
||||
return _.findIndex(databaseChoises, { value: _.omit(scope.client, ['version'])});
|
||||
return _.findIndex(databaseChoices, { value: _.omit(scope.client, ['version'])});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,11 +11,11 @@ module.exports = (scope, success, error) => {
|
||||
|
||||
Mongoose.connect(`mongodb://${ (scope.database.username && scope.database.password) ? `${scope.database.username}:${scope.database.password}@` : '' }${scope.database.host}:${scope.database.port}/${scope.database.database}`, function (err) {
|
||||
if (err) {
|
||||
logger.warn('Database connection failed!');
|
||||
logger.warn('Database connection has failed! Make sure your database is running.');
|
||||
return error();
|
||||
}
|
||||
|
||||
logger.info('Database connection is a success!');
|
||||
logger.info('The app has been connected to the database successfully!');
|
||||
|
||||
Mongoose.connection.close();
|
||||
|
||||
|
||||
@ -19,11 +19,11 @@ module.exports = (scope, success, error) => {
|
||||
redis.disconnect();
|
||||
|
||||
if (err) {
|
||||
logger.warn('Database connection failed!');
|
||||
logger.warn('Database connection has failed! Make sure your database is running.');
|
||||
return error();
|
||||
}
|
||||
|
||||
logger.info('Database connection is a success!');
|
||||
logger.info('The app has been connected to the database successfully!');
|
||||
|
||||
execSync(`rm -r ${scope.rootPath}_`);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user