diff options
Diffstat (limited to 'models/schema.php')
-rw-r--r-- | models/schema.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/models/schema.php b/models/schema.php index 3217663a..9ccb500f 100644 --- a/models/schema.php +++ b/models/schema.php @@ -2,6 +2,14 @@ namespace Schema; +function version_2($pdo) +{ + $pdo->exec('ALTER TABLE tasks ADD column date_completed INTEGER'); + + // For all existing completed tasks, set the date of creation as a date of completion + $pdo->exec('UPDATE tasks SET date_completed=date_creation WHERE is_active=0'); +} + function version_1($pdo) { $pdo->exec(" |