Add subtasks restrictions and time tracking

This commit is contained in:
Frederic Guillot
2015-02-04 22:19:32 -05:00
parent 2d070627d7
commit b24b1e7e4e
38 changed files with 522 additions and 51 deletions

View File

@@ -5,7 +5,26 @@ namespace Schema;
use PDO;
use Core\Security;
const VERSION = 23;
const VERSION = 24;
function version_24($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 SERIAL 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_23($pdo)
{