From 33f9cdbc976e0f97c3dd24658dc7d0097497c6d7 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sun, 28 Sep 2014 18:23:21 -0400 Subject: Add support for Github Issue Webhooks --- app/Schema/Mysql.php | 11 ++++++++++- app/Schema/Postgres.php | 17 +++++++++++++---- app/Schema/Sqlite.php | 11 ++++++++++- 3 files changed, 33 insertions(+), 6 deletions(-) (limited to 'app/Schema') diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 196fb856..577fac80 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -4,7 +4,16 @@ namespace Schema; use Core\Security; -const VERSION = 27; +const VERSION = 28; + +function version_28($pdo) +{ + $pdo->exec("ALTER TABLE tasks ADD COLUMN reference VARCHAR(50) DEFAULT ''"); + $pdo->exec("ALTER TABLE comments ADD COLUMN reference VARCHAR(50) DEFAULT ''"); + + $pdo->exec('CREATE INDEX tasks_reference_idx ON tasks(reference)'); + $pdo->exec('CREATE INDEX comments_reference_idx ON comments(reference)'); +} function version_27($pdo) { diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index 3341d4a1..33859513 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -4,7 +4,16 @@ namespace Schema; use Core\Security; -const VERSION = 8; +const VERSION = 9; + +function version_9($pdo) +{ + $pdo->exec("ALTER TABLE tasks ADD COLUMN reference VARCHAR(50) DEFAULT ''"); + $pdo->exec("ALTER TABLE comments ADD COLUMN reference VARCHAR(50) DEFAULT ''"); + + $pdo->exec('CREATE INDEX tasks_reference_idx ON tasks(reference)'); + $pdo->exec('CREATE INDEX comments_reference_idx ON comments(reference)'); +} function version_8($pdo) { @@ -22,7 +31,7 @@ function version_6($pdo) CREATE TABLE task_has_events ( id SERIAL PRIMARY KEY, date_creation INTEGER NOT NULL, - event_name TEXT NOT NULL, + event_name VARCHAR(50) NOT NULL, creator_id INTEGER, project_id INTEGER, task_id INTEGER, @@ -37,7 +46,7 @@ function version_6($pdo) CREATE TABLE subtask_has_events ( id SERIAL PRIMARY KEY, date_creation INTEGER NOT NULL, - event_name TEXT NOT NULL, + event_name VARCHAR(50) NOT NULL, creator_id INTEGER, project_id INTEGER, subtask_id INTEGER, @@ -54,7 +63,7 @@ function version_6($pdo) CREATE TABLE comment_has_events ( id SERIAL PRIMARY KEY, date_creation INTEGER NOT NULL, - event_name TEXT NOT NULL, + event_name VARCHAR(50) NOT NULL, creator_id INTEGER, project_id INTEGER, comment_id INTEGER, diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index 108c07f2..d9b3787d 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -4,7 +4,16 @@ namespace Schema; use Core\Security; -const VERSION = 27; +const VERSION = 28; + +function version_28($pdo) +{ + $pdo->exec("ALTER TABLE tasks ADD COLUMN reference TEXT DEFAULT ''"); + $pdo->exec("ALTER TABLE comments ADD COLUMN reference TEXT DEFAULT ''"); + + $pdo->exec('CREATE INDEX tasks_reference_idx ON tasks(reference)'); + $pdo->exec('CREATE INDEX comments_reference_idx ON comments(reference)'); +} function version_27($pdo) { -- cgit v1.2.3