Details
Description
There is a number of issues with reverse and forward engineering of time-related types on MySQL. Not sure if this affects other databases.
Background
Per https://dev.mysql.com/doc/refman/8.0/en/fractional-seconds.html TIME, TIMESTAMP and DATETIME native types can be specified either without a numeric parameter (indicating truncation to whole seconds) or with a single numeric parameter (indicating the number of fractional digits). So "TIME" means whole seconds precision, "TIME(3)" means millisecond precision, "TIME(6)" - microsecond precision.
Reverse Engineering
Regardless of precision, Cayenne reverse-engineers the above 3 types to DbAttributes with "maxlength" of "19" and no "scale". Expected - empty "maxlength" and "scale" matching the precision of the column (e.g. none, 3, 6 for the example above).
Forward Engineering
Currently "maxlength" is included in the generated SQL (e.g. "TIME(19)"), causing DB errors. But even if there were no errors (if it was in the acceptable range), that would still generate invalid column definitions. Expected - "maxlength" must be ignored, and "scale" used if present (e.g. "TIME", "TIME(3)", etc.)
Forward engineering is particularly important for Bootique users who are relying on Cayenne for schema generation.