In my diagram I have like 25 classes, and 2 of them has many-to-many relations. When I try to update the database from schema, i get errors.
Here's the reason;
CREATE TABLE public."Group_Forum" (
"Group_Id" INT8 NOT NULL,
"Forum_Id" INT8 NOT NULL,
CONSTRAINT "PrimaryKey" PRIMARY KEY ("Group_Id", "Forum_Id"),
CONSTRAINT "FK_Group_Forum_Group" FOREIGN KEY ("Group_Id") REFERENCES "Group" ("Id"),
CONSTRAINT "FK_Group_Forum_Forum" FOREIGN KEY ("Forum_Id") REFERENCES "Forum" ("Id")
);
--
-- Creating a table public."Role_Group"
--
CREATE TABLE public."Role_Group" (
"Role_Id" INT8 NOT NULL,
"Group_Id" INT8 NOT NULL,
CONSTRAINT "PrimaryKey" PRIMARY KEY ("Role_Id", "Group_Id"),
CONSTRAINT "FK_Role_Group_Role" FOREIGN KEY ("Role_Id") REFERENCES "Role" ("Id"),
CONSTRAINT "FK_Role_Group_Group" FOREIGN KEY ("Group_Id") REFERENCES "Group" ("Id")
);
As you see, two relations are created but with the same constraint name "PrimaryKey" and Postgresql does not like it at all
![Smile :)](./images/smilies/icon_smile.gif)
but to get it working, I have to get the script generated and rename those areas. Not good :/
Can you please fix that naming problem so we can get the schema updates working properly? (Or at least give me an option to name the constraints)
Thanks.