Wrong alter table / alter column DDL was generated (#988)

* FIX: alter column type uses correct DB-type now.

* FIX: Oracle test case
This commit is contained in:
Roland Praml
2017-04-01 00:38:23 +13:00
committed by Rob Bygrave
parent b821702b8d
commit 0557e6cd08
4 changed files with 4 additions and 2 deletions
@@ -71,6 +71,7 @@ public class MySqlDdl extends PlatformDdl {
String tableName = alter.getTableName();
String columnName = alter.getColumnName();
String type = alter.getType() != null ? alter.getType() : alter.getCurrentType();
type = convert(type, false);
boolean notnull = (alter.isNotnull() != null) ? alter.isNotnull() : Boolean.TRUE.equals(alter.isCurrentNotnull());
String notnullClause = notnull ? " not null" : "";
@@ -376,7 +376,7 @@ public class PlatformDdl {
*/
public String alterColumnType(String tableName, String columnName, String type) {
return "alter table " + tableName + " " + alterColumn + " " + columnName + " " + columnSetType + type;
return "alter table " + tableName + " " + alterColumn + " " + columnName + " " + columnSetType + convert(type, false);
}
/**
@@ -70,6 +70,7 @@ public class SqlServerDdl extends PlatformDdl {
String tableName = alter.getTableName();
String columnName = alter.getColumnName();
String type = alter.getType() != null ? alter.getType() : alter.getCurrentType();
type = convert(type, false);
boolean notnull = (alter.isNotnull() != null) ? alter.isNotnull() : Boolean.TRUE.equals(alter.isCurrentNotnull());
String notnullClause = notnull ? " not null" : "";