From 22b26d0b4d68f0492275ec93eb4df1a975a8fc80 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 20 Jun 2015 17:53:49 -0400 Subject: Change comments table structure (drop foreign key on user_id) --- app/Schema/Mysql.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'app/Schema/Mysql.php') diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 21b7a4de..34a609cf 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -6,7 +6,15 @@ use PDO; use Core\Security; use Model\Link; -const VERSION = 74; +const VERSION = 75; + +function version_75($pdo) +{ + $pdo->exec('ALTER TABLE comments DROP FOREIGN KEY comments_ibfk_2'); + $pdo->exec('ALTER TABLE comments MODIFY task_id INT NOT NULL'); + $pdo->exec('ALTER TABLE comments CHANGE COLUMN `user_id` `user_id` INT DEFAULT 0'); + $pdo->exec('ALTER TABLE comments CHANGE COLUMN `date` `date_creation` INT NOT NULL'); +} function version_74($pdo) { -- cgit v1.2.3