From ba93061f4d844214851d5a22b5a34022ce37e925 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Tue, 8 Jul 2014 15:07:07 -0300 Subject: Add fields: task creator and modification date --- app/Schema/Mysql.php | 8 +++++++- app/Schema/Postgres.php | 8 +++++++- app/Schema/Sqlite.php | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'app/Schema') diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 2c78d1e5..b9c35efc 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -4,7 +4,13 @@ namespace Schema; use Core\Security; -const VERSION = 20; +const VERSION = 21; + +function version_21($pdo) +{ + $pdo->exec("ALTER TABLE tasks ADD COLUMN creator_id INTEGER DEFAULT '0'"); + $pdo->exec("ALTER TABLE tasks ADD COLUMN date_modification INTEGER DEFAULT '0'"); +} function version_20($pdo) { diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index 8ac6631c..bc18bdca 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -4,7 +4,13 @@ namespace Schema; use Core\Security; -const VERSION = 1; +const VERSION = 2; + +function version_2($pdo) +{ + $pdo->exec("ALTER TABLE tasks ADD COLUMN creator_id INTEGER DEFAULT 0"); + $pdo->exec("ALTER TABLE tasks ADD COLUMN date_modification INTEGER DEFAULT 0"); +} function version_1($pdo) { diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index e4de397d..5ab42a6e 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -4,7 +4,13 @@ namespace Schema; use Core\Security; -const VERSION = 20; +const VERSION = 21; + +function version_21($pdo) +{ + $pdo->exec("ALTER TABLE tasks ADD COLUMN creator_id INTEGER DEFAULT '0'"); + $pdo->exec("ALTER TABLE tasks ADD COLUMN date_modification INTEGER DEFAULT '0'"); +} function version_20($pdo) { -- cgit v1.2.3