rename BaseTask constructor parameters
This commit is contained in:
parent
4e2806bea5
commit
53cedddcab
|
@ -31,14 +31,8 @@ public class AddColumnTask extends BaseTableColumnTypeTask<AddColumnTask> {
|
|||
|
||||
private static final Logger ourLog = LoggerFactory.getLogger(AddColumnTask.class);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param theRelease
|
||||
* @param theVersion
|
||||
*/
|
||||
public AddColumnTask(String theRelease, String theVersion) {
|
||||
super(theRelease, theVersion);
|
||||
public AddColumnTask(String theProductVersion, String theSchemaVersion) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,8 +39,8 @@ public class AddForeignKeyTask extends BaseTableColumnTask<AddForeignKeyTask> {
|
|||
private String myForeignTableName;
|
||||
private String myForeignColumnName;
|
||||
|
||||
public AddForeignKeyTask(String theRelease, String theVersion) {
|
||||
super(theRelease, theVersion);
|
||||
public AddForeignKeyTask(String theProductVersion, String theSchemaVersion) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
}
|
||||
|
||||
public void setConstraintName(String theConstraintName) {
|
||||
|
|
|
@ -38,8 +38,8 @@ public class AddIdGeneratorTask extends BaseTask<AddIdGeneratorTask> {
|
|||
private static final Logger ourLog = LoggerFactory.getLogger(AddIdGeneratorTask.class);
|
||||
private final String myGeneratorName;
|
||||
|
||||
public AddIdGeneratorTask(String theRelease, String theVersion, String theGeneratorName) {
|
||||
super(theRelease, theVersion);
|
||||
public AddIdGeneratorTask(String theProductVersion, String theSchemaVersion, String theGeneratorName) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
myGeneratorName = theGeneratorName;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,8 +41,8 @@ public class AddIndexTask extends BaseTableTask<AddIndexTask> {
|
|||
private List<String> myColumns;
|
||||
private Boolean myUnique;
|
||||
|
||||
public AddIndexTask(String theRelease, String theVersion) {
|
||||
super(theRelease, theVersion);
|
||||
public AddIndexTask(String theProductVersion, String theSchemaVersion) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
}
|
||||
|
||||
public void setIndexName(String theIndexName) {
|
||||
|
|
|
@ -38,8 +38,8 @@ public class AddTableByColumnTask extends BaseTableTask<AddTableByColumnTask> {
|
|||
private List<AddColumnTask> myAddColumnTasks = new ArrayList<>();
|
||||
private String myPkColumn;
|
||||
|
||||
public AddTableByColumnTask(String theRelease, String theVersion) {
|
||||
super(theRelease, theVersion);
|
||||
public AddTableByColumnTask(String theProductVersion, String theSchemaVersion) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,8 +39,8 @@ public class AddTableRawSqlTask extends BaseTableTask<AddTableRawSqlTask> {
|
|||
private Map<DriverTypeEnum, List<String>> myDriverToSqls = new HashMap<>();
|
||||
private List<String> myDriverNeutralSqls = new ArrayList<>();
|
||||
|
||||
public AddTableRawSqlTask(String theRelease, String theVersion) {
|
||||
super(theRelease, theVersion);
|
||||
public AddTableRawSqlTask(String theProductVersion, String theSchemaVersion) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -31,8 +31,8 @@ public abstract class BaseTableColumnTask<T extends BaseTableTask> extends BaseT
|
|||
|
||||
private String myColumnName;
|
||||
|
||||
public BaseTableColumnTask(String theRelease, String theVersion) {
|
||||
super(theRelease, theVersion);
|
||||
public BaseTableColumnTask(String theProductVersion, String theSchemaVersion) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
@ -45,8 +45,8 @@ public abstract class BaseTableColumnTypeTask<T extends BaseTableTask> extends B
|
|||
* Constructor
|
||||
*/
|
||||
|
||||
public BaseTableColumnTypeTask(String theRelease, String theVersion) {
|
||||
super(theRelease, theVersion);
|
||||
public BaseTableColumnTypeTask(String theProductVersion, String theSchemaVersion) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
setColumnType(ColumnTypeEnum.INT, DriverTypeEnum.H2_EMBEDDED, "integer");
|
||||
setColumnType(ColumnTypeEnum.INT, DriverTypeEnum.DERBY_EMBEDDED, "integer");
|
||||
setColumnType(ColumnTypeEnum.INT, DriverTypeEnum.MARIADB_10_1, "integer");
|
||||
|
|
|
@ -27,8 +27,8 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
|||
public abstract class BaseTableTask<T extends BaseTableTask> extends BaseTask {
|
||||
private String myTableName;
|
||||
|
||||
public BaseTableTask(String theRelease, String theVersion) {
|
||||
super(theRelease, theVersion);
|
||||
public BaseTableTask(String theProductVersion, String theSchemaVersion) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
|
|
|
@ -47,12 +47,12 @@ public abstract class BaseTask<T extends BaseTask> {
|
|||
private boolean myDryRun;
|
||||
private List<ExecutedStatement> myExecutedStatements = new ArrayList<>();
|
||||
private boolean myNoColumnShrink;
|
||||
private final String myRelease;
|
||||
private final String myVersion;
|
||||
private final String myProductVersion;
|
||||
private final String mySchemaVersion;
|
||||
|
||||
protected BaseTask(String theRelease, String theVersion) {
|
||||
myRelease = theRelease;
|
||||
myVersion = theVersion;
|
||||
protected BaseTask(String theProductVersion, String theSchemaVersion) {
|
||||
myProductVersion = theProductVersion;
|
||||
mySchemaVersion = theSchemaVersion;
|
||||
}
|
||||
|
||||
public boolean isNoColumnShrink() {
|
||||
|
@ -146,11 +146,11 @@ public abstract class BaseTask<T extends BaseTask> {
|
|||
|
||||
public String getFlywayVersion() {
|
||||
String retval = "";
|
||||
String releasePart = myRelease;
|
||||
String releasePart = myProductVersion;
|
||||
if (releasePart.startsWith("V")) {
|
||||
releasePart = releasePart.substring(1);
|
||||
}
|
||||
return releasePart + "." + myVersion;
|
||||
return releasePart + "." + mySchemaVersion;
|
||||
}
|
||||
|
||||
protected void logInfo(Logger theLog, String theFormattedMessage, Object... theArguments) {
|
||||
|
@ -158,9 +158,9 @@ public abstract class BaseTask<T extends BaseTask> {
|
|||
}
|
||||
|
||||
public void validateVersion() {
|
||||
Matcher matcher = versionPattern.matcher(myVersion);
|
||||
Matcher matcher = versionPattern.matcher(mySchemaVersion);
|
||||
if (!matcher.matches()) {
|
||||
throw new IllegalStateException("The version " + myVersion + " does not match the expected pattern " + MIGRATION_VERSION_PATTERN);
|
||||
throw new IllegalStateException("The version " + mySchemaVersion + " does not match the expected pattern " + MIGRATION_VERSION_PATTERN);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@ public class DropColumnTask extends BaseTableColumnTask<DropColumnTask> {
|
|||
|
||||
private static final Logger ourLog = LoggerFactory.getLogger(DropColumnTask.class);
|
||||
|
||||
public DropColumnTask(String theRelease, String theVersion) {
|
||||
super(theRelease, theVersion);
|
||||
public DropColumnTask(String theProductVersion, String theSchemaVersion) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -42,8 +42,8 @@ public class DropForeignKeyTask extends BaseTableTask<DropForeignKeyTask> {
|
|||
private String myConstraintName;
|
||||
private String myParentTableName;
|
||||
|
||||
public DropForeignKeyTask(String theRelease, String theVersion) {
|
||||
super(theRelease, theVersion);
|
||||
public DropForeignKeyTask(String theProductVersion, String theSchemaVersion) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
}
|
||||
|
||||
public void setConstraintName(String theConstraintName) {
|
||||
|
|
|
@ -38,8 +38,8 @@ public class DropIdGeneratorTask extends BaseTask<DropIdGeneratorTask> {
|
|||
private static final Logger ourLog = LoggerFactory.getLogger(DropIdGeneratorTask.class);
|
||||
private final String myGeneratorName;
|
||||
|
||||
public DropIdGeneratorTask(String theRelease, String theVersion, String theGeneratorName) {
|
||||
super(theRelease, theVersion);
|
||||
public DropIdGeneratorTask(String theProductVersion, String theSchemaVersion, String theGeneratorName) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
myGeneratorName = theGeneratorName;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,8 +40,8 @@ public class DropIndexTask extends BaseTableTask<DropIndexTask> {
|
|||
private static final Logger ourLog = LoggerFactory.getLogger(DropIndexTask.class);
|
||||
private String myIndexName;
|
||||
|
||||
public DropIndexTask(String theRelease, String theVersion) {
|
||||
super(theRelease, theVersion);
|
||||
public DropIndexTask(String theProductVersion, String theSchemaVersion) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -33,8 +33,8 @@ public class DropTableTask extends BaseTableTask<DropTableTask> {
|
|||
|
||||
private static final Logger ourLog = LoggerFactory.getLogger(DropTableTask.class);
|
||||
|
||||
public DropTableTask(String theRelease, String theVersion) {
|
||||
super(theRelease, theVersion);
|
||||
public DropTableTask(String theProductVersion, String theSchemaVersion) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,8 +39,8 @@ public class ExecuteRawSqlTask extends BaseTask<ExecuteRawSqlTask> {
|
|||
private Map<DriverTypeEnum, List<String>> myDriverToSqls = new HashMap<>();
|
||||
private List<String> myDriverNeutralSqls = new ArrayList<>();
|
||||
|
||||
public ExecuteRawSqlTask(String theRelease, String theVersion) {
|
||||
super(theRelease, theVersion);
|
||||
public ExecuteRawSqlTask(String theProductVersion, String theSchemaVersion) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
setDescription("Execute raw sql");
|
||||
}
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ public class InitializeSchemaTask extends BaseTask<InitializeSchemaTask> {
|
|||
private static final Logger ourLog = LoggerFactory.getLogger(InitializeSchemaTask.class);
|
||||
private final ISchemaInitializationProvider mySchemaInitializationProvider;
|
||||
|
||||
public InitializeSchemaTask(String theRelease, String theVersion, ISchemaInitializationProvider theSchemaInitializationProvider) {
|
||||
super(theRelease, theVersion);
|
||||
public InitializeSchemaTask(String theProductVersion, String theSchemaVersion, ISchemaInitializationProvider theSchemaInitializationProvider) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
mySchemaInitializationProvider = theSchemaInitializationProvider;
|
||||
setDescription("Initialize schema");
|
||||
}
|
||||
|
|
|
@ -32,13 +32,8 @@ public class ModifyColumnTask extends BaseTableColumnTypeTask<ModifyColumnTask>
|
|||
|
||||
private static final Logger ourLog = LoggerFactory.getLogger(ModifyColumnTask.class);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param theVersion
|
||||
*/
|
||||
public ModifyColumnTask(String theRelease, String theVersion) {
|
||||
super(theRelease, theVersion);
|
||||
public ModifyColumnTask(String theProductVersion, String theSchemaVersion) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -40,8 +40,8 @@ public class RenameColumnTask extends BaseTableTask<RenameColumnTask> {
|
|||
private boolean myAllowNeitherColumnToExist;
|
||||
private boolean myDeleteTargetColumnFirstIfBothExist;
|
||||
|
||||
public RenameColumnTask(String theRelease, String theVersion) {
|
||||
super(theRelease, theVersion);
|
||||
public RenameColumnTask(String theProductVersion, String theSchemaVersion) {
|
||||
super(theProductVersion, theSchemaVersion);
|
||||
}
|
||||
|
||||
public void setDeleteTargetColumnFirstIfBothExist(boolean theDeleteTargetColumnFirstIfBothExist) {
|
||||
|
|
Loading…
Reference in New Issue