@Test public void shouldGenerateSqlStringContainingSpecifiedChangelogTableNameOnDelete() { DatabaseSchemaVersionManager schemaVersionManagerWithDifferentTableName = new DatabaseSchemaVersionManager(queryExecuter, "user_specified_changelog"); String updateSql = schemaVersionManagerWithDifferentTableName.getChangelogDeleteSql(script); assertThat(updateSql, Matchers.startsWith("DELETE FROM user_specified_changelog ")); }
public String getChangelogDeleteSql(ChangeScript script) { return String.format( "DELETE FROM " + changeLogTableName + " WHERE change_number = %d", script.getId()); }
DatabaseSchemaVersionManager implements AppliedChangesProvider { public String getChangelogDeleteSql(ChangeScript script) { return String.format( "DELETE FROM " + changeLogTableName + " WHERE change_number = %d", script.getId()); } }
DatabaseSchemaVersionManager implements AppliedChangesProvider { public String getChangelogDeleteSql(ChangeScript script) { return String.format( "DELETE FROM " + changeLogTableName + " WHERE change_number = %d", script.getId()); } DatabaseSchemaVersionManager(QueryExecuter queryExecuter, String changeLogTableName); }
DatabaseSchemaVersionManager implements AppliedChangesProvider { public String getChangelogDeleteSql(ChangeScript script) { return String.format( "DELETE FROM " + changeLogTableName + " WHERE change_number = %d", script.getId()); } DatabaseSchemaVersionManager(QueryExecuter queryExecuter, String changeLogTableName); List<Long> getAppliedChanges(); String getChangelogDeleteSql(ChangeScript script); void recordScriptApplied(ChangeScript script); void setTimeProvider(CurrentTimeProvider timeProvider); }
DatabaseSchemaVersionManager implements AppliedChangesProvider { public String getChangelogDeleteSql(ChangeScript script) { return String.format( "DELETE FROM " + changeLogTableName + " WHERE change_number = %d", script.getId()); } DatabaseSchemaVersionManager(QueryExecuter queryExecuter, String changeLogTableName); List<Long> getAppliedChanges(); String getChangelogDeleteSql(ChangeScript script); void recordScriptApplied(ChangeScript script); void setTimeProvider(CurrentTimeProvider timeProvider);  }