Skip to content

Instantly share code, notes, and snippets.

@Markario
Created November 2, 2021 00:55
Show Gist options
  • Save Markario/4d004c67b9df108f7d72ca5b72472458 to your computer and use it in GitHub Desktop.
Save Markario/4d004c67b9df108f7d72ca5b72472458 to your computer and use it in GitHub Desktop.
Directus issue #9228 column reference id is ambiguous https://github.com/directus/directus/issues/9228

Authorization Bearer customer

GraphQL

query {
  collection1 {
    related {
      name
    }
  }
}

results in

{
  "errors": [
    {
      "message": "select * from (select \"collection2\".\"name\", \"collection2\".\"id\" from \"collection2\" left join \"collection3\" as \"yujfc\" on \"collection2\".\"author\" = \"yujfc\".\"id\" where (\"yujfc\".\"status\" = $1) and \"id\" = $2 limit $3) as \"foo\" - column reference \"id\" is ambiguous",
      "locations": [
        {
          "line": 31,
          "column": 3
        }
      ],
      "path": [
        "collection1"
      ]
    }
  ],
  "data": {
    "collection1": null
  }
}

Where $2 = 51cc0a0a-688e-41d4-80e1-2a8409f19b01 (an id in collection2)

The following works as it bypasses the M2O query.union

query {
  collection1 {
    related(limit: -1) {
      name
    }
  }
}

REST

http://localhost:8055/items/collection1?access_token=customer&fields=related.name

results in error: select * from (select "collection2"."name", "collection2"."id" from "collection2" left join "collection3" as "khdcz" on "collection2"."author" = "khdcz"."id" where ("khdcz"."status" = $1) and "id" = $2 limit $3) as "foo" - column reference "id" is ambiguous

--
-- PostgreSQL database dump
--
-- Dumped from database version 12.7
-- Dumped by pg_dump version 12.1
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: collection1; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.collection1 (
id uuid NOT NULL,
"user" uuid NOT NULL,
related uuid
);
--
-- Name: collection2; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.collection2 (
id uuid NOT NULL,
author uuid NOT NULL,
name character varying(255)
);
--
-- Name: collection3; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.collection3 (
id uuid NOT NULL,
status character varying(255) DEFAULT 'draft'::character varying NOT NULL
);
--
-- Name: directus_activity; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_activity (
id integer NOT NULL,
action character varying(45) NOT NULL,
"user" uuid,
"timestamp" timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
ip character varying(50) NOT NULL,
user_agent character varying(255),
collection character varying(64) NOT NULL,
item character varying(255) NOT NULL,
comment text
);
--
-- Name: directus_activity_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.directus_activity_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: directus_activity_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.directus_activity_id_seq OWNED BY public.directus_activity.id;
--
-- Name: directus_collections; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_collections (
collection character varying(64) NOT NULL,
icon character varying(30),
note text,
display_template character varying(255),
hidden boolean DEFAULT false NOT NULL,
singleton boolean DEFAULT false NOT NULL,
translations json,
archive_field character varying(64),
archive_app_filter boolean DEFAULT true NOT NULL,
archive_value character varying(255),
unarchive_value character varying(255),
sort_field character varying(64),
accountability character varying(255) DEFAULT 'all'::character varying,
color character varying(255),
item_duplication_fields json,
sort integer,
"group" character varying(64),
collapse character varying(255) DEFAULT 'open'::character varying NOT NULL
);
--
-- Name: directus_dashboards; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_dashboards (
id uuid NOT NULL,
name character varying(255) NOT NULL,
icon character varying(30) DEFAULT 'dashboard'::character varying NOT NULL,
note text,
date_created timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
user_created uuid
);
--
-- Name: directus_fields; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_fields (
id integer NOT NULL,
collection character varying(64) NOT NULL,
field character varying(64) NOT NULL,
special character varying(64),
interface character varying(64),
options json,
display character varying(64),
display_options json,
readonly boolean DEFAULT false NOT NULL,
hidden boolean DEFAULT false NOT NULL,
sort integer,
width character varying(30) DEFAULT 'full'::character varying,
translations json,
note text,
conditions json,
required boolean DEFAULT false,
"group" character varying(64)
);
--
-- Name: directus_fields_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.directus_fields_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: directus_fields_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.directus_fields_id_seq OWNED BY public.directus_fields.id;
--
-- Name: directus_files; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_files (
id uuid NOT NULL,
storage character varying(255) NOT NULL,
filename_disk character varying(255),
filename_download character varying(255) NOT NULL,
title character varying(255),
type character varying(255),
folder uuid,
uploaded_by uuid,
uploaded_on timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
modified_by uuid,
modified_on timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
charset character varying(50),
filesize bigint,
width integer,
height integer,
duration integer,
embed character varying(200),
description text,
location text,
tags text,
metadata json
);
--
-- Name: directus_folders; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_folders (
id uuid NOT NULL,
name character varying(255) NOT NULL,
parent uuid
);
--
-- Name: directus_migrations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_migrations (
version character varying(255) NOT NULL,
name character varying(255) NOT NULL,
"timestamp" timestamp with time zone DEFAULT CURRENT_TIMESTAMP
);
--
-- Name: directus_panels; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_panels (
id uuid NOT NULL,
dashboard uuid NOT NULL,
name character varying(255),
icon character varying(30) DEFAULT 'insert_chart'::character varying,
color character varying(10),
show_header boolean DEFAULT false NOT NULL,
note text,
type character varying(255) NOT NULL,
position_x integer NOT NULL,
position_y integer NOT NULL,
width integer NOT NULL,
height integer NOT NULL,
options json,
date_created timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
user_created uuid
);
--
-- Name: directus_permissions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_permissions (
id integer NOT NULL,
role uuid,
collection character varying(64) NOT NULL,
action character varying(10) NOT NULL,
permissions json,
validation json,
presets json,
fields text
);
--
-- Name: directus_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.directus_permissions_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: directus_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.directus_permissions_id_seq OWNED BY public.directus_permissions.id;
--
-- Name: directus_presets; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_presets (
id integer NOT NULL,
bookmark character varying(255),
"user" uuid,
role uuid,
collection character varying(64),
search character varying(100),
layout character varying(100) DEFAULT 'tabular'::character varying,
layout_query json,
layout_options json,
refresh_interval integer,
filter json
);
--
-- Name: directus_presets_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.directus_presets_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: directus_presets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.directus_presets_id_seq OWNED BY public.directus_presets.id;
--
-- Name: directus_relations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_relations (
id integer NOT NULL,
many_collection character varying(64) NOT NULL,
many_field character varying(64) NOT NULL,
one_collection character varying(64),
one_field character varying(64),
one_collection_field character varying(64),
one_allowed_collections text,
junction_field character varying(64),
sort_field character varying(64),
one_deselect_action character varying(255) DEFAULT 'nullify'::character varying NOT NULL
);
--
-- Name: directus_relations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.directus_relations_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: directus_relations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.directus_relations_id_seq OWNED BY public.directus_relations.id;
--
-- Name: directus_revisions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_revisions (
id integer NOT NULL,
activity integer NOT NULL,
collection character varying(64) NOT NULL,
item character varying(255) NOT NULL,
data json,
delta json,
parent integer
);
--
-- Name: directus_revisions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.directus_revisions_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: directus_revisions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.directus_revisions_id_seq OWNED BY public.directus_revisions.id;
--
-- Name: directus_roles; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_roles (
id uuid NOT NULL,
name character varying(100) NOT NULL,
icon character varying(30) DEFAULT 'supervised_user_circle'::character varying NOT NULL,
description text,
ip_access text,
enforce_tfa boolean DEFAULT false NOT NULL,
collection_list json,
admin_access boolean DEFAULT false NOT NULL,
app_access boolean DEFAULT true NOT NULL
);
--
-- Name: directus_sessions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_sessions (
token character varying(64) NOT NULL,
"user" uuid NOT NULL,
expires timestamp with time zone NOT NULL,
ip character varying(255),
user_agent character varying(255),
data json
);
--
-- Name: directus_settings; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_settings (
id integer NOT NULL,
project_name character varying(100) DEFAULT 'Directus'::character varying NOT NULL,
project_url character varying(255),
project_color character varying(10) DEFAULT '#00C897'::character varying,
project_logo uuid,
public_foreground uuid,
public_background uuid,
public_note text,
auth_login_attempts integer DEFAULT 25,
auth_password_policy character varying(100),
storage_asset_transform character varying(7) DEFAULT 'all'::character varying,
storage_asset_presets json,
custom_css text,
storage_default_folder uuid,
basemaps json,
mapbox_key character varying(255),
module_bar json
);
--
-- Name: directus_settings_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.directus_settings_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: directus_settings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.directus_settings_id_seq OWNED BY public.directus_settings.id;
--
-- Name: directus_users; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_users (
id uuid NOT NULL,
first_name character varying(50),
last_name character varying(50),
email character varying(128),
password character varying(255),
location character varying(255),
title character varying(50),
description text,
tags json,
avatar uuid,
language character varying(8) DEFAULT 'en-US'::character varying,
theme character varying(20) DEFAULT 'auto'::character varying,
tfa_secret character varying(255),
status character varying(16) DEFAULT 'active'::character varying NOT NULL,
role uuid,
token character varying(255),
last_access timestamp with time zone,
last_page character varying(255),
provider character varying(128) DEFAULT 'default'::character varying NOT NULL,
external_identifier character varying(255),
auth_data json
);
--
-- Name: directus_webhooks; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.directus_webhooks (
id integer NOT NULL,
name character varying(255) NOT NULL,
method character varying(10) DEFAULT 'POST'::character varying NOT NULL,
url text NOT NULL,
status character varying(10) DEFAULT 'active'::character varying NOT NULL,
data boolean DEFAULT true NOT NULL,
actions character varying(100) NOT NULL,
collections text NOT NULL,
headers json
);
--
-- Name: directus_webhooks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.directus_webhooks_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: directus_webhooks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.directus_webhooks_id_seq OWNED BY public.directus_webhooks.id;
--
-- Name: directus_activity id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_activity ALTER COLUMN id SET DEFAULT nextval('public.directus_activity_id_seq'::regclass);
--
-- Name: directus_fields id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_fields ALTER COLUMN id SET DEFAULT nextval('public.directus_fields_id_seq'::regclass);
--
-- Name: directus_permissions id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_permissions ALTER COLUMN id SET DEFAULT nextval('public.directus_permissions_id_seq'::regclass);
--
-- Name: directus_presets id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_presets ALTER COLUMN id SET DEFAULT nextval('public.directus_presets_id_seq'::regclass);
--
-- Name: directus_relations id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_relations ALTER COLUMN id SET DEFAULT nextval('public.directus_relations_id_seq'::regclass);
--
-- Name: directus_revisions id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_revisions ALTER COLUMN id SET DEFAULT nextval('public.directus_revisions_id_seq'::regclass);
--
-- Name: directus_settings id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_settings ALTER COLUMN id SET DEFAULT nextval('public.directus_settings_id_seq'::regclass);
--
-- Name: directus_webhooks id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_webhooks ALTER COLUMN id SET DEFAULT nextval('public.directus_webhooks_id_seq'::regclass);
--
-- Data for Name: collection1; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.collection1 (id, "user", related) FROM stdin;
4df28925-9be6-4ef4-ba3f-3848ae39615b 4e2f8e1e-fb62-4eee-9058-b1ee8da6f8a4 51cc0a0a-688e-41d4-80e1-2a8409f19b01
\.
--
-- Data for Name: collection2; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.collection2 (id, author, name) FROM stdin;
51cc0a0a-688e-41d4-80e1-2a8409f19b01 f2e401e1-aacc-431c-911d-c6dacb257987 a name
\.
--
-- Data for Name: collection3; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.collection3 (id, status) FROM stdin;
f2e401e1-aacc-431c-911d-c6dacb257987 published
\.
--
-- Data for Name: directus_activity; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_activity (id, action, "user", "timestamp", ip, user_agent, collection, item, comment) FROM stdin;
1 login 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:25:56.070314+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_users 1dff430d-8e90-4636-ad1e-f8b257221d59 \N
2 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:26:16.66442+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_collections collection1 \N
3 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:26:16.66442+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_fields 1 \N
4 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:27:21.169862+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_fields 2 \N
5 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:28:12.301521+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_collections collection2 \N
6 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:28:12.301521+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_fields 3 \N
7 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:28:28.163569+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_collections collection3 \N
8 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:28:28.163569+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_fields 4 \N
9 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:28:28.163569+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_fields 5 \N
10 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:29:10.631892+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_fields 6 \N
11 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:30:00.562745+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_fields 7 \N
12 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:31:26.377886+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_roles 6375c7b6-4010-41d4-ad26-50cd450d7b89 \N
13 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:31:30.771326+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_permissions 1 \N
14 update 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:32:40.215953+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_permissions 1 \N
15 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:32:42.507327+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_permissions 2 \N
16 update 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:32:54.475195+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_permissions 2 \N
17 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:32:56.627983+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_permissions 3 \N
18 update 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:33:07.230057+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_permissions 3 \N
19 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:33:56.511819+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_users 4e2f8e1e-fb62-4eee-9058-b1ee8da6f8a4 \N
20 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:34:40.678848+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 collection3 f2e401e1-aacc-431c-911d-c6dacb257987 \N
21 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:34:40.678848+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 collection2 51cc0a0a-688e-41d4-80e1-2a8409f19b01 \N
22 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:34:40.678848+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 collection1 4df28925-9be6-4ef4-ba3f-3848ae39615b \N
23 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:36:31.095164+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_permissions 4 \N
24 update 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:36:49.180695+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_permissions 4 \N
25 create 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:37:19.657162+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_fields 8 \N
26 update 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:37:29.350937+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 collection2 51cc0a0a-688e-41d4-80e1-2a8409f19b01 \N
27 update 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-02 00:37:42.617632+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 directus_permissions 2 \N
\.
--
-- Data for Name: directus_collections; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_collections (collection, icon, note, display_template, hidden, singleton, translations, archive_field, archive_app_filter, archive_value, unarchive_value, sort_field, accountability, color, item_duplication_fields, sort, "group", collapse) FROM stdin;
collection1 \N \N \N f f \N \N t \N \N \N all \N \N \N \N open
collection2 \N \N \N f f \N \N t \N \N \N all \N \N \N \N open
collection3 \N \N \N f f \N status t archived draft \N all \N \N \N \N open
\.
--
-- Data for Name: directus_dashboards; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_dashboards (id, name, icon, note, date_created, user_created) FROM stdin;
\.
--
-- Data for Name: directus_fields; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_fields (id, collection, field, special, interface, options, display, display_options, readonly, hidden, sort, width, translations, note, conditions, required, "group") FROM stdin;
1 collection1 id uuid input \N \N \N t t \N full \N \N \N f \N
2 collection1 user m2o select-dropdown-m2o \N \N \N f f \N full \N \N \N t \N
3 collection2 id uuid input \N \N \N t t \N full \N \N \N f \N
4 collection3 id uuid input \N \N \N t t \N full \N \N \N f \N
5 collection3 status \N select-dropdown {"choices":[{"text":"$t:published","value":"published"},{"text":"$t:draft","value":"draft"},{"text":"$t:archived","value":"archived"}]} labels {"showAsDot":true,"choices":[{"background":"#00C897","value":"published"},{"background":"#D3DAE4","value":"draft"},{"background":"#F7971C","value":"archived"}]} f f \N full \N \N \N f \N
6 collection2 author m2o select-dropdown-m2o \N related-values \N f f \N full \N \N \N t \N
7 collection1 related m2o select-dropdown-m2o \N \N \N f f \N full \N \N \N f \N
8 collection2 name \N input \N \N \N f f \N full \N \N \N f \N
\.
--
-- Data for Name: directus_files; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_files (id, storage, filename_disk, filename_download, title, type, folder, uploaded_by, uploaded_on, modified_by, modified_on, charset, filesize, width, height, duration, embed, description, location, tags, metadata) FROM stdin;
\.
--
-- Data for Name: directus_folders; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_folders (id, name, parent) FROM stdin;
\.
--
-- Data for Name: directus_migrations; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_migrations (version, name, "timestamp") FROM stdin;
20201028A Remove Collection Foreign Keys 2021-11-02 00:25:04.386336+00
20201029A Remove System Relations 2021-11-02 00:25:04.482465+00
20201029B Remove System Collections 2021-11-02 00:25:04.578798+00
20201029C Remove System Fields 2021-11-02 00:25:04.679706+00
20201105A Add Cascade System Relations 2021-11-02 00:25:06.169655+00
20201105B Change Webhook URL Type 2021-11-02 00:25:06.382662+00
20210225A Add Relations Sort Field 2021-11-02 00:25:06.526805+00
20210304A Remove Locked Fields 2021-11-02 00:25:06.624405+00
20210312A Webhooks Collections Text 2021-11-02 00:25:06.818096+00
20210331A Add Refresh Interval 2021-11-02 00:25:06.914427+00
20210415A Make Filesize Nullable 2021-11-02 00:25:07.152499+00
20210416A Add Collections Accountability 2021-11-02 00:25:07.29617+00
20210422A Remove Files Interface 2021-11-02 00:25:07.392606+00
20210506A Rename Interfaces 2021-11-02 00:25:09.302345+00
20210510A Restructure Relations 2021-11-02 00:25:09.883492+00
20210518A Add Foreign Key Constraints 2021-11-02 00:25:10.03658+00
20210519A Add System Fk Triggers 2021-11-02 00:25:10.808795+00
20210521A Add Collections Icon Color 2021-11-02 00:25:10.903769+00
20210525A Add Insights 2021-11-02 00:25:11.302717+00
20210608A Add Deep Clone Config 2021-11-02 00:25:11.399976+00
20210626A Change Filesize Bigint 2021-11-02 00:25:11.648065+00
20210716A Add Conditions to Fields 2021-11-02 00:25:11.74528+00
20210721A Add Default Folder 2021-11-02 00:25:11.891171+00
20210802A Replace Groups 2021-11-02 00:25:12.037897+00
20210803A Add Required to Fields 2021-11-02 00:25:12.135109+00
20210805A Update Groups 2021-11-02 00:25:12.231603+00
20210805B Change Image Metadata Structure 2021-11-02 00:25:12.327298+00
20210811A Add Geometry Config 2021-11-02 00:25:12.424146+00
20210831A Remove Limit Column 2021-11-02 00:25:12.522112+00
20210903A Add Auth Provider 2021-11-02 00:25:12.963389+00
20210907A Webhooks Collections Not Null 2021-11-02 00:25:13.204074+00
20210910A Move Module Setup 2021-11-02 00:25:13.347713+00
20210920A Webhooks URL Not Null 2021-11-02 00:25:13.588995+00
20210924A Add Collection Organization 2021-11-02 00:25:13.733888+00
20210927A Replace Fields Group 2021-11-02 00:25:14.022653+00
20210927B Replace M2M Interface 2021-11-02 00:25:14.117626+00
20210929A Rename Login Action 2021-11-02 00:25:14.213651+00
20211007A Update Presets 2021-11-02 00:25:14.406504+00
20211009A Add Auth Data 2021-11-02 00:25:14.504348+00
20211016A Add Webhook Headers 2021-11-02 00:25:14.600975+00
\.
--
-- Data for Name: directus_panels; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_panels (id, dashboard, name, icon, color, show_header, note, type, position_x, position_y, width, height, options, date_created, user_created) FROM stdin;
\.
--
-- Data for Name: directus_permissions; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_permissions (id, role, collection, action, permissions, validation, presets, fields) FROM stdin;
1 6375c7b6-4010-41d4-ad26-50cd450d7b89 collection1 read {"user":{"id":{"_eq":"$CURRENT_USER"}}} \N \N id,user,related
3 6375c7b6-4010-41d4-ad26-50cd450d7b89 collection3 read {"status":{"_eq":"published"}} \N \N id
4 6375c7b6-4010-41d4-ad26-50cd450d7b89 directus_users read {"id":{"_eq":"$CURRENT_USER"}} \N \N email,id
2 6375c7b6-4010-41d4-ad26-50cd450d7b89 collection2 read {"author":{"status":{"_eq":"published"}}} \N \N id,author,name
\.
--
-- Data for Name: directus_presets; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_presets (id, bookmark, "user", role, collection, search, layout, layout_query, layout_options, refresh_interval, filter) FROM stdin;
1 \N 1dff430d-8e90-4636-ad1e-f8b257221d59 \N directus_users \N cards {"cards":{"sort":["email"],"page":1}} {"cards":{"icon":"account_circle","title":"{{ first_name }} {{ last_name }}","subtitle":"{{ email }}","size":4}} \N \N
3 \N 1dff430d-8e90-4636-ad1e-f8b257221d59 \N collection2 \N tabular {"tabular":{"page":1}} \N \N \N
2 \N 1dff430d-8e90-4636-ad1e-f8b257221d59 \N collection1 \N tabular {"tabular":{"page":1}} \N \N \N
\.
--
-- Data for Name: directus_relations; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_relations (id, many_collection, many_field, one_collection, one_field, one_collection_field, one_allowed_collections, junction_field, sort_field, one_deselect_action) FROM stdin;
1 collection1 user directus_users \N \N \N \N \N nullify
2 collection2 author collection3 \N \N \N \N \N nullify
3 collection1 related collection2 \N \N \N \N \N nullify
\.
--
-- Data for Name: directus_revisions; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_revisions (id, activity, collection, item, data, delta, parent) FROM stdin;
1 2 directus_collections collection1 {"singleton":false,"collection":"collection1"} {"singleton":false,"collection":"collection1"} \N
2 3 directus_fields 1 {"hidden":true,"readonly":true,"interface":"input","special":"uuid","field":"id","collection":"collection1"} {"hidden":true,"readonly":true,"interface":"input","special":"uuid","field":"id","collection":"collection1"} \N
3 4 directus_fields 2 {"interface":"select-dropdown-m2o","special":"m2o","required":true,"collection":"collection1","field":"user"} {"interface":"select-dropdown-m2o","special":"m2o","required":true,"collection":"collection1","field":"user"} \N
4 5 directus_collections collection2 {"singleton":false,"collection":"collection2"} {"singleton":false,"collection":"collection2"} \N
5 6 directus_fields 3 {"hidden":true,"readonly":true,"interface":"input","special":"uuid","field":"id","collection":"collection2"} {"hidden":true,"readonly":true,"interface":"input","special":"uuid","field":"id","collection":"collection2"} \N
6 7 directus_collections collection3 {"archive_field":"status","archive_value":"archived","unarchive_value":"draft","singleton":false,"collection":"collection3"} {"archive_field":"status","archive_value":"archived","unarchive_value":"draft","singleton":false,"collection":"collection3"} \N
7 8 directus_fields 4 {"hidden":true,"readonly":true,"interface":"input","special":"uuid","field":"id","collection":"collection3"} {"hidden":true,"readonly":true,"interface":"input","special":"uuid","field":"id","collection":"collection3"} \N
8 9 directus_fields 5 {"width":"full","options":{"choices":[{"text":"$t:published","value":"published"},{"text":"$t:draft","value":"draft"},{"text":"$t:archived","value":"archived"}]},"interface":"select-dropdown","display":"labels","display_options":{"showAsDot":true,"choices":[{"background":"#00C897","value":"published"},{"background":"#D3DAE4","value":"draft"},{"background":"#F7971C","value":"archived"}]},"field":"status","collection":"collection3"} {"width":"full","options":{"choices":[{"text":"$t:published","value":"published"},{"text":"$t:draft","value":"draft"},{"text":"$t:archived","value":"archived"}]},"interface":"select-dropdown","display":"labels","display_options":{"showAsDot":true,"choices":[{"background":"#00C897","value":"published"},{"background":"#D3DAE4","value":"draft"},{"background":"#F7971C","value":"archived"}]},"field":"status","collection":"collection3"} \N
9 10 directus_fields 6 {"interface":"select-dropdown-m2o","special":"m2o","required":true,"display":"related-values","collection":"collection2","field":"author"} {"interface":"select-dropdown-m2o","special":"m2o","required":true,"display":"related-values","collection":"collection2","field":"author"} \N
10 11 directus_fields 7 {"interface":"select-dropdown-m2o","special":"m2o","collection":"collection1","field":"related"} {"interface":"select-dropdown-m2o","special":"m2o","collection":"collection1","field":"related"} \N
11 12 directus_roles 6375c7b6-4010-41d4-ad26-50cd450d7b89 {"name":"Customer","admin_access":false,"app_access":false} {"name":"Customer","admin_access":false,"app_access":false} \N
12 13 directus_permissions 1 {"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"collection1","action":"read"} {"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"collection1","action":"read"} \N
13 14 directus_permissions 1 {"id":1,"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"collection1","action":"read","permissions":{"user":{"id":{"_eq":"$CURRENT_USER"}}},"validation":null,"presets":null,"fields":["id","user","related"]} {"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"collection1","action":"read","permissions":{"user":{"id":{"_eq":"$CURRENT_USER"}}},"validation":null,"presets":null,"fields":["id","user","related"]} \N
14 15 directus_permissions 2 {"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"collection2","action":"read"} {"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"collection2","action":"read"} \N
15 16 directus_permissions 2 {"id":2,"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"collection2","action":"read","permissions":{"author":{"status":{"_eq":"published"}}},"validation":null,"presets":null,"fields":["id","author"]} {"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"collection2","action":"read","permissions":{"author":{"status":{"_eq":"published"}}},"validation":null,"presets":null,"fields":["id","author"]} \N
16 17 directus_permissions 3 {"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"collection3","action":"read"} {"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"collection3","action":"read"} \N
17 18 directus_permissions 3 {"id":3,"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"collection3","action":"read","permissions":{"status":{"_eq":"published"}},"validation":null,"presets":null,"fields":["id"]} {"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"collection3","action":"read","permissions":{"status":{"_eq":"published"}},"validation":null,"presets":null,"fields":["id"]} \N
18 19 directus_users 4e2f8e1e-fb62-4eee-9058-b1ee8da6f8a4 {"first_name":"Customer","last_name":"One","email":"customer@example.com","password":"**********","role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","token":"customer"} {"first_name":"Customer","last_name":"One","email":"customer@example.com","password":"**********","role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","token":"customer"} \N
19 20 collection3 f2e401e1-aacc-431c-911d-c6dacb257987 {"status":"published"} {"status":"published"} 20
21 22 collection1 4df28925-9be6-4ef4-ba3f-3848ae39615b {"user":"4e2f8e1e-fb62-4eee-9058-b1ee8da6f8a4","related":{"author":{"status":"published"}}} {"user":"4e2f8e1e-fb62-4eee-9058-b1ee8da6f8a4","related":{"author":{"status":"published"}}} \N
20 21 collection2 51cc0a0a-688e-41d4-80e1-2a8409f19b01 {"author":{"status":"published"}} {"author":{"status":"published"}} 21
22 23 directus_permissions 4 {"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"directus_users","action":"read"} {"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"directus_users","action":"read"} \N
23 24 directus_permissions 4 {"id":4,"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"directus_users","action":"read","permissions":{"id":{"_eq":"$CURRENT_USER"}},"validation":null,"presets":null,"fields":["email","id"]} {"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"directus_users","action":"read","permissions":{"id":{"_eq":"$CURRENT_USER"}},"validation":null,"presets":null,"fields":["email","id"]} \N
24 25 directus_fields 8 {"interface":"input","special":null,"collection":"collection2","field":"name"} {"interface":"input","special":null,"collection":"collection2","field":"name"} \N
25 26 collection2 51cc0a0a-688e-41d4-80e1-2a8409f19b01 {"id":"51cc0a0a-688e-41d4-80e1-2a8409f19b01","author":"f2e401e1-aacc-431c-911d-c6dacb257987","name":"a name"} {"name":"a name"} \N
26 27 directus_permissions 2 {"id":2,"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"collection2","action":"read","permissions":{"author":{"status":{"_eq":"published"}}},"validation":null,"presets":null,"fields":["id","author","name"]} {"role":"6375c7b6-4010-41d4-ad26-50cd450d7b89","collection":"collection2","action":"read","permissions":{"author":{"status":{"_eq":"published"}}},"validation":null,"presets":null,"fields":["id","author","name"]} \N
\.
--
-- Data for Name: directus_roles; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_roles (id, name, icon, description, ip_access, enforce_tfa, collection_list, admin_access, app_access) FROM stdin;
b182c578-dd5b-4c58-bb32-4397d00167d8 Admin supervised_user_circle \N \N f \N t t
6375c7b6-4010-41d4-ad26-50cd450d7b89 Customer supervised_user_circle \N \N f \N f f
\.
--
-- Data for Name: directus_sessions; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_sessions (token, "user", expires, ip, user_agent, data) FROM stdin;
6o59QXt-GiljKJR3F1Ek_s88qf-nT2zoYyvheJYJkAbkahf0hZLvRT74O3wKqNgC 1dff430d-8e90-4636-ad1e-f8b257221d59 2021-11-09 00:32:26.033+00 ::1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 \N
\.
--
-- Data for Name: directus_settings; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_settings (id, project_name, project_url, project_color, project_logo, public_foreground, public_background, public_note, auth_login_attempts, auth_password_policy, storage_asset_transform, storage_asset_presets, custom_css, storage_default_folder, basemaps, mapbox_key, module_bar) FROM stdin;
\.
--
-- Data for Name: directus_users; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_users (id, first_name, last_name, email, password, location, title, description, tags, avatar, language, theme, tfa_secret, status, role, token, last_access, last_page, provider, external_identifier, auth_data) FROM stdin;
1dff430d-8e90-4636-ad1e-f8b257221d59 \N \N admin@example.com $argon2i$v=19$m=4096,t=3,p=1$ec6uDs56J7h4Clyix3scHQ$MwW7O1EamgZqDPkTJ/D51DzNZSeIg0ojzH1DRGE2u6I \N \N \N \N \N en-US auto \N active b182c578-dd5b-4c58-bb32-4397d00167d8 \N 2021-11-02 00:32:26.082+00 /collections/collection1 default \N \N
4e2f8e1e-fb62-4eee-9058-b1ee8da6f8a4 Customer One customer@example.com $argon2i$v=19$m=4096,t=3,p=1$6BNVq9D7RgWgFcISVib8Pw$UjQryh4dSDb2pXGBdsBCCkF8QIw79p4ncOF0iyNuigQ \N \N \N \N \N en-US auto \N active 6375c7b6-4010-41d4-ad26-50cd450d7b89 customer \N \N default \N \N
\.
--
-- Data for Name: directus_webhooks; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.directus_webhooks (id, name, method, url, status, data, actions, collections, headers) FROM stdin;
\.
--
-- Name: directus_activity_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('public.directus_activity_id_seq', 27, true);
--
-- Name: directus_fields_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('public.directus_fields_id_seq', 8, true);
--
-- Name: directus_permissions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('public.directus_permissions_id_seq', 4, true);
--
-- Name: directus_presets_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('public.directus_presets_id_seq', 3, true);
--
-- Name: directus_relations_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('public.directus_relations_id_seq', 3, true);
--
-- Name: directus_revisions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('public.directus_revisions_id_seq', 26, true);
--
-- Name: directus_settings_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('public.directus_settings_id_seq', 1, false);
--
-- Name: directus_webhooks_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('public.directus_webhooks_id_seq', 1, false);
--
-- Name: collection1 collection1_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.collection1
ADD CONSTRAINT collection1_pkey PRIMARY KEY (id);
--
-- Name: collection2 collection2_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.collection2
ADD CONSTRAINT collection2_pkey PRIMARY KEY (id);
--
-- Name: collection3 collection3_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.collection3
ADD CONSTRAINT collection3_pkey PRIMARY KEY (id);
--
-- Name: directus_activity directus_activity_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_activity
ADD CONSTRAINT directus_activity_pkey PRIMARY KEY (id);
--
-- Name: directus_collections directus_collections_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_collections
ADD CONSTRAINT directus_collections_pkey PRIMARY KEY (collection);
--
-- Name: directus_dashboards directus_dashboards_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_dashboards
ADD CONSTRAINT directus_dashboards_pkey PRIMARY KEY (id);
--
-- Name: directus_fields directus_fields_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_fields
ADD CONSTRAINT directus_fields_pkey PRIMARY KEY (id);
--
-- Name: directus_files directus_files_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_files
ADD CONSTRAINT directus_files_pkey PRIMARY KEY (id);
--
-- Name: directus_folders directus_folders_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_folders
ADD CONSTRAINT directus_folders_pkey PRIMARY KEY (id);
--
-- Name: directus_migrations directus_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_migrations
ADD CONSTRAINT directus_migrations_pkey PRIMARY KEY (version);
--
-- Name: directus_panels directus_panels_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_panels
ADD CONSTRAINT directus_panels_pkey PRIMARY KEY (id);
--
-- Name: directus_permissions directus_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_permissions
ADD CONSTRAINT directus_permissions_pkey PRIMARY KEY (id);
--
-- Name: directus_presets directus_presets_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_presets
ADD CONSTRAINT directus_presets_pkey PRIMARY KEY (id);
--
-- Name: directus_relations directus_relations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_relations
ADD CONSTRAINT directus_relations_pkey PRIMARY KEY (id);
--
-- Name: directus_revisions directus_revisions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_revisions
ADD CONSTRAINT directus_revisions_pkey PRIMARY KEY (id);
--
-- Name: directus_roles directus_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_roles
ADD CONSTRAINT directus_roles_pkey PRIMARY KEY (id);
--
-- Name: directus_sessions directus_sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_sessions
ADD CONSTRAINT directus_sessions_pkey PRIMARY KEY (token);
--
-- Name: directus_settings directus_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_settings
ADD CONSTRAINT directus_settings_pkey PRIMARY KEY (id);
--
-- Name: directus_users directus_users_email_unique; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_users
ADD CONSTRAINT directus_users_email_unique UNIQUE (email);
--
-- Name: directus_users directus_users_external_identifier_unique; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_users
ADD CONSTRAINT directus_users_external_identifier_unique UNIQUE (external_identifier);
--
-- Name: directus_users directus_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_users
ADD CONSTRAINT directus_users_pkey PRIMARY KEY (id);
--
-- Name: directus_webhooks directus_webhooks_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_webhooks
ADD CONSTRAINT directus_webhooks_pkey PRIMARY KEY (id);
--
-- Name: collection1 collection1_related_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.collection1
ADD CONSTRAINT collection1_related_foreign FOREIGN KEY (related) REFERENCES public.collection2(id) ON DELETE SET NULL;
--
-- Name: collection1 collection1_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.collection1
ADD CONSTRAINT collection1_user_foreign FOREIGN KEY ("user") REFERENCES public.directus_users(id) ON DELETE CASCADE;
--
-- Name: collection2 collection2_author_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.collection2
ADD CONSTRAINT collection2_author_foreign FOREIGN KEY (author) REFERENCES public.collection3(id) ON DELETE SET NULL;
--
-- Name: directus_collections directus_collections_group_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_collections
ADD CONSTRAINT directus_collections_group_foreign FOREIGN KEY ("group") REFERENCES public.directus_collections(collection);
--
-- Name: directus_dashboards directus_dashboards_user_created_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_dashboards
ADD CONSTRAINT directus_dashboards_user_created_foreign FOREIGN KEY (user_created) REFERENCES public.directus_users(id) ON DELETE SET NULL;
--
-- Name: directus_files directus_files_folder_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_files
ADD CONSTRAINT directus_files_folder_foreign FOREIGN KEY (folder) REFERENCES public.directus_folders(id) ON DELETE SET NULL;
--
-- Name: directus_files directus_files_modified_by_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_files
ADD CONSTRAINT directus_files_modified_by_foreign FOREIGN KEY (modified_by) REFERENCES public.directus_users(id);
--
-- Name: directus_files directus_files_uploaded_by_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_files
ADD CONSTRAINT directus_files_uploaded_by_foreign FOREIGN KEY (uploaded_by) REFERENCES public.directus_users(id);
--
-- Name: directus_folders directus_folders_parent_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_folders
ADD CONSTRAINT directus_folders_parent_foreign FOREIGN KEY (parent) REFERENCES public.directus_folders(id);
--
-- Name: directus_panels directus_panels_dashboard_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_panels
ADD CONSTRAINT directus_panels_dashboard_foreign FOREIGN KEY (dashboard) REFERENCES public.directus_dashboards(id) ON DELETE CASCADE;
--
-- Name: directus_panels directus_panels_user_created_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_panels
ADD CONSTRAINT directus_panels_user_created_foreign FOREIGN KEY (user_created) REFERENCES public.directus_users(id) ON DELETE SET NULL;
--
-- Name: directus_permissions directus_permissions_role_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_permissions
ADD CONSTRAINT directus_permissions_role_foreign FOREIGN KEY (role) REFERENCES public.directus_roles(id) ON DELETE CASCADE;
--
-- Name: directus_presets directus_presets_role_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_presets
ADD CONSTRAINT directus_presets_role_foreign FOREIGN KEY (role) REFERENCES public.directus_roles(id) ON DELETE CASCADE;
--
-- Name: directus_presets directus_presets_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_presets
ADD CONSTRAINT directus_presets_user_foreign FOREIGN KEY ("user") REFERENCES public.directus_users(id) ON DELETE CASCADE;
--
-- Name: directus_revisions directus_revisions_activity_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_revisions
ADD CONSTRAINT directus_revisions_activity_foreign FOREIGN KEY (activity) REFERENCES public.directus_activity(id) ON DELETE CASCADE;
--
-- Name: directus_revisions directus_revisions_parent_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_revisions
ADD CONSTRAINT directus_revisions_parent_foreign FOREIGN KEY (parent) REFERENCES public.directus_revisions(id);
--
-- Name: directus_sessions directus_sessions_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_sessions
ADD CONSTRAINT directus_sessions_user_foreign FOREIGN KEY ("user") REFERENCES public.directus_users(id) ON DELETE CASCADE;
--
-- Name: directus_settings directus_settings_project_logo_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_settings
ADD CONSTRAINT directus_settings_project_logo_foreign FOREIGN KEY (project_logo) REFERENCES public.directus_files(id);
--
-- Name: directus_settings directus_settings_public_background_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_settings
ADD CONSTRAINT directus_settings_public_background_foreign FOREIGN KEY (public_background) REFERENCES public.directus_files(id);
--
-- Name: directus_settings directus_settings_public_foreground_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_settings
ADD CONSTRAINT directus_settings_public_foreground_foreign FOREIGN KEY (public_foreground) REFERENCES public.directus_files(id);
--
-- Name: directus_settings directus_settings_storage_default_folder_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_settings
ADD CONSTRAINT directus_settings_storage_default_folder_foreign FOREIGN KEY (storage_default_folder) REFERENCES public.directus_folders(id) ON DELETE SET NULL;
--
-- Name: directus_users directus_users_role_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.directus_users
ADD CONSTRAINT directus_users_role_foreign FOREIGN KEY (role) REFERENCES public.directus_roles(id) ON DELETE SET NULL;
--
-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: -
--
REVOKE ALL ON SCHEMA public FROM rdsadmin;
REVOKE ALL ON SCHEMA public FROM PUBLIC;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
--
-- PostgreSQL database dump complete
--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment