changed from json projects to m:n

This commit is contained in:
2022-02-14 22:19:44 +01:00
parent e69073ecad
commit 66f9df86d8
6 changed files with 117 additions and 43 deletions

View File

@@ -2,13 +2,22 @@
create table sctl_project
(
id int GENERATED BY DEFAULT AS IDENTITY primary key,
data jsonb NOT NULL
id int GENERATED BY DEFAULT AS IDENTITY primary key,
name varchar(30) not null
);
create table sctl_project_member
(
project_id int REFERENCES sctl_project (id) ON UPDATE CASCADE ON DELETE CASCADE,
member_id int REFERENCES sctl_user (id) ON UPDATE CASCADE,
role varchar(20) not null,
CONSTRAINT project_member_pkey PRIMARY KEY (project_id, member_id)
);
---- create above / drop below ----
drop table sctl_project;
drop table sctl_project_member;
-- Write your migrate down statements here. If this migration is irreversible
-- Then delete the separator line above.