From 5a4ed0f0f018715804d075502935f48c84116d57 Mon Sep 17 00:00:00 2001 From: Wexpo Lyu Date: Tue, 24 May 2016 12:50:47 +0800 Subject: [PATCH 1/3] Warn users when they meteor reset with MONGO_URL. --- tools/cli/commands.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/cli/commands.js b/tools/cli/commands.js index 38a41e83b1..572624bcc8 100644 --- a/tools/cli/commands.js +++ b/tools/cli/commands.js @@ -1190,6 +1190,13 @@ main.registerCommand({ Console.command("meteor deploy appname"), Console.options({ indent: 2 })); return 1; } + + if (process.env.MONGO_URL) { + Console.error("meteor reset won't reset the DB provided by MONGO_URL, as it can be dangerous " + + "if you specify MONGO_URL to your production server. If you are sure to do that, " + + "do it yourself by raw mongo queries."); + return 1; + } // XXX detect the case where Meteor is running the app, but // MONGO_URL was set, so we don't see a Mongo process From b80b2b0945faec31d3507eba208246b75e0858a3 Mon Sep 17 00:00:00 2001 From: Wexpo Lyu Date: Tue, 24 May 2016 20:19:01 +0800 Subject: [PATCH 2/3] Update commands.js --- tools/cli/commands.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/cli/commands.js b/tools/cli/commands.js index 572624bcc8..9844edc4b7 100644 --- a/tools/cli/commands.js +++ b/tools/cli/commands.js @@ -1192,10 +1192,8 @@ main.registerCommand({ } if (process.env.MONGO_URL) { - Console.error("meteor reset won't reset the DB provided by MONGO_URL, as it can be dangerous " + - "if you specify MONGO_URL to your production server. If you are sure to do that, " + - "do it yourself by raw mongo queries."); - return 1; + Console.info("meteor reset won't reset the DB provided by MONGO_URL, while other project" + + "things get reset. If you are sure to reset DB, do it yourself by raw mongo queries."); } // XXX detect the case where Meteor is running the app, but From 9e083c232db5ae69557c243c5cb98e905687766c Mon Sep 17 00:00:00 2001 From: Wexpo Lyu Date: Wed, 25 May 2016 12:48:02 +0800 Subject: [PATCH 3/3] Refined the tip. --- tools/cli/commands.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/cli/commands.js b/tools/cli/commands.js index 9844edc4b7..21c35148c8 100644 --- a/tools/cli/commands.js +++ b/tools/cli/commands.js @@ -1192,8 +1192,9 @@ main.registerCommand({ } if (process.env.MONGO_URL) { - Console.info("meteor reset won't reset the DB provided by MONGO_URL, while other project" + - "things get reset. If you are sure to reset DB, do it yourself by raw mongo queries."); + Console.info("As a precaution, meteor reset only clears the local database that is " + + "provided by meteor run for development. The database specified with " + + "MONGO_URL will NOT be reset."); } // XXX detect the case where Meteor is running the app, but