pablo.pazos
08/21/2025, 4:50 AMbillgonemad
08/21/2025, 12:41 PMstatic mapping = {
x(sqlType: 'DATE')
}
Sorry, reread your question and you have already tried thatJames Fredley
08/21/2025, 2:28 PMLocalDate x instead of Date x in your domain is the ideal path so precision will be the same in Groovy and MySQL.
If you have to use Date, try with lowercase 'date'
static mapping = {
x sqlType: 'date'
}
And maybe it will generate something like the following
changeSet(author: "your-name (generated)", id: "some-unique-id") {
modifyDataType(
columnName: "x",
newDataType: "date",
tableName: "your_domain"
)
}
and if not you will just have to create the migration changeset manually.pablo.pazos
09/01/2025, 11:09 PMdatabaseChangeLog = {
changeSet(author: "pablo (generated)", id: "dvdate-localdate-1") {
grailsChange {
change {
sql.execute("ALTER TABLE dv_date_index MODIFY COLUMN value DATE")
}
rollback {
sql.execute("ALTER TABLE dv_date_index MODIFY COLUMN value DATETIME")
}
}
}
}