diff options
author | Dzial Techniczny WMW Projekt s.c <techniczna@wmwprojekt.pl> | 2019-12-10 11:34:53 +0100 |
---|---|---|
committer | Dzial Techniczny WMW Projekt s.c <techniczna@wmwprojekt.pl> | 2019-12-10 11:34:53 +0100 |
commit | b8fa0246803dab40cf57d40b45984c53046f2d55 (patch) | |
tree | dc92b167c7542137c385614a1d558e57669a4339 /plugins/Group_assign/Schema | |
parent | 2a43146236fd8fb16f84398d85720ad84aa0a0b1 (diff) |
Plugins directory and local modifications
Diffstat (limited to 'plugins/Group_assign/Schema')
-rw-r--r-- | plugins/Group_assign/Schema/Mysql.php | 34 | ||||
-rw-r--r-- | plugins/Group_assign/Schema/Postgres.php | 34 | ||||
-rw-r--r-- | plugins/Group_assign/Schema/Sqlite.php | 34 |
3 files changed, 102 insertions, 0 deletions
diff --git a/plugins/Group_assign/Schema/Mysql.php b/plugins/Group_assign/Schema/Mysql.php new file mode 100644 index 00000000..17318a29 --- /dev/null +++ b/plugins/Group_assign/Schema/Mysql.php @@ -0,0 +1,34 @@ +<?php + +namespace Kanboard\Plugin\group_assign\Schema; + +use PDO; + +const VERSION = 2; + +function version_2(PDO $pdo) +{ + $pdo->exec("ALTER TABLE `tasks` ADD COLUMN `owner_ms` INT DEFAULT '0'"); + + $pdo->exec(" + CREATE TABLE `multiselect` ( + id INT NOT NULL AUTO_INCREMENT, + external_id VARCHAR(255) DEFAULT '', + PRIMARY KEY(id) + ) ENGINE=InnoDB CHARSET=utf8 + "); + $pdo->exec(" + CREATE TABLE multiselect_has_users ( + group_id INT NOT NULL, + user_id INT NOT NULL, + FOREIGN KEY(group_id) REFERENCES `multiselect`(id) ON DELETE CASCADE, + FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE, + UNIQUE(group_id, user_id) + ) ENGINE=InnoDB CHARSET=utf8 + "); +} + +function version_1(PDO $pdo) +{ + $pdo->exec("ALTER TABLE `tasks` ADD COLUMN `owner_gp` INT DEFAULT '0'"); +} diff --git a/plugins/Group_assign/Schema/Postgres.php b/plugins/Group_assign/Schema/Postgres.php new file mode 100644 index 00000000..54b0a2be --- /dev/null +++ b/plugins/Group_assign/Schema/Postgres.php @@ -0,0 +1,34 @@ +<?php + +namespace Kanboard\Plugin\group_assign\Schema; + +use PDO; + +const VERSION = 2; + +function version_2(PDO $pdo) +{ + $pdo->exec("ALTER TABLE tasks ADD COLUMN owner_ms INT DEFAULT '0'"); + + $pdo->exec(" + CREATE TABLE multiselect ( + id SERIAL PRIMARY KEY, + external_id VARCHAR(255) DEFAULT '' + ) + "); + + $pdo->exec(" + CREATE TABLE multiselect_has_users ( + group_id INTEGER NOT NULL, + user_id INTEGER NOT NULL, + FOREIGN KEY(group_id) REFERENCES multiselect(id) ON DELETE CASCADE, + FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE, + UNIQUE(group_id, user_id) + ) + "); +} + +function version_1(PDO $pdo) +{ + $pdo->exec("ALTER TABLE tasks ADD COLUMN owner_gp INT DEFAULT '0'"); +} diff --git a/plugins/Group_assign/Schema/Sqlite.php b/plugins/Group_assign/Schema/Sqlite.php new file mode 100644 index 00000000..0d5d3e9c --- /dev/null +++ b/plugins/Group_assign/Schema/Sqlite.php @@ -0,0 +1,34 @@ +<?php + +namespace Kanboard\Plugin\group_assign\Schema; + +use PDO; + +const VERSION = 2; + +function version_2(PDO $pdo) +{ + $pdo->exec("ALTER TABLE tasks ADD COLUMN owner_ms INTEGER DEFAULT '0'"); + + $pdo->exec(" + CREATE TABLE multiselect ( + id INTEGER PRIMARY KEY, + external_id TEXT DEFAULT '' + ) + "); + + $pdo->exec(" + CREATE TABLE multiselect_has_users ( + group_id INTEGER NOT NULL, + user_id INTEGER NOT NULL, + FOREIGN KEY(group_id) REFERENCES multiselect(id) ON DELETE CASCADE, + FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE, + UNIQUE(group_id, user_id) + ) + "); +} + +function version_1(PDO $pdo) +{ + $pdo->exec("ALTER TABLE tasks ADD COLUMN owner_gp INTEGER DEFAULT '0'"); +} |