From: olivier Date: Mon, 15 Jun 2009 14:20:33 +0000 (+0000) Subject: migration: enforce uniqueness on instruments relations tables X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=05366f5a63febdc482339b71d34fe67b2bd49b70;p=telemeta-data.git migration: enforce uniqueness on instruments relations tables git-svn-id: http://svn.parisson.org/svn/crem@108 3bf09e05-f825-4182-b9bc-eedd7160adf0 --- diff --git a/trunk/docref/crem.sql b/trunk/docref/crem.sql index 07dd84e..9849023 100644 --- a/trunk/docref/crem.sql +++ b/trunk/docref/crem.sql @@ -312,6 +312,7 @@ CREATE TABLE instrument_relations ( instrument_id INTEGER NOT NULL, parent_instrument_id INTEGER NOT NULL, + PRIMARY KEY(instrument_id, parent_instrument_id), FOREIGN KEY(instrument_id) REFERENCES instruments (id) ON DELETE CASCADE, FOREIGN KEY(parent_instrument_id) REFERENCES instruments (id) @@ -327,6 +328,7 @@ CREATE TABLE instrument_alias_relations ( alias_id INTEGER NOT NULL, instrument_id INTEGER NOT NULL, + PRIMARY KEY(alias_id, instrument_id), FOREIGN KEY(alias_id) REFERENCES instrument_aliases (id) ON DELETE CASCADE, FOREIGN KEY(instrument_id) REFERENCES instruments (id)