Merge @ruslantalpa's fk improved detection
This commit is contained in:
Vendored
+19
-9
@@ -594,6 +594,15 @@ CREATE TABLE simple_pk (
|
||||
extra character varying NOT NULL
|
||||
);
|
||||
|
||||
--
|
||||
-- Name: users_projects; Type: TABLE; Schema: test; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE users_projects (
|
||||
user_id integer NOT NULL,
|
||||
project_id integer NOT NULL
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: tasks; Type: TABLE; Schema: test; Owner: -
|
||||
@@ -605,6 +614,16 @@ CREATE TABLE tasks (
|
||||
project_id integer
|
||||
);
|
||||
|
||||
CREATE OR REPLACE VIEW filtered_tasks AS
|
||||
SELECT id AS "myId", name, project_id AS "projectID"
|
||||
FROM tasks
|
||||
WHERE project_id IN (
|
||||
SELECT id FROM projects WHERE id = 1
|
||||
) AND
|
||||
project_id IN (
|
||||
SELECT project_id FROM users_projects WHERE user_id = 1
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: tsearch; Type: TABLE; Schema: test; Owner: -
|
||||
@@ -625,15 +644,6 @@ CREATE TABLE users (
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: users_projects; Type: TABLE; Schema: test; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE users_projects (
|
||||
user_id integer NOT NULL,
|
||||
project_id integer NOT NULL
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: users_tasks; Type: TABLE; Schema: test; Owner: -
|
||||
|
||||
Reference in New Issue
Block a user