Skip to content

Commit

Permalink
0005504: Prevented Oracle DATE type from having its size specified
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-miller-jumpmind committed Oct 3, 2022
1 parent eb4d3dc commit ac680dd
Showing 1 changed file with 9 additions and 4 deletions.
Expand Up @@ -76,6 +76,7 @@ public class OracleDdlBuilder extends AbstractDdlBuilder {
protected static final String PREFIX_TRIGGER = "TRG";
protected static final String PREFIX_SEQUENCE = "SEQ";
protected static final String ROWID_TYPE = "ROWID";
protected static final String DATE_TYPE = "DATE";

public OracleDdlBuilder() {
super(DatabaseNamesConstants.ORACLE);
Expand Down Expand Up @@ -564,10 +565,14 @@ protected void processChange(Database currentModel, Database desiredModel,
@Override
public String getSqlType(Column column) {
PlatformColumn platformColumn = column.findPlatformColumn(databaseName);
if (platformColumn != null && platformColumn.getType() != null
&& platformColumn.getType().equals(ROWID_TYPE)) {
return ROWID_TYPE;
} else if (column.getJdbcTypeCode() == ColumnTypes.ORACLE_TIMESTAMPTZ || column.getMappedTypeCode() == ColumnTypes.ORACLE_TIMESTAMPTZ) {
if (platformColumn != null && platformColumn.getType() != null) {
if (platformColumn.getType().equals(ROWID_TYPE)) {
return ROWID_TYPE;
} else if (platformColumn.getType().equals(DATE_TYPE)) {
return DATE_TYPE;
}
}
if (column.getJdbcTypeCode() == ColumnTypes.ORACLE_TIMESTAMPTZ || column.getMappedTypeCode() == ColumnTypes.ORACLE_TIMESTAMPTZ) {
return "TIMESTAMP(" + column.getSizeAsInt() + ") WITH TIME ZONE";
} else if (column.getJdbcTypeCode() == ColumnTypes.ORACLE_TIMESTAMPLTZ || column.getMappedTypeCode() == ColumnTypes.ORACLE_TIMESTAMPLTZ) {
return "TIMESTAMP(" + column.getSizeAsInt() + ") WITH LOCAL TIME ZONE";
Expand Down

0 comments on commit ac680dd

Please sign in to comment.