diff options
Diffstat (limited to 'app/Schema')
-rw-r--r-- | app/Schema/Mysql.php | 12 | ||||
-rw-r--r-- | app/Schema/Postgres.php | 12 | ||||
-rw-r--r-- | app/Schema/Sqlite.php | 13 |
3 files changed, 32 insertions, 5 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index c7293a43..7a0b2cd1 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -5,7 +5,17 @@ namespace Schema; use PDO; use Core\Security; -const VERSION = 31; +const VERSION = 32; + +function version_32($pdo) +{ + $pdo->exec("ALTER TABLE tasks ADD COLUMN date_started INTEGER"); + $pdo->exec("ALTER TABLE tasks ADD COLUMN time_spent FLOAT DEFAULT 0"); + $pdo->exec("ALTER TABLE tasks ADD COLUMN time_estimated FLOAT DEFAULT 0"); + + $pdo->exec("ALTER TABLE task_has_subtasks MODIFY time_estimated FLOAT"); + $pdo->exec("ALTER TABLE task_has_subtasks MODIFY time_spent FLOAT"); +} function version_31($pdo) { diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index fe2cce54..e42e8e72 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -5,7 +5,17 @@ namespace Schema; use PDO; use Core\Security; -const VERSION = 12; +const VERSION = 13; + +function version_13($pdo) +{ + $pdo->exec("ALTER TABLE tasks ADD COLUMN date_started INTEGER"); + $pdo->exec("ALTER TABLE tasks ADD COLUMN time_spent FLOAT DEFAULT 0"); + $pdo->exec("ALTER TABLE tasks ADD COLUMN time_estimated FLOAT DEFAULT 0"); + + $pdo->exec("ALTER TABLE task_has_subtasks ALTER COLUMN time_estimated TYPE FLOAT"); + $pdo->exec("ALTER TABLE task_has_subtasks ALTER COLUMN time_spent TYPE FLOAT"); +} function version_12($pdo) { diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index cefe8ab5..45a6fb22 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -5,7 +5,14 @@ namespace Schema; use Core\Security; use PDO; -const VERSION = 31; +const VERSION = 32; + +function version_32($pdo) +{ + $pdo->exec("ALTER TABLE tasks ADD COLUMN date_started INTEGER"); + $pdo->exec("ALTER TABLE tasks ADD COLUMN time_spent FLOAT DEFAULT 0"); + $pdo->exec("ALTER TABLE tasks ADD COLUMN time_estimated FLOAT DEFAULT 0"); +} function version_31($pdo) { @@ -169,8 +176,8 @@ function version_18($pdo) id INTEGER PRIMARY KEY, title TEXT COLLATE NOCASE, status INTEGER DEFAULT 0, - time_estimated INTEGER DEFAULT 0, - time_spent INTEGER DEFAULT 0, + time_estimated NUMERIC DEFAULT 0, + time_spent NUMERIC DEFAULT 0, task_id INTEGER NOT NULL, user_id INTEGER, FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE |