DDL generation produces invalid type for ZonedDateTime #3720
Replies: 2 comments
-
You should create a failing test. Noting that this doesn't reproduce in master, so you should create a failing test first to confirm you can reproduce the issue. @WhenCreated
ZonedDateTime zonedDateTime;
@WhenModified
ZonedDateTime zonedDateTime2; zoned_date_time timestamp not null,
zoned_date_time2 timestamp not null,
These are expected to be used together for testing purposes yes. You might want to outline the use case and include the NPE to see what should happen / if we need to change or fix something here. |
Beta Was this translation helpful? Give feedback.
-
|
Here is a minimal reproducer demonstrating the failing test:
No specific use case — this came up while debugging a DDL generator issue and trying to initialize the database via |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
After upgrading to Ebean 16.0.0+, DDL generation for ZonedDateTime fields annotated with @WhenCreated / @WhenUpdated produces timestamp(255) when running against H2.
Since this is not a valid H2 type, schema creation fails in tests.
Is this expected in 16.x, or should this be reported as a bug?
While looking into this further, I noticed that DdlGenerator does not seem to support running only initSql / seedSql without full DDL generation. When generate=false and only initSql is used, a NullPointerException occurs, which suggests these steps are currently coupled to DDL generation.
#https://github.com/ebean-orm/ebean/blob/master/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/DdlGenerator.java#L126-L129
Is this expected, or should running initSql / seedSql independently be supported?
Beta Was this translation helpful? Give feedback.
All reactions