From 9eeded33f68872515954a2fc177fcb47a9273ae9 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 15 Aug 2014 17:23:41 -0700 Subject: Add email notifications --- app/Schema/Mysql.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'app/Schema/Mysql.php') diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 46fc6d43..8f3ae5a1 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -4,7 +4,22 @@ namespace Schema; use Core\Security; -const VERSION = 22; +const VERSION = 23; + +function version_23($pdo) +{ + $pdo->exec("ALTER TABLE users ADD COLUMN notifications_enabled TINYINT(1) DEFAULT '0'"); + + $pdo->exec(" + CREATE TABLE user_has_notifications ( + user_id INT, + project_id INT, + FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE, + FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE, + UNIQUE(project_id, user_id) + ); + "); +} function version_22($pdo) { -- cgit v1.2.3