View Revisions: Issue #3750

Summary 0003750: Create Table fails with foreign key constraints with more than one column in H2 and Postgres
Revision 2018-10-10 14:43 by hanes
Description If a table has a constrain that references more than one column, Create Table incorrectly runs two alter statements, at least under H2.

ALTER TABLE "ITEM_PRICE"
    ADD CONSTRAINT "CONSTRAINT_DF00" FOREIGN KEY ("ITEM_ID", "STORE_ID") REFERENCES "ITEM" ("ID", "DESCRIPTION");
Revision 2018-10-10 14:48 by hanes
Description If a table has a constrain that references more than one column, Create Table incorrectly runs two alter statements, at least under H2.

At the source:

ALTER TABLE "ITEM_PRICE"
    ADD CONSTRAINT "CONSTRAINT_DF00" FOREIGN KEY ("ITEM_ID", "STORE_ID") REFERENCES "ITEM" ("ID", "DESCRIPTION");

But the XML that is generated for the Create Table contains two entries for the constraint, not just one.

Interesting, on the source, the SQL Explorer's Source tab shows things correctly.
Revision 2018-10-10 15:07 by hanes
Description If a table has a constrain that references more than one column, Create Table incorrectly runs two alter statements, at least under H2 (and postgres).

At the source:

ALTER TABLE "ITEM_PRICE"
    ADD CONSTRAINT "CONSTRAINT_DF00" FOREIGN KEY ("ITEM_ID", "STORE_ID") REFERENCES "ITEM" ("ID", "DESCRIPTION");

But the XML that is generated for the Create Table contains two entries for the constraint, not just one.

Interesting, on the source, the SQL Explorer's Source tab shows things correctly.