Hi,
I use shemaexport to generate my sql schema (mysql dialect).
All my keys are VARCHAR(32). Yet, when schemaexport generates a foreign key, it uses VARCHAR(255).
This is an example of what schemaexport generates:
create table Department (
id char(32) not null,
name VARCHAR(40) )
create table Employee (
id char(32) not null,
firstName VARCHAR(40)
firstName VARCHAR(40)
departmentId VARCHAR(255))
alter table Employee add index (departmentId), add constraint FK9F084418F1DA02D foreign key (departmentId) references Department (id);
I would expect Employee.departmentId to be VARCHAR(32) to match Department.Id;
Same thing for composite keys in many-to-many tables.
Is there a way to make schemaexport generate the right foreign keys or do I have to keep on editing manually the resulting file after every data model modification?
Thanks,
-Vincent.
|