summaryrefslogtreecommitdiff
path: root/models/schema.php
diff options
context:
space:
mode:
authorFrédéric Guillot <contact@fredericguillot.com>2014-02-22 13:37:06 -0500
committerFrédéric Guillot <contact@fredericguillot.com>2014-02-22 13:37:06 -0500
commita1923d3d7f9276e859d6fd6bee339f0ea00f6544 (patch)
tree84caca943de5d0e016455ea2f6896d0b697fdf05 /models/schema.php
parentfd28d50597d4f255ba9514e0fc03c8cb67c86f22 (diff)
Add a page to display completed tasks and add the completion date column for tasks
Diffstat (limited to 'models/schema.php')
-rw-r--r--models/schema.php8
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("