9 lines
No EOL
338 B
SQL
9 lines
No EOL
338 B
SQL
CREATE TABLE IF NOT EXISTS user_roles (
|
|
user_id INTEGER NOT NULL,
|
|
project_id INTEGER NOT NULL,
|
|
p_role TEXT NOT NULL, -- 'admin' or 'member'
|
|
FOREIGN KEY (user_id) REFERENCES users (id)
|
|
FOREIGN KEY (project_id) REFERENCES projects (id)
|
|
FOREIGN KEY (p_role) REFERENCES project_role (p_role)
|
|
PRIMARY KEY (user_id, project_id)
|
|
); |