diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-03-27 15:32:29 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-03-27 15:32:29 -0400 |
commit | f11fccd0d78ab037e77cd973a9168eedcb609fc2 (patch) | |
tree | b98b3e8fb4b7c6a5161503877b81fb4ca1237eeb /app/Schema | |
parent | 9ba44a01dbb187f4c931e1ba838e2bad258d34f4 (diff) |
Fix bad unique constraints in Mysql table user_has_notifications
Diffstat (limited to 'app/Schema')
-rw-r--r-- | app/Schema/Mysql.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index ccb5a9cf..a041b3dc 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -6,7 +6,16 @@ use PDO; use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; -const VERSION = 109; +const VERSION = 110; + +function version_110(PDO $pdo) +{ + $pdo->exec("ALTER TABLE user_has_notifications DROP FOREIGN KEY `user_has_notifications_ibfk_1`"); + $pdo->exec("ALTER TABLE user_has_notifications DROP FOREIGN KEY `user_has_notifications_ibfk_2`"); + $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`)"); +} function version_109(PDO $pdo) { |