VIVO-801 Improved the prompts on the RDB migrator
This commit is contained in:
parent
700131cfee
commit
a28bb52e5c
1 changed files with 14 additions and 5 deletions
|
@ -209,12 +209,20 @@ public class RdbMigrator {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void askMigrateAllModels() throws IOException {
|
private void askMigrateAllModels() throws IOException, UserDeclinedException {
|
||||||
try {
|
System.out.println("Migrate all models, or only the required models?\n"
|
||||||
ask("Migrate all models? (y/n)");
|
+ " Enter 'all' or 'only', or anything else to quit.");
|
||||||
} catch (UserDeclinedException e) {
|
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
|
||||||
modelsToCopy = EXPECTED_MODELS;
|
String s = br.readLine();
|
||||||
|
if (s != null) {
|
||||||
|
if (s.trim().toLowerCase().equals("all")) {
|
||||||
|
return;
|
||||||
|
} else if (s.trim().toLowerCase().equals("only")) {
|
||||||
|
modelsToCopy = EXPECTED_MODELS;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
throw new UserDeclinedException("Enter 'all' or 'only'.");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void askApprovalForMigrationPlan() throws SQLException,
|
private void askApprovalForMigrationPlan() throws SQLException,
|
||||||
|
@ -334,6 +342,7 @@ public class RdbMigrator {
|
||||||
// Main routine
|
// Main routine
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
if (args.length != 4) {
|
if (args.length != 4) {
|
||||||
System.out.println("Usage: RdbMigrator vivoHomeDir, jdbcUrl, "
|
System.out.println("Usage: RdbMigrator vivoHomeDir, jdbcUrl, "
|
||||||
|
|
Loading…
Add table
Reference in a new issue