ana benko created CAY-2246: ------------------------------ Summary: Attribute type max length is different from original value Key: CAY-2246 URL: https://issues.apache.org/jira/browse/CAY-2246 Project: Cayenne Issue Type: Bug Components: Modeler Affects Versions: 4.0.M5 Reporter: ana benko Attachments: modeler.png, mysql.png
1. In db (MySQL) create table columns of type: date, time, timestamp, datetime. Set max length !mysql.png|thumbnail! 2. Reverse Engineer above db in modeler 3. Verify correspondig DbEntity attributes -> max length values do not match the original values !modeler.png|thumbnail! Also when i attempted to Generate db Schema from this model, got warning message: [SQL: CREATE TABLE testdb.dept (date DATE NULL, datetime DATETIME(19) NULL, id INT NOT NULL, name INT NULL, time TIME(8) NULL, timestamp DATETIME(19) NULL, PRIMARY KEY (id)) ENGINE=InnoDB] - Too-big precision 19 specified for 'datetime'. Maximum is 6. [SQL: ALTER TABLE testdb.salary ADD FOREIGN KEY (dept_id) REFERENCES testdb.dept (id)] - Cannot add foreign key constraint -> table was not created -- This message was sent by Atlassian JIRA (v6.3.15#6346)