Module project, commit, submission
All checks were successful
Build and Release / release (push) Successful in 1m15s
All checks were successful
Build and Release / release (push) Successful in 1m15s
This commit is contained in:
14
db/migrations/0000012_project_members.up.sql
Normal file
14
db/migrations/0000012_project_members.up.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
CREATE TABLE IF NOT EXISTS project_members (
|
||||
project_id UUID NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
|
||||
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
role SMALLINT NOT NULL DEFAULT 3, -- 1=owner, 2=editor, 3=viewer
|
||||
invited_by UUID REFERENCES users(id) ON DELETE SET NULL,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
PRIMARY KEY (project_id, user_id)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_project_members_user
|
||||
ON project_members (user_id, role);
|
||||
|
||||
CREATE INDEX idx_project_members_project
|
||||
ON project_members (project_id, role);
|
||||
Reference in New Issue
Block a user