#713 - DB Migration - When change is from Not Null to Null ... this migration is duplicated in subsequent migration generation

This commit is contained in:
Robin Bygrave
2016-05-18 21:04:36 +12:00
parent a1a48dac2c
commit cb51ea4238
2 changed files with 38 additions and 0 deletions
@@ -268,6 +268,10 @@ public class MColumn {
return val != null && !val.isEmpty();
}
private boolean hasValue(Boolean val) {
return val != null;
}
private AlterColumn getAlterColumn(String tableName, boolean tableWithHistory) {
if (alterColumn == null) {
alterColumn = new AlterColumn();
@@ -396,6 +400,9 @@ public class MColumn {
if (hasValue(alterColumn.getType())) {
type = alterColumn.getType();
}
if (hasValue(alterColumn.isNotnull())) {
notnull = alterColumn.isNotnull();
}
if (hasValue(alterColumn.getDefaultValue())) {
defaultValue = alterColumn.getDefaultValue();
}