Skip to content

Commit

Permalink
0006393: Fixed default values of 'true' or null getting converted to …
Browse files Browse the repository at this point in the history
…0 for SQL Server bit columns
  • Loading branch information
evan-miller-jumpmind committed May 6, 2024
1 parent c2f1d0a commit af294aa
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,14 @@ protected String getNativeDefaultValue(Column column) {
|| (PlatformUtils.supportsJava14JdbcTypes() && (column
.getMappedTypeCode() == PlatformUtils
.determineBooleanTypeCode()))) {
return getDefaultValueHelper().convert(column.getDefaultValue(),
column.getMappedTypeCode(), Types.SMALLINT);
String defaultValue = column.getDefaultValue();
if ("NULL".equalsIgnoreCase(defaultValue)) {
return defaultValue;
}
if ("'True'".equalsIgnoreCase(defaultValue)) {
return "1";
}
return getDefaultValueHelper().convert(defaultValue, column.getMappedTypeCode(), Types.SMALLINT);
}
if ((column.getMappedTypeCode() == Types.TIMESTAMP) || (column.getMappedTypeCode() == Types.TIME) || (column.getMappedTypeCode() == Types.DATE)) {
String defaultValue = super.getNativeDefaultValue(column);
Expand Down

0 comments on commit af294aa

Please sign in to comment.