I am using Hibernate 5.2.14 through Spring Boot 2.0 with MySQL 5.7.20.
I am letting Hibernate generate my Schema (ddl-auto=update, I am aware to only use this during development phase) and I am unable to make Hibernate generate a TIMESTAMP column in the Schema. Things I have tried (in Kotlin):
@Column
var modifiedAt: Instant?
@Column
@Type(type = "timestamp")
var modifiedAt: Instant?
@Column
@Type(type = "Instant")
var modifiedAt: Instant?
@Column
@Temporal(TIMESTAMP)
var modifiedAt: Date?
@Column
@Type(type = "timestamp")
var modifiedAt: Date?
All these generate a DATETIME column in the database. How do I instruct Hibernate to create a TIMESTAMP column? I am aware I could use columnDefinition = "TIMESTAMP", however this is just ramming raw SQL down Hibernate's throat, which seems wrong. Is it really the only way?