Added ChangeUserRole and corresponding test, also GetProjectId should be fixed.
This commit is contained in:
parent
3a7663124d
commit
f0745c5a75
4 changed files with 57 additions and 7 deletions
|
@ -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');
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue