Files
houston-be/db/migration/000016_add_team_user_severities_tables.up.sql
Vijay Joshi 7c1282711b INFRA-2873 : Severity wise team member list - Team Management Module - Add team (#372)
* INFRA-2873 : Boilerplate setup for team management revamp:

* INFRA-2873 : Complete till add team flow

* INFRA-2873 : Added unit tests and migration scripts

* INFRA-2873 : Code review comments

* INFRA-2873 : Add getter for team severity

* INFRA-2873 : Second round of review
2024-02-23 16:05:20 +05:30

21 lines
850 B
SQL

CREATE TABLE IF NOT EXISTS team_user (
id SERIAL PRIMARY KEY,
team_id INTEGER NOT NULL REFERENCES team(id),
user_id INTEGER NOT NULL REFERENCES houston_user(id),
CONSTRAINT team_user_unique_constraint UNIQUE (team_id, user_id)
);
CREATE TABLE IF NOT EXISTS team_severity (
id SERIAL PRIMARY KEY,
team_id INTEGER NOT NULL REFERENCES team(id),
severity_id INTEGER NOT NULL REFERENCES severity(id),
sla INTEGER,
CONSTRAINT team_severity_unique_constraint UNIQUE (team_id, severity_id)
);
CREATE TABLE IF NOT EXISTS team_user_severity (
id SERIAL PRIMARY KEY,
team_user INTEGER NOT NULL REFERENCES team_user(id),
team_severity INTEGER NOT NULL REFERENCES team_severity(id),
CONSTRAINT team_user_severity_unique_constraint UNIQUE (team_user, team_severity)
);