summaryrefslogtreecommitdiff
path: root/app/Schema/Mysql.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-09-10 16:21:47 +0200
committerFrédéric Guillot <fred@kanboard.net>2014-09-10 16:21:47 +0200
commit28ff8dad91c9e3c25f6a3b5398ae15f2a1ef95cd (patch)
tree0cecc5cbb6e7e6795dd032cc6a5703cd88b8770e /app/Schema/Mysql.php
parent9bde377bbe85617dde280af985e033cf7de61803 (diff)
Add subtasks and comments history
Diffstat (limited to 'app/Schema/Mysql.php')
-rw-r--r--app/Schema/Mysql.php54
1 files changed, 53 insertions, 1 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php
index 9b202a69..9ab12a1a 100644
--- a/app/Schema/Mysql.php
+++ b/app/Schema/Mysql.php
@@ -4,7 +4,59 @@ namespace Schema;
use Core\Security;
-const VERSION = 24;
+const VERSION = 25;
+
+function version_25($pdo)
+{
+ $pdo->exec("
+ CREATE TABLE task_has_events (
+ id INT NOT NULL AUTO_INCREMENT,
+ date_creation INT NOT NULL,
+ event_name TEXT NOT NULL,
+ creator_id INT,
+ project_id INT,
+ task_id INT,
+ data TEXT,
+ FOREIGN KEY(creator_id) REFERENCES users(id) ON DELETE CASCADE,
+ FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,
+ FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE
+ );
+ ");
+
+ $pdo->exec("
+ CREATE TABLE subtask_has_events (
+ id INT NOT NULL AUTO_INCREMENT,
+ date_creation INT NOT NULL,
+ event_name TEXT NOT NULL,
+ creator_id INT,
+ project_id INT,
+ subtask_id INT,
+ task_id INT,
+ data TEXT,
+ FOREIGN KEY(creator_id) REFERENCES users(id) ON DELETE CASCADE,
+ FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,
+ FOREIGN KEY(subtask_id) REFERENCES task_has_subtasks(id) ON DELETE CASCADE,
+ FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE
+ );
+ ");
+
+ $pdo->exec("
+ CREATE TABLE comment_has_events (
+ id INT NOT NULL AUTO_INCREMENT,
+ date_creation INT NOT NULL,
+ event_name TEXT NOT NULL,
+ creator_id INT,
+ project_id INT,
+ comment_id INT,
+ task_id INT,
+ data TEXT,
+ FOREIGN KEY(creator_id) REFERENCES users(id) ON DELETE CASCADE,
+ FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,
+ FOREIGN KEY(comment_id) REFERENCES comments(id) ON DELETE CASCADE,
+ FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE
+ );
+ ");
+}
function version_24($pdo)
{