From 0b5aebe16a9eb47158fce84e84d16206d2789f31 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Mon, 20 Sep 2010 09:17:11 +0200 Subject: [PATCH] Fixes wrong foreign key. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- upgrade/1.0.1/00_job.sql | 1 - upgrade/1.0.1/07_ids_foreign_keys.sql | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) 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; -- 2.1.4