#2039 Map LocalDateTime when generating DB migrations for Postgres to timestamp DB type

This commit is contained in:
Rob Bygrave committed 2021-09-22 16:23:10 +12:00
1 parent e85a471fcf
commit a14f7a1766
13 files changed
+135 -35

No files matched your search

@@ -303,6 +303,7 @@ public final class Binder {
break;
case java.sql.Types.TIMESTAMP:
case DbPlatformType.LOCALDATETIME:
b.setTimestamp((java.sql.Timestamp) data);
break;
@@ -73,6 +73,7 @@ abstract class AbstractMultiValueBind extends MultiValueBind {
case TIMESTAMP:
case TIME_WITH_TIMEZONE:
case TIMESTAMP_WITH_TIMEZONE:
case ExtraDbTypes.LOCALDATETIME:
return "timestamp";
//case LONGVARCHAR:
//case CLOB:
@@ -3,10 +3,10 @@ package io.ebeaninternal.server.type;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import io.ebean.config.JsonConfig;
import io.ebean.config.dbplatform.ExtraDbTypes;
import java.io.IOException;
import java.sql.Timestamp;
import java.sql.Types;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
@@ -17,7 +17,7 @@ import java.time.ZoneId;
final class ScalarTypeLocalDateTime extends ScalarTypeBaseDateTime<LocalDateTime> {
ScalarTypeLocalDateTime(JsonConfig.DateTime mode) {
super(mode, LocalDateTime.class, false, Types.TIMESTAMP);
super(mode, LocalDateTime.class, false, ExtraDbTypes.LOCALDATETIME);
}
@Override