summaryrefslogtreecommitdiff
path: root/app/Schema/Sqlite.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Schema/Sqlite.php')
-rw-r--r--app/Schema/Sqlite.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php
index 16143646..17166e64 100644
--- a/app/Schema/Sqlite.php
+++ b/app/Schema/Sqlite.php
@@ -5,7 +5,26 @@ namespace Schema;
use Core\Security;
use PDO;
-const VERSION = 41;
+const VERSION = 42;
+
+function version_42($pdo)
+{
+ $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
+ $rq->execute(array('subtask_restriction', '0'));
+ $rq->execute(array('subtask_time_tracking', '0'));
+
+ $pdo->exec("
+ CREATE TABLE subtask_time_tracking (
+ id INTEGER PRIMARY KEY,
+ user_id INTEGER NOT NULL,
+ subtask_id INTEGER NOT NULL,
+ start INTEGER DEFAULT 0,
+ end INTEGER DEFAULT 0,
+ FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE,
+ FOREIGN KEY(subtask_id) REFERENCES task_has_subtasks(id) ON DELETE CASCADE
+ )
+ ");
+}
function version_41($pdo)
{