Report a better error message if a bogus rename is attempted. Some formatting
cleanup.
This commit is contained in:
@@ -101,9 +101,15 @@ public abstract class EntityMigration extends Modifier
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override protected void init (String tableName, Map<String,FieldMarshaller<?>> marshallers) {
|
||||
@Override
|
||||
protected void init (String tableName, Map<String, FieldMarshaller<?>> marshallers) {
|
||||
super.init(tableName, marshallers);
|
||||
_newColumnDef = marshallers.get(_newColumnName).getColumnDefinition();
|
||||
FieldMarshaller<?> fm = marshallers.get(_newColumnName);
|
||||
if (fm == null) {
|
||||
throw new IllegalArgumentException(
|
||||
_tableName + " does not contain '" + _newColumnName + "' field.");
|
||||
}
|
||||
_newColumnDef = fm.getColumnDefinition();
|
||||
}
|
||||
|
||||
protected String _oldColumnName, _newColumnName;
|
||||
@@ -133,7 +139,8 @@ public abstract class EntityMigration extends Modifier
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override protected void init (String tableName, Map<String,FieldMarshaller<?>> marshallers) {
|
||||
@Override
|
||||
protected void init (String tableName, Map<String, FieldMarshaller<?>> marshallers) {
|
||||
super.init(tableName, marshallers);
|
||||
_columnName = marshallers.get(_fieldName).getColumnName();
|
||||
_newColumnDef = marshallers.get(_fieldName).getColumnDefinition();
|
||||
@@ -174,7 +181,7 @@ public abstract class EntityMigration extends Modifier
|
||||
* migration has been determined to be runnable so one cannot rely on this method having been
|
||||
* called in {@link #shouldRunMigration}.
|
||||
*/
|
||||
protected void init (String tableName, Map<String,FieldMarshaller<?>> marshallers)
|
||||
protected void init (String tableName, Map<String, FieldMarshaller<?>> marshallers)
|
||||
{
|
||||
_tableName = tableName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user