summaryrefslogtreecommitdiff
path: root/app/Schema/Sqlite.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-09-11 16:08:03 -0400
committerFrederic Guillot <fred@kanboard.net>2016-09-11 16:08:03 -0400
commitd8f6d8568396816a6bfaca1e01211384e803cf91 (patch)
tree16d735faa3f6f9aafb6c78650470e77347cae1ab /app/Schema/Sqlite.php
parenta0227cad69aff9486fba1d7b2a19e6da97450100 (diff)
Add project restrictions for custom roles
Diffstat (limited to 'app/Schema/Sqlite.php')
-rw-r--r--app/Schema/Sqlite.php17
1 files changed, 16 insertions, 1 deletions
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)
{