Skip to content
Browse files

changed isLocalDatabase() and isSafeToRunMigration() methods to a mor…

…e standard isSafeToRunUpdate
  • Loading branch information...
1 parent 7d22f97 commit 8a8aa1f762f3586b7317931ecfae3ea9fef9395d @nvoxland nvoxland committed Aug 29, 2012
View
6 liquibase-core/src/main/java/liquibase/Liquibase.java
@@ -589,8 +589,8 @@ public void checkDatabaseChangeLogTable(boolean updateExistingNullChecksums, Dat
* It is fine to run Liquibase against a "non-safe" database, the method is mainly used to determine if the user
* should be prompted before continuing.
*/
- public boolean isSafeToRunMigration() throws DatabaseException {
- return getDatabase().isLocalDatabase();
+ public boolean isSafeToRunUpdate() throws DatabaseException {
+ return getDatabase().isSafeToRunUpdate();
}
/**
@@ -802,7 +802,7 @@ private void setDatabasePropertiesAsChangelogParameters(Database database) throw
setChangeLogParameter("database.lineComment", database.getLineComment());
setChangeLogParameter("database.liquibaseSchemaName", database.getLiquibaseSchemaName());
setChangeLogParameter("database.typeName", database.getShortName());
- setChangeLogParameter("database.isLocalDatabase", database.isLocalDatabase());
+ setChangeLogParameter("database.isSafeToRunUpdate", database.isSafeToRunUpdate());
setChangeLogParameter("database.requiresPassword", database.requiresPassword());
setChangeLogParameter("database.requiresUsername", database.requiresUsername());
setChangeLogParameter("database.supportsForeignKeyDisable", database.supportsForeignKeyDisable());
View
2 liquibase-core/src/main/java/liquibase/database/AbstractDatabase.java
@@ -1232,7 +1232,7 @@ public void setAutoCommit(boolean b) throws DatabaseException {
* @throws liquibase.exception.DatabaseException
*
*/
- public boolean isLocalDatabase() throws DatabaseException {
+ public boolean isSafeToRunUpdate() throws DatabaseException {
DatabaseConnection connection = getConnection();
if (connection == null) {
return true;
View
2 liquibase-core/src/main/java/liquibase/database/Database.java
@@ -232,7 +232,7 @@
void setAutoCommit(boolean b) throws DatabaseException;
- boolean isLocalDatabase() throws DatabaseException;
+ boolean isSafeToRunUpdate() throws DatabaseException;
void executeStatements(Change change, DatabaseChangeLog changeLog, List<SqlVisitor> sqlVisitors) throws LiquibaseException, UnsupportedChangeException;/*
* Executes the statements passed as argument to a target {@link Database}
View
4 liquibase-core/src/main/java/liquibase/database/core/H2Database.java
@@ -121,10 +121,10 @@ public Date parseDate(String dateAsString) throws DateParseException {
}
@Override
- public boolean isLocalDatabase() throws DatabaseException {
+ public boolean isSafeToRunUpdate() throws DatabaseException {
String url = getConnection().getURL();
boolean isLocalURL = (
- super.isLocalDatabase()
+ super.isSafeToRunUpdate()
|| url.startsWith("jdbc:h2:file:")
|| url.startsWith("jdbc:h2:mem:")
|| url.startsWith("jdbc:h2:zip:")
View
2 liquibase-core/src/main/java/liquibase/integration/ant/DatabaseUpdateTask.java
@@ -33,7 +33,7 @@ public void execute() throws BuildException {
liquibase = createLiquibase();
if (isPromptOnNonLocalDatabase()
- && !liquibase.isSafeToRunMigration()
+ && !liquibase.isSafeToRunUpdate()
&& UIFactory.getInstance().getFacade().promptForNonLocalDatabase(liquibase.getDatabase())) {
throw new BuildException("Chose not to run against non-production database");
}
View
2 ...ibase-core/src/main/java/liquibase/integration/ant/DatabaseUpdateTestingRollbackTask.java
@@ -31,7 +31,7 @@ public void execute() throws BuildException {
liquibase = createLiquibase();
if (isPromptOnNonLocalDatabase()
- && !liquibase.isSafeToRunMigration()
+ && !liquibase.isSafeToRunUpdate()
&& UIFactory.getInstance().getFacade().promptForNonLocalDatabase(liquibase.getDatabase())) {
throw new BuildException("Chose not to run against non-production database");
}
View
6 liquibase-core/src/test/java/liquibase/LiquibaseTest.java
@@ -58,13 +58,13 @@ public void setUp() throws Exception {
// Database database = testLiquibase.getDatabase();
//
// liquibase.setUrl("jdbc:oracle:thin:@localhost:1521:latest");
-// assertTrue(liquibase.isSafeToRunMigration());
+// assertTrue(liquibase.isSafeToRunUpdate());
//
// liquibase.setUrl("jdbc:oracle:thin:@liquibase:1521:latest");
-// assertFalse(liquibase.isSafeToRunMigration());
+// assertFalse(liquibase.isSafeToRunUpdate());
//
// ExecutorService.getInstance().setWriteExecutor(database, new LoggingExecutor(new PrintWriter(System.out), database));
-// assertTrue("Safe to run if outputing sql, even if non-localhost URL", liquibase.isSafeToRunMigration());
+// assertTrue("Safe to run if outputing sql, even if non-localhost URL", liquibase.isSafeToRunUpdate());
//
// }
View
2 liquibase-core/src/test/java/liquibase/database/core/MockDatabase.java
@@ -430,7 +430,7 @@ public String escapeConstraintName(String constraintName) {
return constraintName;
}
- public boolean isLocalDatabase() throws DatabaseException {
+ public boolean isSafeToRunUpdate() throws DatabaseException {
return true;
}
View
2 liquibase-maven-plugin/src/main/java/org/liquibase/maven/plugins/AbstractLiquibaseMojo.java
@@ -303,7 +303,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
getLog().info("Executing on Database: " + url);
if (isPromptOnNonLocalDatabase()) {
- if (!liquibase.isSafeToRunMigration()) {
+ if (!liquibase.isSafeToRunUpdate()) {
if (UIFactory.getInstance().getFacade().promptForNonLocalDatabase(liquibase.getDatabase())) {
throw new LiquibaseException("User decided not to run against non-local database");
}

0 comments on commit 8a8aa1f

Please sign in to comment.
Something went wrong with that request. Please try again.