From ae3ade0908bae350488260ee5d878a2ffbff605a Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Thu, 9 Aug 2018 19:45:51 +0200 Subject: Allow to associate project categories to colors The color is then used as background in the board and list views --- app/Schema/Mysql.php | 7 ++++++- app/Schema/Postgres.php | 7 ++++++- app/Schema/Sql/mysql.sql | 1 + app/Schema/Sql/postgres.sql | 3 ++- app/Schema/Sqlite.php | 7 ++++++- 5 files changed, 21 insertions(+), 4 deletions(-) (limited to 'app/Schema') diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 7d8c0993..a5074a43 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -8,7 +8,12 @@ use PDO; use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; -const VERSION = 131; +const VERSION = 132; + +function version_132(PDO $pdo) +{ + $pdo->exec('ALTER TABLE `project_has_categories` ADD COLUMN `color_id` VARCHAR(50) DEFAULT NULL'); +} function version_131(PDO $pdo) { diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index bd2ba1e1..cd4e0fac 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -8,7 +8,12 @@ use PDO; use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; -const VERSION = 109; +const VERSION = 110; + +function version_110(PDO $pdo) +{ + $pdo->exec('ALTER TABLE "project_has_categories" ADD COLUMN "color_id" VARCHAR(50) DEFAULT NULL'); +} function version_109(PDO $pdo) { diff --git a/app/Schema/Sql/mysql.sql b/app/Schema/Sql/mysql.sql index fba959a9..b626013a 100644 --- a/app/Schema/Sql/mysql.sql +++ b/app/Schema/Sql/mysql.sql @@ -294,6 +294,7 @@ CREATE TABLE `project_has_categories` ( `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `project_id` int(11) NOT NULL, `description` mediumtext COLLATE utf8mb4_unicode_ci, + `color_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `idx_project_category` (`project_id`,`name`), KEY `categories_project_idx` (`project_id`), diff --git a/app/Schema/Sql/postgres.sql b/app/Schema/Sql/postgres.sql index 5a2224fb..c0ea275b 100644 --- a/app/Schema/Sql/postgres.sql +++ b/app/Schema/Sql/postgres.sql @@ -542,7 +542,8 @@ CREATE TABLE "project_has_categories" ( "id" integer NOT NULL, "name" character varying(255) NOT NULL, "project_id" integer NOT NULL, - "description" "text" + "description" "text", + "color_id" character varying(255) ); diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index 99731452..7889b133 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -8,7 +8,12 @@ use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; use PDO; -const VERSION = 118; +const VERSION = 119; + +function version_119(PDO $pdo) +{ + $pdo->exec('ALTER TABLE project_has_categories ADD COLUMN color_id TEXT DEFAULT NULL'); +} function version_118(PDO $pdo) { -- cgit v1.2.3