summaryrefslogtreecommitdiff
path: root/app/Schema/Sqlite.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-08-15 17:23:41 -0700
committerFrédéric Guillot <fred@kanboard.net>2014-08-15 17:23:41 -0700
commit9eeded33f68872515954a2fc177fcb47a9273ae9 (patch)
treef3ef9507e087ca6bf3ce624232da240a8689b051 /app/Schema/Sqlite.php
parentc539bdc8ab746c5afd48cf87de057dc38d50adac (diff)
Add email notifications
Diffstat (limited to 'app/Schema/Sqlite.php')
-rw-r--r--app/Schema/Sqlite.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php
index 4660251f..c3a3f10e 100644
--- a/app/Schema/Sqlite.php
+++ b/app/Schema/Sqlite.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 INTEGER DEFAULT '0'");
+
+ $pdo->exec("
+ CREATE TABLE user_has_notifications (
+ user_id INTEGER,
+ project_id INTEGER,
+ 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)
{