diff options
| author | Frederic Guillot <fred@kanboard.net> | 2015-02-04 22:19:32 -0500 | 
|---|---|---|
| committer | Frederic Guillot <fred@kanboard.net> | 2015-02-04 22:19:32 -0500 | 
| commit | b24b1e7e4e5ee0551ee56aa0f21c4425b479db2e (patch) | |
| tree | 5fffaeb461707dada9f2909101d51c9da3c77a50 /app/Schema/Mysql.php | |
| parent | 2d070627d751bf5728ec98a5efaf163532594cd9 (diff) | |
Add subtasks restrictions and time tracking
Diffstat (limited to 'app/Schema/Mysql.php')
| -rw-r--r-- | app/Schema/Mysql.php | 22 | 
1 files changed, 21 insertions, 1 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 54aa748e..5a52288b 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -5,7 +5,27 @@ namespace Schema;  use PDO;  use Core\Security; -const VERSION = 42; +const VERSION = 43; + +function version_43($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 INT NOT NULL AUTO_INCREMENT, +            user_id INT NOT NULL, +            subtask_id INT NOT NULL, +            start INT DEFAULT 0, +            end INT DEFAULT 0, +            PRIMARY KEY(id), +            FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE, +            FOREIGN KEY(subtask_id) REFERENCES task_has_subtasks(id) ON DELETE CASCADE +        ) ENGINE=InnoDB CHARSET=utf8 +    "); +}  function version_42($pdo)  {  | 
