diff --git a/packages/strapi-hook-bookshelf/lib/utils/connectivity.js b/packages/strapi-hook-bookshelf/lib/utils/connectivity.js index c6ecda3b39..32734c2bb5 100644 --- a/packages/strapi-hook-bookshelf/lib/utils/connectivity.js +++ b/packages/strapi-hook-bookshelf/lib/utils/connectivity.js @@ -27,7 +27,7 @@ module.exports = (scope, success, error) => { }; if (tables.rows && tables.rows.length !== 0) { - if (scope.database.options.force) { + if (scope.dbforce) { next(); } else { console.log('🤔 It seems that your database is not empty. Be aware that Strapi is going to automatically creates tables & columns, and might update columns which can corrupt data or cause data loss.'); diff --git a/packages/strapi/bin/strapi-new.js b/packages/strapi/bin/strapi-new.js index ecdd9d167a..38b9e2fad9 100644 --- a/packages/strapi/bin/strapi-new.js +++ b/packages/strapi/bin/strapi-new.js @@ -54,7 +54,7 @@ module.exports = function (name, cliArguments) { return process.exit(1); } - const dbforce = cliArguments.dbforce !== undefined; + scope.dbforce = cliArguments.dbforce !== undefined; scope.database = { settings: { @@ -67,8 +67,7 @@ module.exports = function (name, cliArguments) { }, options: { authenticationDatabase: cliArguments.dbauth, - ssl: cliArguments.dbssl, - force: dbforce + ssl: cliArguments.dbssl } }; }