Removing single column limit from join table M2M mapping detection. (#1593)

This commit is contained in:
Gergely Mészáros
2020-11-17 18:49:02 -05:00
committed by GitHub
parent 6e04fe7454
commit 3f690ec78f
6 changed files with 65 additions and 5 deletions
+22
View File
@@ -697,6 +697,28 @@ alter table only comments
add constraint "user" foreign key (commenter_id) references users(id),
add constraint comments_task_id_fkey foreign key (task_id, user_id) references users_tasks(task_id, user_id);
CREATE TABLE files (
project_id integer NOT NULL,
filename text NOT NULL,
content text NOT NULL,
PRIMARY KEY (project_id, filename)
);
CREATE TABLE touched_files (
user_id integer NOT NULL,
task_id integer NOT NULL,
project_id integer NOT NULL,
filename text NOT NULL,
CONSTRAINT fk_users_tasks
FOREIGN KEY (user_id, task_id)
REFERENCES users_tasks (user_id, task_id)
ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT fk_upload
FOREIGN KEY (project_id, filename)
REFERENCES files (project_id,filename)
ON DELETE CASCADE ON UPDATE CASCADE
);
create table private.articles (
id integer primary key,
body text,