summaryrefslogtreecommitdiff
path: root/app/Schema/Mysql.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Schema/Mysql.php')
-rw-r--r--app/Schema/Mysql.php37
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),