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
+20
View File
@@ -140,6 +140,26 @@ INSERT INTO users_tasks VALUES (3, 5);
TRUNCATE TABLE comments CASCADE;
INSERT INTO comments VALUES (1, 1, 2, 6, 'Needs to be delivered ASAP');
--
-- Data for Name: files; Type: TABLE DATA; Schema: test; Owner: -
--
TRUNCATE TABLE files CASCADE;
INSERT INTO files VALUES
(1, 'command.com', '#include <unix.h>')
,(1, 'autoexec.bat', '@ECHO OFF')
,(1, 'io.sys', 'TODO')
,(2, 'README.md', '# make $$$!')
,(2, 'marketing.key', '$-$')
;
TRUNCATE TABLE touched_files CASCADE;
INSERT INTO touched_files VALUES
(1, 1, 1, 'command.com')
,(1, 1, 1, 'autoexec.bat')
,(1, 1, 2, 'README.md')
,(3, 1, 1, 'autoexec.bat')
;
--
-- Data for Name: complex_items; Type: TABLE DATA; Schema: test; Owner: -
+2
View File
@@ -43,6 +43,8 @@ GRANT ALL ON TABLE
, users
, users_projects
, users_tasks
, files
, touched_files
, "Escap3e;"
, "ghostBusters"
, "withUnique"
+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,