Skip to content
Permalink
Browse files

0003850: On startup with Postgres 10, always alters sym_sequence

  • Loading branch information...
erilong committed Jan 8, 2019
1 parent 8f69432 commit 5435f62d41789ff1fea9f49ce7c995c6d5041654
Showing with 11 additions and 7 deletions.
  1. +11 −7 symmetric-db/src/main/java/org/jumpmind/db/model/Column.java
@@ -478,23 +478,23 @@ public Object getParsedDefaultValue() {
switch (mappedTypeCode) {
case Types.TINYINT:
case Types.SMALLINT:
return new Short(defaultValue);
return new Short(getCleanDefaultValue());
case Types.INTEGER:
try {
return new Integer(defaultValue);
return new Integer(getCleanDefaultValue());
} catch (NumberFormatException e) {
return new Long(defaultValue);
return new Long(getCleanDefaultValue());
}
case Types.BIGINT:
return new Long(defaultValue);
return new Long(getCleanDefaultValue());
case Types.DECIMAL:
case Types.NUMERIC:
return new BigDecimal(defaultValue);
return new BigDecimal(getCleanDefaultValue());
case Types.REAL:
return new Float(defaultValue);
return new Float(getCleanDefaultValue());
case Types.DOUBLE:
case Types.FLOAT:
return new Double(defaultValue);
return new Double(getCleanDefaultValue());
case Types.DATE:
return Date.valueOf(defaultValue);
case Types.TIME:
@@ -518,6 +518,10 @@ public Object getParsedDefaultValue() {
}
return defaultValue;
}

private String getCleanDefaultValue() {
return defaultValue.replace("'", "");
}

public void removePlatformColumn(String databaseName) {
if (platformColumns != null) {

0 comments on commit 5435f62

Please sign in to comment.
You can’t perform that action at this time.