Added ChangeUserRole and corresponding test, also GetProjectId should be fixed.

This commit is contained in:
dDogge 2024-03-14 13:27:57 +01:00
parent 3a7663124d
commit f0745c5a75
4 changed files with 57 additions and 7 deletions

View file

@ -5,5 +5,5 @@ CREATE TABLE IF NOT EXISTS project_role (
);
-- Insert the possible roles a user can have in a project.
INSERT OR IGNORE INTO project_role (p_role) VALUES ('admin');
INSERT OR IGNORE INTO project_role (p_role) VALUES ('project_manager');
INSERT OR IGNORE INTO project_role (p_role) VALUES ('member');

View file

@ -1,7 +1,7 @@
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'
p_role TEXT NOT NULL, -- 'project_manager' 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)