summaryrefslogtreecommitdiff
path: root/app/Schema
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-05-25 15:02:27 -0400
committerFrédéric Guillot <fred@kanboard.net>2014-05-25 15:02:27 -0400
commitf9753e91d288c4d87d6a83ffe994d312eae5a3fd (patch)
tree96877bed70873e55aa5139f0ac6245c817e5911d /app/Schema
parent9ddeb5d978db9b1f223c98bbe83ac40fc4474225 (diff)
Add subtasks
Diffstat (limited to 'app/Schema')
-rw-r--r--app/Schema/Mysql.php19
-rw-r--r--app/Schema/Sqlite.php18
2 files changed, 35 insertions, 2 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php
index d3b111f9..3df38dee 100644
--- a/app/Schema/Mysql.php
+++ b/app/Schema/Mysql.php
@@ -2,7 +2,24 @@
namespace Schema;
-const VERSION = 17;
+const VERSION = 18;
+
+function version_18($pdo)
+{
+ $pdo->exec("
+ CREATE TABLE task_has_subtasks (
+ id INT NOT NULL AUTO_INCREMENT,
+ title VARCHAR(255),
+ status INT DEFAULT 0,
+ time_estimated INT DEFAULT 0,
+ time_spent INT DEFAULT 0,
+ task_id INT,
+ user_id INT,
+ PRIMARY KEY (id),
+ FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE
+ ) ENGINE=InnoDB CHARSET=utf8"
+ );
+}
function version_17($pdo)
{
diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php
index 94ef0316..663c7d34 100644
--- a/app/Schema/Sqlite.php
+++ b/app/Schema/Sqlite.php
@@ -2,7 +2,23 @@
namespace Schema;
-const VERSION = 17;
+const VERSION = 18;
+
+function version_18($pdo)
+{
+ $pdo->exec("
+ CREATE TABLE task_has_subtasks (
+ id INTEGER PRIMARY KEY,
+ title TEXT COLLATE NOCASE,
+ status INTEGER DEFAULT 0,
+ time_estimated INTEGER DEFAULT 0,
+ time_spent INTEGER DEFAULT 0,
+ task_id INTEGER,
+ user_id INTEGER,
+ FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE
+ )"
+ );
+}
function version_17($pdo)
{