Add groups (teams)

This commit is contained in:
Frederic Guillot
2015-11-25 22:06:39 -05:00
parent a8da794b60
commit e582d4047b
21 changed files with 994 additions and 41 deletions

View File

@@ -5,7 +5,28 @@ namespace Schema;
use PDO;
use Kanboard\Core\Security\Token;
const VERSION = 74;
const VERSION = 75;
function version_75(PDO $pdo)
{
$pdo->exec("
CREATE TABLE groups (
id SERIAL PRIMARY KEY,
external_id VARCHAR(255) DEFAULT '',
name VARCHAR(100) NOT NULL UNIQUE
)
");
$pdo->exec("
CREATE TABLE group_has_users (
group_id INTEGER NOT NULL,
user_id INTEGER NOT NULL,
FOREIGN KEY(group_id) REFERENCES groups(id) ON DELETE CASCADE,
FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE,
UNIQUE(group_id, user_id)
)
");
}
function version_74(PDO $pdo)
{