diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-10-17 15:27:43 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-10-17 15:27:43 -0400 |
commit | 9283fb88d80cb355ff98364a9a57b657fc511d98 (patch) | |
tree | 52c99cd8adf28e3eb2c30c3d625817b48a8cd4ec /app/Schema/Mysql.php | |
parent | 9153c6ff0ddb3170928d33599d9178e67ca466b6 (diff) |
Add metadata for users, tasks and projects
Diffstat (limited to 'app/Schema/Mysql.php')
-rw-r--r-- | app/Schema/Mysql.php | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 852dca92..b85c185e 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -6,7 +6,40 @@ use PDO; use Kanboard\Core\Security; use Kanboard\Model\Link; -const VERSION = 92; +const VERSION = 93; + +function version_93($pdo) +{ + $pdo->exec(" + CREATE TABLE user_has_metadata ( + user_id INT 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) + ) ENGINE=InnoDB CHARSET=utf8 + "); + + $pdo->exec(" + CREATE TABLE project_has_metadata ( + project_id INT 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) + ) ENGINE=InnoDB CHARSET=utf8 + "); + + $pdo->exec(" + CREATE TABLE task_has_metadata ( + task_id INT 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) + ) ENGINE=InnoDB CHARSET=utf8 + "); +} function version_92($pdo) { @@ -14,7 +47,7 @@ function version_92($pdo) CREATE TABLE project_has_notification_types ( id INT NOT NULL AUTO_INCREMENT, project_id INT NOT NULL, - notification_type VARCHAR(50), + notification_type VARCHAR(50) NOT NULL, PRIMARY KEY(id), FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE UNIQUE(project_id, notification_type), |