summaryrefslogtreecommitdiff
path: root/app/Schema
diff options
context:
space:
mode:
Diffstat (limited to 'app/Schema')
-rw-r--r--app/Schema/Mysql.php17
-rw-r--r--app/Schema/Postgres.php17
-rw-r--r--app/Schema/Sqlite.php17
3 files changed, 48 insertions, 3 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php
index 11c7f232..0da54597 100644
--- a/app/Schema/Mysql.php
+++ b/app/Schema/Mysql.php
@@ -6,7 +6,22 @@ use PDO;
use Kanboard\Core\Security\Token;
use Kanboard\Core\Security\Role;
-const VERSION = 113;
+const VERSION = 114;
+
+function version_114(PDO $pdo)
+{
+ $pdo->exec("
+ CREATE TABLE project_role_has_restrictions (
+ restriction_id INT NOT NULL AUTO_INCREMENT,
+ project_id INT NOT NULL,
+ role_id INT NOT NULL,
+ rule VARCHAR(255) NOT NULL,
+ UNIQUE(role_id, rule),
+ FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,
+ FOREIGN KEY(role_id) REFERENCES project_has_roles(role_id) ON DELETE CASCADE
+ ) ENGINE=InnoDB CHARSET=utf8
+ ");
+}
function version_113(PDO $pdo)
{
diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php
index 2d1695d0..56cd9de9 100644
--- a/app/Schema/Postgres.php
+++ b/app/Schema/Postgres.php
@@ -6,7 +6,22 @@ use PDO;
use Kanboard\Core\Security\Token;
use Kanboard\Core\Security\Role;
-const VERSION = 92;
+const VERSION = 93;
+
+function version_93(PDO $pdo)
+{
+ $pdo->exec("
+ CREATE TABLE project_role_has_restrictions (
+ restriction_id SERIAL PRIMARY KEY,
+ project_id INTEGER NOT NULL,
+ role_id INTEGER NOT NULL,
+ rule VARCHAR(255) NOT NULL,
+ UNIQUE(role_id, rule),
+ FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,
+ FOREIGN KEY(role_id) REFERENCES project_has_roles(role_id) ON DELETE CASCADE
+ )
+ ");
+}
function version_92(PDO $pdo)
{
diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php
index ecfa93de..c952d58f 100644
--- a/app/Schema/Sqlite.php
+++ b/app/Schema/Sqlite.php
@@ -6,7 +6,22 @@ use Kanboard\Core\Security\Token;
use Kanboard\Core\Security\Role;
use PDO;
-const VERSION = 104;
+const VERSION = 105;
+
+function version_105(PDO $pdo)
+{
+ $pdo->exec("
+ CREATE TABLE project_role_has_restrictions (
+ restriction_id INTEGER PRIMARY KEY,
+ project_id INTEGER NOT NULL,
+ role_id INTEGER NOT NULL,
+ rule VARCHAR(255) NOT NULL,
+ UNIQUE(role_id, rule),
+ FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,
+ FOREIGN KEY(role_id) REFERENCES project_has_roles(role_id) ON DELETE CASCADE
+ )
+ ");
+}
function version_104(PDO $pdo)
{