diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-03-27 16:21:15 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-03-27 16:21:15 -0400 |
commit | 004fde30f7cc0dd4864c50f8d804da9679f524fa (patch) | |
tree | e3122c89e16b4abb97166494009835115b30b5e8 /app/Schema/Mysql.php | |
parent | f11fccd0d78ab037e77cd973a9168eedcb609fc2 (diff) |
Update SQL dumps and improve schema migration process
Diffstat (limited to 'app/Schema/Mysql.php')
-rw-r--r-- | app/Schema/Mysql.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index a041b3dc..934b063f 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -15,6 +15,8 @@ function version_110(PDO $pdo) $pdo->exec("DROP INDEX `project_id` ON user_has_notifications"); $pdo->exec("ALTER TABLE user_has_notifications DROP KEY `user_id`"); $pdo->exec("CREATE UNIQUE INDEX `user_has_notifications_unique_idx` ON `user_has_notifications` (`user_id`, `project_id`)"); + $pdo->exec("ALTER TABLE user_has_notifications ADD CONSTRAINT user_has_notifications_ibfk_1 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE"); + $pdo->exec("ALTER TABLE user_has_notifications ADD CONSTRAINT user_has_notifications_ibfk_2 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE"); } function version_109(PDO $pdo) |