From: Stéphane Jacob Date: Mon, 20 Sep 2010 07:17:11 +0000 (+0200) Subject: Fixes wrong foreign key. X-Git-Tag: xorg/1.0.1~168 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=0b5aebe16a9eb47158fce84e84d16206d2789f31;p=platal.git Fixes wrong foreign key. Signed-off-by: Stéphane Jacob --- diff --git a/upgrade/1.0.1/00_job.sql b/upgrade/1.0.1/00_job.sql index fa7b4ec..d7e5365 100644 --- a/upgrade/1.0.1/00_job.sql +++ b/upgrade/1.0.1/00_job.sql @@ -37,7 +37,6 @@ CREATE TABLE `profile_job_term` ( `computed` enum('original','computed') NOT NULL DEFAULT 'original' COMMENT 'terms can be added by user or computed from entreprise', PRIMARY KEY (`pid`, `jid`, `jtid`), INDEX `jtid` (`jtid`), - FOREIGN KEY (`jid`) REFERENCES `profile_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (`jtid`) REFERENCES `profile_job_term_enum` (`jtid`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB, CHARSET=utf8, COMMENT='job terms for jobs in profiles'; diff --git a/upgrade/1.0.1/07_ids_foreign_keys.sql b/upgrade/1.0.1/07_ids_foreign_keys.sql index af70000..a2235cc 100644 --- a/upgrade/1.0.1/07_ids_foreign_keys.sql +++ b/upgrade/1.0.1/07_ids_foreign_keys.sql @@ -84,7 +84,7 @@ ALTER TABLE profile_corps ADD FOREIGN KEY (pid) REFERENCES profiles (pid) ON DEL ALTER TABLE profile_display ADD FOREIGN KEY (pid) REFERENCES profiles (pid) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE profile_education ADD FOREIGN KEY (pid) REFERENCES profiles (pid) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE profile_job ADD FOREIGN KEY (pid) REFERENCES profiles (pid) ON DELETE CASCADE ON UPDATE CASCADE; -ALTER TABLE profile_job_term ADD FOREIGN KEY (pid) REFERENCES profiles (pid) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE profile_job_term ADD FOREIGN KEY (pid, jid) REFERENCES profile_job (pid, id) ON DELETE CASCADE ON UPDATE CASCADE, ALTER TABLE profile_langskills ADD FOREIGN KEY (pid) REFERENCES profiles (pid) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE profile_medals ADD FOREIGN KEY (pid) REFERENCES profiles (pid) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE profile_mentor ADD FOREIGN KEY (pid) REFERENCES profiles (pid) ON DELETE CASCADE ON UPDATE CASCADE;