From cede5d5434e4e50145daf2413c962a335c13cc99 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Wed, 10 Sep 2014 16:51:44 +0200 Subject: Fix Mysql and Postgresql bug --- app/Schema/Mysql.php | 55 +++++++++------------------------------------------- 1 file changed, 9 insertions(+), 46 deletions(-) (limited to 'app/Schema/Mysql.php') diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 9ab12a1a..2d3f993e 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -19,8 +19,9 @@ function version_25($pdo) data TEXT, FOREIGN KEY(creator_id) REFERENCES users(id) ON DELETE CASCADE, FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE, - FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE - ); + FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE, + PRIMARY KEY (id) + ) ENGINE=InnoDB CHARSET=utf8 "); $pdo->exec(" @@ -36,8 +37,9 @@ function version_25($pdo) FOREIGN KEY(creator_id) REFERENCES users(id) ON DELETE CASCADE, FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE, FOREIGN KEY(subtask_id) REFERENCES task_has_subtasks(id) ON DELETE CASCADE, - FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE - ); + FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE, + PRIMARY KEY (id) + ) ENGINE=InnoDB CHARSET=utf8 "); $pdo->exec(" @@ -53,8 +55,9 @@ function version_25($pdo) FOREIGN KEY(creator_id) REFERENCES users(id) ON DELETE CASCADE, FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE, FOREIGN KEY(comment_id) REFERENCES comments(id) ON DELETE CASCADE, - FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE - ); + FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE, + PRIMARY KEY (id) + ) ENGINE=InnoDB CHARSET=utf8 "); } @@ -197,46 +200,6 @@ function version_12($pdo) ); } -function version_11($pdo) -{ -} - -function version_10($pdo) -{ -} - -function version_9($pdo) -{ -} - -function version_8($pdo) -{ -} - -function version_7($pdo) -{ -} - -function version_6($pdo) -{ -} - -function version_5($pdo) -{ -} - -function version_4($pdo) -{ -} - -function version_3($pdo) -{ -} - -function version_2($pdo) -{ -} - function version_1($pdo) { $pdo->exec(" -- cgit v1.2.3