From 9283fb88d80cb355ff98364a9a57b657fc511d98 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 17 Oct 2015 15:27:43 -0400 Subject: Add metadata for users, tasks and projects --- app/Schema/Postgres.php | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'app/Schema/Postgres.php') diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index ac8b15ee..1a399cfc 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -6,7 +6,40 @@ use PDO; use Kanboard\Core\Security; use Kanboard\Model\Link; -const VERSION = 72; +const VERSION = 73; + +function version_73($pdo) +{ + $pdo->exec(" + CREATE TABLE user_has_metadata ( + user_id INTEGER NOT NULL, + name VARCHAR(50) NOT NULL, + value VARCHAR(255) DEFAULT '', + FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE, + UNIQUE(user_id, name) + ) + "); + + $pdo->exec(" + CREATE TABLE project_has_metadata ( + project_id INTEGER NOT NULL, + name VARCHAR(50) NOT NULL, + value VARCHAR(255) DEFAULT '', + FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE, + UNIQUE(project_id, name) + ) + "); + + $pdo->exec(" + CREATE TABLE task_has_metadata ( + task_id INTEGER NOT NULL, + name VARCHAR(50) NOT NULL, + value VARCHAR(255) DEFAULT '', + FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE, + UNIQUE(task_id, name) + ) + "); +} function version_72($pdo) { @@ -14,7 +47,7 @@ function version_72($pdo) CREATE TABLE project_has_notification_types ( id SERIAL PRIMARY KEY, project_id INTEGER NOT NULL, - notification_type VARCHAR(50), + notification_type VARCHAR(50) NOT NULL, FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE, UNIQUE(project_id, notification_type) ) -- cgit v1.2.3