From 370b5a0fd7c1dba60e3b973506ba087adba42be0 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 18 Apr 2015 18:44:45 -0400 Subject: Add Slack and Hipchat integrations for each projects --- app/Schema/Mysql.php | 20 +++++++++++++++++++- app/Schema/Postgres.php | 19 ++++++++++++++++++- app/Schema/Sqlite.php | 19 ++++++++++++++++++- 3 files changed, 55 insertions(+), 3 deletions(-) (limited to 'app/Schema') diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 6ad6dc51..3e67387d 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -6,7 +6,25 @@ use PDO; use Core\Security; use Model\Link; -const VERSION = 64; +const VERSION = 65; + +function version_65($pdo) +{ + $pdo->exec(" + CREATE TABLE project_integrations ( + `id` INT NOT NULL AUTO_INCREMENT, + `project_id` INT NOT NULL UNIQUE, + `hipchat` TINYINT(1) DEFAULT 0, + `hipchat_api_url` VARCHAR(255) DEFAULT 'https://api.hipchat.com', + `hipchat_room_id` VARCHAR(255), + `hipchat_room_token` VARCHAR(255), + `slack` TINYINT(1) DEFAULT 0, + `slack_webhook_url` VARCHAR(255), + FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE, + PRIMARY KEY(id) + ) ENGINE=InnoDB CHARSET=utf8 + "); +} function version_64($pdo) { diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index b5cf72a6..6973b266 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -6,7 +6,24 @@ use PDO; use Core\Security; use Model\Link; -const VERSION = 45; +const VERSION = 46; + +function version_46($pdo) +{ + $pdo->exec(" + CREATE TABLE project_integrations ( + id SERIAL PRIMARY KEY, + project_id INTEGER NOT NULL UNIQUE, + hipchat BOOLEAN DEFAULT '0', + hipchat_api_url VARCHAR(255) DEFAULT 'https://api.hipchat.com', + hipchat_room_id VARCHAR(255), + hipchat_room_token VARCHAR(255), + slack BOOLEAN DEFAULT '0', + slack_webhook_url VARCHAR(255), + FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE + ) + "); +} function version_45($pdo) { diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index fb1d7d29..c4ebd98a 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -6,7 +6,24 @@ use Core\Security; use PDO; use Model\Link; -const VERSION = 63; +const VERSION = 64; + +function version_64($pdo) +{ + $pdo->exec(" + CREATE TABLE project_integrations ( + id INTEGER PRIMARY KEY, + project_id INTEGER NOT NULL UNIQUE, + hipchat INTEGER DEFAULT 0, + hipchat_api_url TEXT DEFAULT 'https://api.hipchat.com', + hipchat_room_id TEXT, + hipchat_room_token TEXT, + slack INTEGER DEFAULT 0, + slack_webhook_url TEXT, + FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE + ) + "); +} function version_63($pdo) { -- cgit v1.2.3