--
-- PostgreSQL database dump
--

-- Dumped from database version 15.2
-- Dumped by pg_dump version 16.1


\set ON_ERROR_STOP true

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', 'public', 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;

CREATE EXTENSION "uuid-ossp";

CREATE TYPE roles AS ENUM (
    'Owner',
    'Admin',
    'Member',
    'Guest'
);

CREATE TYPE project_member_roles AS ENUM (
    'Admin',
    'Member',
    'Viewer',
    'Guest'
);

CREATE TABLE users (
    password character varying(128) NOT NULL,
    last_login timestamp with time zone,
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    username character varying(128) NOT NULL,
    mobile_number character varying(255),
    email character varying(255),
    first_name character varying(255) NOT NULL,
    last_name character varying(255) NOT NULL,
    avatar character varying(255) NOT NULL,
    date_joined timestamp with time zone NOT NULL DEFAULT now(),
    created_at timestamp with time zone NOT NULL DEFAULT now(),
    updated_at timestamp with time zone NOT NULL DEFAULT now(),
    last_location character varying(255) NOT NULL,
    created_location character varying(255) NOT NULL,
    is_superuser boolean NOT NULL DEFAULT false,
    is_managed boolean NOT NULL DEFAULT false,
    is_password_expired boolean NOT NULL DEFAULT false,
    is_active boolean NOT NULL DEFAULT true,
    is_staff boolean NOT NULL DEFAULT false,
    is_email_verified boolean NOT NULL DEFAULT false,
    is_password_autoset boolean NOT NULL,
    is_onboarded boolean NOT NULL DEFAULT false,
    token character varying(64) NOT NULL,
    billing_address_country character varying(255) NOT NULL,
    billing_address jsonb,
    has_billing_address boolean NOT NULL DEFAULT false,
    user_timezone character varying(255) NOT NULL DEFAULT 'UTC',
    last_active timestamp with time zone,
    last_login_time timestamp with time zone,
    last_logout_time timestamp with time zone,
    last_login_ip character varying(255) NOT NULL,
    last_logout_ip character varying(255) NOT NULL,
    last_login_medium character varying(20) NOT NULL,
    last_login_uagent text NOT NULL,
    token_updated_at timestamp with time zone,
    last_workspace_id uuid,
    my_issues_prop jsonb,
    role character varying(300),
    is_bot boolean NOT NULL DEFAULT false,
    theme jsonb NOT NULL DEFAULT '{}'::jsonb,
    is_tour_completed boolean NOT NULL DEFAULT false,
    onboarding_step jsonb NOT NULL DEFAULT '[]'::jsonb,
    cover_image character varying(800),
    display_name character varying(255) NOT NULL,
    use_case text
);

CREATE TABLE workspaces (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(80) NOT NULL,
    logo character varying(200),
    slug character varying(48) NOT NULL,
    created_by_id uuid,
    owner_id uuid NOT NULL REFERENCES users (id),
    updated_by_id uuid,
    organization_size character varying(20)
);

--
-- Name: projects; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE projects (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(255) NOT NULL,
    description text NOT NULL,
    description_text jsonb,
    description_html jsonb,
    network smallint NOT NULL,
    identifier character varying(12) NOT NULL,
    created_by_id uuid,
    default_assignee_id uuid,
    project_lead_id uuid,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    emoji character varying(255),
    cycle_view boolean NOT NULL,
    module_view boolean NOT NULL,
    cover_image character varying(800),
    issue_views_view boolean NOT NULL,
    page_view boolean NOT NULL,
    estimate_id uuid,
    icon_prop jsonb,
    inbox_view boolean NOT NULL,
    archive_in integer NOT NULL,
    close_in integer NOT NULL,
    default_state_id uuid,
    CONSTRAINT project_network_check CHECK ((network >= 0))
);

--
-- Name: modules; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE modules (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(255) NOT NULL,
    description text NOT NULL,
    description_text jsonb,
    description_html jsonb,
    start_date date,
    target_date date,
    status character varying(20) NOT NULL,
    created_by_id uuid,
    lead_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    view_props jsonb NOT NULL,
    sort_order double precision NOT NULL,
    external_id character varying(255),
    external_source character varying(255)
);

--
-- Name: pages; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE pages (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(255) NOT NULL,
    description jsonb NOT NULL,
    description_html text NOT NULL,
    description_stripped text,
    access smallint NOT NULL,
    created_by_id uuid,
    owned_by_id uuid NOT NULL,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    color character varying(255) NOT NULL,
    archived_at date,
    is_locked boolean NOT NULL DEFAULT false,
    parent_id uuid,
    CONSTRAINT pages_access_check CHECK ((access >= 0))
);

--
-- Name: states; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE states (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(255) NOT NULL,
    description text NOT NULL,
    color character varying(255) NOT NULL,
    slug character varying(100) NOT NULL,
    created_by_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    sequence double precision NOT NULL,
    "group" character varying(20) NOT NULL,
    "default" boolean NOT NULL,
    external_id character varying(255),
    external_source character varying(255)
);

--
-- Name: issues; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE issues (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(255) NOT NULL,
    description jsonb NOT NULL,
    priority character varying(30) NOT NULL,
    start_date date,
    target_date date,
    sequence_id integer NOT NULL,
    created_by_id uuid,
    parent_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    state_id uuid,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    description_html text NOT NULL,
    description_stripped text,
    completed_at timestamp with time zone,
    sort_order double precision NOT NULL,
    estimate_point integer,
    archived_at date,
    is_draft boolean NOT NULL,
    external_id character varying(255),
    external_source character varying(255),
    CONSTRAINT parent_fk FOREIGN KEY (parent_id) REFERENCES issues (id),
    CONSTRAINT state_fk FOREIGN KEY (state_id) REFERENCES states (id)
);

--
-- Name: issue_comments; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE issue_comments (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    comment_stripped text NOT NULL,
    attachments character varying(200)[] NOT NULL,
    created_by_id uuid,
    issue_id uuid NOT NULL REFERENCES issues (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    actor_id uuid,
    comment_html text NOT NULL,
    comment_json jsonb NOT NULL,
    access character varying(100) NOT NULL,
    external_id character varying(255),
    external_source character varying(255)
);


--
-- Name: cycles; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE cycles (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(255) NOT NULL,
    description text NOT NULL,
    start_date date,
    end_date date,
    created_by_id uuid,
    owned_by_id uuid NOT NULL,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    view_props jsonb NOT NULL,
    sort_order double precision NOT NULL,
    external_id character varying(255),
    external_source character varying(255)
);

--
-- Name: estimates; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE estimates (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(255) NOT NULL,
    description text NOT NULL,
    created_by_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: analytic_views; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE analytic_views (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(255) NOT NULL,
    description text NOT NULL,
    query jsonb NOT NULL,
    query_dict jsonb NOT NULL,
    created_by_id uuid,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);
--
-- Name: api_activity_logs; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE api_activity_logs (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    token_identifier character varying(255) NOT NULL,
    path character varying(255) NOT NULL,
    method character varying(10) NOT NULL,
    query_params text,
    headers text,
    body text,
    response_code integer NOT NULL,
    response_body text,
    ip_address inet,
    user_agent character varying(512),
    created_by_id uuid,
    updated_by_id uuid,
    CONSTRAINT [REDACTED]CHECK ((response_code >= 0))
);

CREATE TABLE api_tokens (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    token character varying(255) NOT NULL,
    label character varying(255) NOT NULL,
    user_type smallint NOT NULL,
    created_by_id uuid REFERENCES users (id),
    updated_by_id uuid REFERENCES users (id),
    user_id uuid NOT NULL REFERENCES users (id),
    workspace_id uuid,
    description text NOT NULL,
    expired_at timestamp with time zone,
    is_active boolean NOT NULL,
    last_used timestamp with time zone,
    CONSTRAINT [REDACTED]CHECK ((user_type >= 0)),
    CONSTRAINT workspace_fk FOREIGN KEY (workspace_id) REFERENCES workspaces (id)
);

--
-- Name: auth_group; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE auth_group (
    id integer NOT NULL PRIMARY KEY,
    name character varying(150) NOT NULL
);

--
-- Name: auth_group_id_seq; Type: SEQUENCE; Schema: public; Owner: plane
--

ALTER TABLE auth_group ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME auth_group_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);
--
-- Name: auth_group_permissions; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE auth_group_permissions (
    id bigint NOT NULL PRIMARY KEY,
    group_id integer NOT NULL,
    permission_id integer NOT NULL
);

--
-- Name: auth_group_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: plane
--

ALTER TABLE auth_group_permissions ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME auth_group_permissions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);
--
-- Name: auth_permission; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE auth_permission (
    id integer NOT NULL PRIMARY KEY,
    name character varying(255) NOT NULL,
    content_type_id integer NOT NULL,
    codename character varying(100) NOT NULL
);

--
-- Name: auth_permission_id_seq; Type: SEQUENCE; Schema: public; Owner: plane
--

ALTER TABLE auth_permission ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME auth_permission_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);
--
-- Name: authtoken_token; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE authtoken_token (
    key character varying(40) NOT NULL PRIMARY KEY,
    created timestamp with time zone NOT NULL,
    user_id uuid NOT NULL REFERENCES users (id)
);

--
-- Name: comment_reactions; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE comment_reactions (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    reaction character varying(20) NOT NULL,
    actor_id uuid NOT NULL,
    comment_id uuid NOT NULL REFERENCES issue_comments (id),
    created_by_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: cycle_favorites; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE cycle_favorites (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    created_by_id uuid,
    cycle_id uuid NOT NULL REFERENCES cycles (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    user_id uuid NOT NULL REFERENCES users (id),
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: cycle_issues; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE cycle_issues (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    created_by_id uuid,
    cycle_id uuid NOT NULL REFERENCES cycles (id),
    issue_id uuid NOT NULL REFERENCES issues (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: django_celery_beat_clockedschedule; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE django_celery_beat_clockedschedule (
    id integer NOT NULL PRIMARY KEY,
    clocked_time timestamp with time zone NOT NULL
);

--
-- Name: django_celery_beat_clockedschedule_id_seq; Type: SEQUENCE; Schema: public; Owner: plane
--

ALTER TABLE django_celery_beat_clockedschedule ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME django_celery_beat_clockedschedule_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);
--
-- Name: django_celery_beat_crontabschedule; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE django_celery_beat_crontabschedule (
    id integer NOT NULL PRIMARY KEY,
    minute character varying(240) NOT NULL,
    hour character varying(96) NOT NULL,
    day_of_week character varying(64) NOT NULL,
    day_of_month character varying(124) NOT NULL,
    month_of_year character varying(64) NOT NULL,
    timezone character varying(63) NOT NULL
);

--
-- Name: django_celery_beat_crontabschedule_id_seq; Type: SEQUENCE; Schema: public; Owner: plane
--

ALTER TABLE django_celery_beat_crontabschedule ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME django_celery_beat_crontabschedule_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);
--
-- Name: django_celery_beat_intervalschedule; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE django_celery_beat_intervalschedule (
    id integer NOT NULL PRIMARY KEY,
    every integer NOT NULL,
    period character varying(24) NOT NULL
);

--
-- Name: django_celery_beat_intervalschedule_id_seq; Type: SEQUENCE; Schema: public; Owner: plane
--

ALTER TABLE django_celery_beat_intervalschedule ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME django_celery_beat_intervalschedule_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);
--
-- Name: django_celery_beat_periodictask; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE django_celery_beat_periodictask (
    id integer NOT NULL PRIMARY KEY,
    name character varying(200) NOT NULL,
    task character varying(200) NOT NULL,
    args text NOT NULL,
    kwargs text NOT NULL,
    queue character varying(200),
    exchange character varying(200),
    routing_key character varying(200),
    expires timestamp with time zone,
    enabled boolean NOT NULL,
    last_run_at timestamp with time zone,
    total_run_count integer NOT NULL,
    date_changed timestamp with time zone NOT NULL,
    description text NOT NULL,
    crontab_id integer,
    interval_id integer,
    solar_id integer,
    one_off boolean NOT NULL,
    start_time timestamp with time zone,
    priority integer,
    headers text NOT NULL,
    clocked_id integer,
    expire_seconds integer,
    CONSTRAINT django_celery_beat_periodictask_expire_seconds_check CHECK ((expire_seconds >= 0)),
    CONSTRAINT django_celery_beat_periodictask_priority_check CHECK ((priority >= 0)),
    CONSTRAINT django_celery_beat_periodictask_total_run_count_check CHECK ((total_run_count >= 0))
);

--
-- Name: django_celery_beat_periodictask_id_seq; Type: SEQUENCE; Schema: public; Owner: plane
--

ALTER TABLE django_celery_beat_periodictask ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME django_celery_beat_periodictask_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);
--
-- Name: django_celery_beat_periodictasks; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE django_celery_beat_periodictasks (
    id integer NOT NULL PRIMARY KEY,
    ident smallint NOT NULL,
    last_update timestamp with time zone NOT NULL
);

--
-- Name: django_celery_beat_solarschedule; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE django_celery_beat_solarschedule (
    id integer NOT NULL PRIMARY KEY,
    event character varying(24) NOT NULL,
    latitude numeric(9,6) NOT NULL,
    longitude numeric(9,6) NOT NULL
);

--
-- Name: django_celery_beat_solarschedule_id_seq; Type: SEQUENCE; Schema: public; Owner: plane
--

ALTER TABLE django_celery_beat_solarschedule ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME django_celery_beat_solarschedule_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);
--
-- Name: django_content_type; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE django_content_type (
    id integer NOT NULL PRIMARY KEY,
    app_label character varying(100) NOT NULL,
    model character varying(100) NOT NULL
);

--
-- Name: django_content_type_id_seq; Type: SEQUENCE; Schema: public; Owner: plane
--

ALTER TABLE django_content_type ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME django_content_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);
--
-- Name: django_session; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE django_session (
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    session_key character varying(40) NOT NULL,
    session_data text NOT NULL,
    expire_date timestamp with time zone NOT NULL
);

--
-- Name: estimate_points; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE estimate_points (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    key integer NOT NULL,
    description text NOT NULL,
    value character varying(20) NOT NULL,
    created_by_id uuid,
    estimate_id uuid NOT NULL REFERENCES estimates (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: exporters; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE exporters (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    project uuid[],
    provider character varying(50) NOT NULL,
    status character varying(50) NOT NULL,
    reason text NOT NULL,
    key text NOT NULL,
    url character varying(800),
    token character varying(255) NOT NULL,
    created_by_id uuid,
    initiated_by_id uuid NOT NULL,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: file_assets; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE file_assets (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    attributes jsonb NOT NULL,
    asset character varying(100) NOT NULL,
    created_by_id uuid,
    updated_by_id uuid,
    workspace_id uuid,
    is_deleted boolean NOT NULL
);

--
-- Name: github_comment_syncs; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE github_comment_syncs (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    repo_comment_id bigint NOT NULL,
    comment_id uuid NOT NULL,
    created_by_id uuid,
    issue_sync_id uuid NOT NULL,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: github_issue_syncs; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE github_issue_syncs (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    repo_issue_id bigint NOT NULL,
    github_issue_id bigint NOT NULL,
    issue_url character varying(200) NOT NULL,
    created_by_id uuid,
    issue_id uuid NOT NULL REFERENCES issues (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    repository_sync_id uuid NOT NULL,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: github_repositories; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE github_repositories (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(500) NOT NULL,
    url character varying(200),
    config jsonb NOT NULL,
    repository_id bigint NOT NULL,
    owner character varying(500) NOT NULL,
    created_by_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: github_repository_syncs; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE github_repository_syncs (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    credentials jsonb NOT NULL,
    actor_id uuid NOT NULL,
    created_by_id uuid,
    label_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    repository_id uuid NOT NULL,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    workspace_integration_id uuid NOT NULL
);

--
-- Name: global_views; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE global_views (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(255) NOT NULL,
    description text NOT NULL,
    query jsonb NOT NULL,
    access smallint NOT NULL,
    query_data jsonb NOT NULL,
    sort_order double precision NOT NULL,
    created_by_id uuid,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    CONSTRAINT global_views_access_check CHECK ((access >= 0))
);

--
-- Name: importers; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE importers (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    service character varying(50) NOT NULL,
    status character varying(50) NOT NULL,
    metadata jsonb NOT NULL,
    config jsonb NOT NULL,
    data jsonb NOT NULL,
    created_by_id uuid,
    initiated_by_id uuid NOT NULL,
    project_id uuid NOT NULL REFERENCES projects (id),
    token_id uuid NOT NULL,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    imported_data jsonb
);

--
-- Name: inbox_issues; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE inbox_issues (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    status integer NOT NULL,
    snoozed_till timestamp with time zone,
    source text,
    created_by_id uuid,
    duplicate_to_id uuid,
    inbox_id uuid NOT NULL,
    issue_id uuid NOT NULL REFERENCES issues (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    external_id character varying(255),
    external_source character varying(255)
);

--
-- Name: inboxes; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE inboxes (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(255) NOT NULL,
    description text NOT NULL,
    is_default boolean NOT NULL,
    view_props jsonb NOT NULL,
    created_by_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: instance_admins; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE instance_admins (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    role roles NOT NULL,
    is_verified boolean NOT NULL,
    created_by_id uuid,
    instance_id uuid NOT NULL,
    updated_by_id uuid,
    user_id uuid
);

--
-- Name: instance_configurations; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE instance_configurations (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    key character varying(100) NOT NULL,
    value text,
    category text NOT NULL,
    is_encrypted boolean NOT NULL,
    created_by_id uuid,
    updated_by_id uuid
);

--
-- Name: instances; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE instances (
    created_at timestamp with time zone NOT NULL DEFAULT NOW(),
    updated_at timestamp with time zone NOT NULL DEFAULT NOW(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    instance_name character varying(255) NOT NULL,
    whitelist_emails text,
    instance_id character varying(25) NOT NULL,
    license_key character varying(256),
    api_key character varying(16) NOT NULL,
    version character varying(10) NOT NULL,
    last_checked_at timestamp with time zone NOT NULL,
    namespace character varying(50),
    is_telemetry_enabled boolean NOT NULL,
    is_support_required boolean NOT NULL,
    is_setup_done boolean NOT NULL,
    is_signup_screen_visited boolean NOT NULL,
    user_count bigint NOT NULL,
    is_verified boolean NOT NULL,
    created_by_id uuid,
    updated_by_id uuid,
    CONSTRAINT instances_user_count_check CHECK ((user_count >= 0))
);

--
-- Name: integrations; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE integrations (
    created_at timestamp with time zone NOT NULL DEFAULT NOW(),
    updated_at timestamp with time zone NOT NULL DEFAULT NOW(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    title character varying(400) NOT NULL,
    provider character varying(400) NOT NULL,
    network integer NOT NULL,
    description jsonb NOT NULL,
    author character varying(400) NOT NULL,
    webhook_url text NOT NULL,
    webhook_secret text NOT NULL,
    redirect_url text NOT NULL,
    metadata jsonb NOT NULL,
    verified boolean NOT NULL,
    avatar_url character varying(200),
    created_by_id uuid,
    updated_by_id uuid,
    CONSTRAINT integrations_network_check CHECK ((network >= 0))
);

--
-- Name: issue_activities; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE issue_activities (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    verb character varying(255) NOT NULL,
    field character varying(255),
    old_value text,
    new_value text,
    comment text NOT NULL,
    attachments character varying(200)[] NOT NULL,
    created_by_id uuid,
    issue_id uuid,
    issue_comment_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    actor_id uuid,
    new_identifier uuid,
    old_identifier uuid,
    epoch double precision
);

--
-- Name: issue_assignees; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE issue_assignees (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    assignee_id uuid NOT NULL,
    created_by_id uuid,
    issue_id uuid NOT NULL REFERENCES issues (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: issue_attachments; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE issue_attachments (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    attributes jsonb NOT NULL,
    asset character varying(100) NOT NULL,
    created_by_id uuid,
    issue_id uuid NOT NULL REFERENCES issues (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: issue_blockers; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE issue_blockers (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    block_id uuid NOT NULL,
    blocked_by_id uuid NOT NULL,
    created_by_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: issue_labels; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE issue_labels (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    created_by_id uuid,
    issue_id uuid NOT NULL REFERENCES issues (id),
    label_id uuid NOT NULL,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: issue_links; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE issue_links (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    title character varying(255),
    url character varying(200) NOT NULL,
    created_by_id uuid,
    issue_id uuid NOT NULL REFERENCES issues (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    metadata jsonb NOT NULL
);

--
-- Name: issue_mentions; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE issue_mentions (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    created_by_id uuid,
    issue_id uuid NOT NULL REFERENCES issues (id),
    mention_id uuid NOT NULL,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: issue_properties; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE issue_properties (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    properties jsonb NOT NULL,
    created_by_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    user_id uuid NOT NULL,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: issue_reactions; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE issue_reactions (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    reaction character varying(20) NOT NULL,
    actor_id uuid NOT NULL,
    created_by_id uuid,
    issue_id uuid NOT NULL REFERENCES issues (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: issue_relations; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE issue_relations (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    relation_type character varying(20) NOT NULL,
    created_by_id uuid,
    issue_id uuid NOT NULL REFERENCES issues (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    related_issue_id uuid NOT NULL REFERENCES issues (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: issue_sequences; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE issue_sequences (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    sequence bigint NOT NULL,
    deleted boolean NOT NULL,
    created_by_id uuid,
    issue_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    CONSTRAINT issue_sequence_sequence_check CHECK ((sequence >= 0))
);

--
-- Name: issue_subscribers; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE issue_subscribers (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    created_by_id uuid,
    issue_id uuid NOT NULL REFERENCES issues (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    subscriber_id uuid NOT NULL,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: issue_views; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE issue_views (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(255) NOT NULL,
    description text NOT NULL,
    query jsonb NOT NULL,
    access smallint NOT NULL,
    query_data jsonb NOT NULL,
    created_by_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    CONSTRAINT issue_views_access_check CHECK ((access >= 0))
);

--
-- Name: issue_votes; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE issue_votes (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    vote integer NOT NULL,
    actor_id uuid NOT NULL,
    created_by_id uuid,
    issue_id uuid NOT NULL REFERENCES issues (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: labels; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE labels (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(255) NOT NULL,
    description text NOT NULL,
    created_by_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    parent_id uuid,
    color character varying(255) NOT NULL,
    sort_order double precision NOT NULL,
    external_id character varying(255),
    external_source character varying(255)
);

--
-- Name: module_favorites; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE module_favorites (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    created_by_id uuid,
    module_id uuid NOT NULL REFERENCES modules (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    user_id uuid NOT NULL,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: module_issues; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE module_issues (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    created_by_id uuid,
    issue_id uuid NOT NULL REFERENCES issues (id),
    module_id uuid NOT NULL REFERENCES modules (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: module_links; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE module_links (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    title character varying(255),
    url character varying(200) NOT NULL,
    created_by_id uuid,
    module_id uuid NOT NULL REFERENCES modules (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    metadata jsonb NOT NULL
);

--
-- Name: module_members; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE module_members (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    created_by_id uuid,
    member_id uuid NOT NULL,
    module_id uuid NOT NULL REFERENCES modules (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: notifications; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE notifications (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    data jsonb,
    entity_identifier uuid,
    entity_name character varying(255) NOT NULL,
    title text NOT NULL,
    message jsonb,
    message_html text NOT NULL,
    message_stripped text,
    sender character varying(255) NOT NULL,
    read_at timestamp with time zone,
    snoozed_till timestamp with time zone,
    archived_at timestamp with time zone,
    created_by_id uuid,
    project_id uuid,
    receiver_id uuid NOT NULL,
    triggered_by_id uuid,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: page_blocks; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE page_blocks (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(255) NOT NULL,
    description jsonb NOT NULL,
    description_html text NOT NULL,
    description_stripped text,
    completed_at timestamp with time zone,
    created_by_id uuid,
    issue_id uuid,
    page_id uuid NOT NULL REFERENCES pages (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    sort_order double precision NOT NULL,
    sync boolean NOT NULL
);

--
-- Name: page_favorites; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE page_favorites (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    created_by_id uuid,
    page_id uuid NOT NULL REFERENCES pages (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    user_id uuid NOT NULL,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: page_labels; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE page_labels (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    created_by_id uuid,
    label_id uuid NOT NULL,
    page_id uuid NOT NULL REFERENCES pages (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: page_logs; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE page_logs (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    transaction uuid NOT NULL,
    entity_identifier uuid,
    entity_name character varying(30) NOT NULL,
    created_by_id uuid,
    page_id uuid NOT NULL REFERENCES pages (id),
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: project_deploy_boards; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE project_deploy_boards (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    anchor character varying(255) NOT NULL,
    comments boolean NOT NULL,
    reactions boolean NOT NULL,
    votes boolean NOT NULL,
    views jsonb NOT NULL,
    created_by_id uuid,
    inbox_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: project_favorites; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE project_favorites (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    created_by_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    user_id uuid NOT NULL,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: project_identifiers; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE project_identifiers (
    id bigint NOT NULL PRIMARY KEY,
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    name character varying(12) NOT NULL,
    created_by_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid
);

--
-- Name: project_identifier_id_seq; Type: SEQUENCE; Schema: public; Owner: plane
--

ALTER TABLE project_identifiers ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME project_identifier_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);
--
-- Name: project_member_invites; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE project_member_invites (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    email character varying(255) NOT NULL,
    accepted boolean NOT NULL,
    token character varying(255) NOT NULL,
    message text,
    responded_at timestamp with time zone,
    role project_member_roles NOT NULL DEFAULT 'Viewer' :: project_member_roles,
    created_by_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: project_members; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE project_members (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    comment text,
    role project_member_roles NOT NULL DEFAULT 'Member' :: project_member_roles,
    created_by_id uuid,
    member_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    view_props jsonb NOT NULL,
    default_props jsonb NOT NULL,
    sort_order double precision NOT NULL,
    preferences jsonb NOT NULL,
    is_active boolean NOT NULL
);

--
-- Name: project_public_members; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE project_public_members (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    created_by_id uuid,
    member_id uuid NOT NULL,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: slack_project_syncs; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE slack_project_syncs (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    access_token character varying(300) NOT NULL,
    scopes text NOT NULL,
    bot_user_id character varying(50) NOT NULL,
    webhook_url character varying(1000) NOT NULL,
    data jsonb NOT NULL,
    team_id character varying(30) NOT NULL,
    team_name character varying(300) NOT NULL,
    created_by_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    workspace_integration_id uuid NOT NULL
);

--
-- Name: social_login_connections; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE social_login_connections (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    medium character varying(20) NOT NULL,
    last_login_at timestamp with time zone,
    last_received_at timestamp with time zone,
    token_data jsonb,
    extra_data jsonb,
    created_by_id uuid,
    updated_by_id uuid,
    user_id uuid NOT NULL
);

--
-- Name: team_members; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE team_members (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    created_by_id uuid,
    member_id uuid NOT NULL,
    team_id uuid NOT NULL,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: teams; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE teams (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(255) NOT NULL,
    description text NOT NULL,
    created_by_id uuid,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: token_blacklist_blacklistedtoken; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE token_blacklist_blacklistedtoken (
    id bigint NOT NULL PRIMARY KEY,
    blacklisted_at timestamp with time zone NOT NULL,
    token_id bigint NOT NULL
);

--
-- Name: token_blacklist_blacklistedtoken_id_seq; Type: SEQUENCE; Schema: public; Owner: plane
--

ALTER TABLE token_blacklist_blacklistedtoken ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME token_blacklist_blacklistedtoken_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);
--
-- Name: token_blacklist_outstandingtoken; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE token_blacklist_outstandingtoken (
    id bigint NOT NULL PRIMARY KEY,
    token text NOT NULL,
    created_at timestamp with time zone,
    expires_at timestamp with time zone NOT NULL,
    user_id uuid,
    jti character varying(255) NOT NULL
);

--
-- Name: token_blacklist_outstandingtoken_id_seq; Type: SEQUENCE; Schema: public; Owner: plane
--

ALTER TABLE token_blacklist_outstandingtoken ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME token_blacklist_outstandingtoken_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);
--
-- Name: users_groups; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE users_groups (
    id bigint NOT NULL PRIMARY KEY,
    user_id uuid NOT NULL,
    group_id integer NOT NULL
);

--
-- Name: user_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: plane
--

ALTER TABLE users_groups ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME user_groups_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);
--
-- Name: users_user_permissions; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE users_user_permissions (
    id bigint NOT NULL PRIMARY KEY,
    user_id uuid NOT NULL,
    permission_id integer NOT NULL
);

--
-- Name: user_user_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: plane
--

ALTER TABLE users_user_permissions ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME user_user_permissions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);

--
-- Name: view_favorites; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE view_favorites (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    created_by_id uuid,
    project_id uuid NOT NULL REFERENCES projects (id),
    updated_by_id uuid,
    user_id uuid NOT NULL,
    view_id uuid NOT NULL,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: webhook_logs; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE webhook_logs (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    event_type character varying(255),
    request_method character varying(10),
    request_headers text,
    request_body text,
    response_status text,
    response_headers text,
    response_body text,
    retry_count smallint NOT NULL,
    created_by_id uuid,
    updated_by_id uuid,
    webhook_id uuid NOT NULL,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    CONSTRAINT webhook_logs_retry_count_check CHECK ((retry_count >= 0))
);

--
-- Name: webhooks; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE webhooks (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    url character varying(200) NOT NULL,
    is_active boolean NOT NULL,
    secret_key character varying(255) NOT NULL,
    project boolean NOT NULL,
    issue boolean NOT NULL,
    module boolean NOT NULL,
    cycle boolean NOT NULL,
    issue_comment boolean NOT NULL,
    created_by_id uuid,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: workspace_integrations; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE workspace_integrations (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    metadata jsonb NOT NULL,
    config jsonb NOT NULL,
    actor_id uuid NOT NULL,
    api_token_id uuid NOT NULL,
    created_by_id uuid,
    integration_id uuid NOT NULL,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: workspace_member_invites; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE workspace_member_invites (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    email character varying(255) NOT NULL,
    accepted boolean NOT NULL,
    token character varying(255) NOT NULL,
    message text,
    responded_at timestamp with time zone,
    role roles NOT NULL DEFAULT 'Member' :: roles,
    created_by_id uuid,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

--
-- Name: workspace_members; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE workspace_members (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    role roles NOT NULL DEFAULT 'Member' :: roles,
    created_by_id uuid,
    member_id uuid NOT NULL,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id),
    company_role text,
    view_props jsonb NOT NULL,
    default_props jsonb NOT NULL,
    issue_props jsonb NOT NULL,
    is_active boolean NOT NULL
);

--
-- Name: workspace_themes; Type: TABLE; Schema: public; Owner: plane
--

CREATE TABLE workspace_themes (
    created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
    id uuid NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
    name character varying(300) NOT NULL,
    colors jsonb NOT NULL,
    actor_id uuid NOT NULL,
    created_by_id uuid,
    updated_by_id uuid,
    workspace_id uuid NOT NULL REFERENCES workspaces (id)
);

ALTER TABLE ONLY api_tokens
    ADD CONSTRAINT [REDACTED]UNIQUE (token);
--
-- Name: auth_group auth_group_name_key; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY auth_group
    ADD CONSTRAINT auth_group_name_key UNIQUE (name);
--
-- Name: auth_group_permissions auth_group_permissions_group_id_permission_id_0cd325b0_uniq; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY auth_group_permissions
    ADD CONSTRAINT auth_group_permissions_group_id_permission_id_0cd325b0_uniq UNIQUE (group_id, permission_id);
--
-- Name: auth_group_permissions auth_group_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY auth_permission
    ADD CONSTRAINT auth_permission_content_type_id_codename_01ab375a_uniq UNIQUE (content_type_id, codename);

ALTER TABLE ONLY authtoken_token
    ADD CONSTRAINT authtoken_token_user_id_key UNIQUE (user_id);
--
-- Name: comment_reactions comment_reactions_comment_id_actor_id_reaction_523d21ad_uniq; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY comment_reactions
    ADD CONSTRAINT comment_reactions_comment_id_actor_id_reaction_523d21ad_uniq UNIQUE (comment_id, actor_id, reaction);

ALTER TABLE ONLY cycle_favorites
    ADD CONSTRAINT cycle_favorites_cycle_id_user_id_51c1ab91_uniq UNIQUE (cycle_id, user_id);

ALTER TABLE ONLY cycle_issues
    ADD CONSTRAINT cycle_issue_issue_id_fd06e284_uniq UNIQUE (issue_id);

ALTER TABLE ONLY django_celery_beat_solarschedule
    ADD CONSTRAINT django_celery_beat_solar_event_latitude_longitude_ba64999a_uniq UNIQUE (event, latitude, longitude);

ALTER TABLE ONLY django_content_type
    ADD CONSTRAINT django_content_type_app_label_model_76bd3d3b_uniq UNIQUE (app_label, model);

ALTER TABLE ONLY estimates
    ADD CONSTRAINT estimates_name_project_id_2b42c12c_uniq UNIQUE (name, project_id);

ALTER TABLE ONLY exporters
    ADD CONSTRAINT exporters_token_key UNIQUE (token);

ALTER TABLE ONLY github_comment_syncs
    ADD CONSTRAINT github_comment_syncs_issue_sync_id_comment_id_38c82e7b_uniq UNIQUE (issue_sync_id, comment_id);

ALTER TABLE ONLY github_issue_syncs
    ADD CONSTRAINT github_issue_syncs_repository_sync_id_issue_id_4b34427e_uniq UNIQUE (repository_sync_id, issue_id);

ALTER TABLE ONLY github_repository_syncs
    ADD CONSTRAINT github_repository_syncs_project_id_repository_id_0f3705e6_uniq UNIQUE (project_id, repository_id);
ALTER TABLE ONLY github_repository_syncs
    ADD CONSTRAINT github_repository_syncs_repository_id_key UNIQUE (repository_id);

ALTER TABLE ONLY inboxes
    ADD CONSTRAINT inboxes_name_project_id_daf38984_uniq UNIQUE (name, project_id);

ALTER TABLE ONLY instance_admins
    ADD CONSTRAINT instance_admins_instance_id_user_id_2e80a466_uniq UNIQUE (instance_id, user_id);

ALTER TABLE ONLY instance_configurations
    ADD CONSTRAINT instance_configurations_key_key UNIQUE (key);

ALTER TABLE ONLY instances
    ADD CONSTRAINT instances_instance_id_key UNIQUE (instance_id);

ALTER TABLE ONLY integrations
    ADD CONSTRAINT integrations_provider_key UNIQUE (provider);

ALTER TABLE ONLY issue_assignees
    ADD CONSTRAINT issue_assignee_issue_id_assignee_id_4ee260b4_uniq UNIQUE (issue_id, assignee_id);

ALTER TABLE ONLY issue_mentions
    ADD CONSTRAINT issue_mentions_issue_id_mention_id_ce91a005_uniq UNIQUE (issue_id, mention_id);

ALTER TABLE ONLY issue_properties
    ADD CONSTRAINT issue_property_user_id_project_id_fe52668f_uniq UNIQUE (user_id, project_id);

ALTER TABLE ONLY issue_reactions
    ADD CONSTRAINT issue_reactions_issue_id_actor_id_reaction_4751a642_uniq UNIQUE (issue_id, actor_id, reaction);

ALTER TABLE ONLY issue_relations
    ADD CONSTRAINT issue_relations_issue_id_related_issue_id_640e8062_uniq UNIQUE (issue_id, related_issue_id);

ALTER TABLE ONLY issue_subscribers
    ADD CONSTRAINT issue_subscribers_issue_id_subscriber_id_5038c5f8_uniq UNIQUE (issue_id, subscriber_id);

ALTER TABLE ONLY issue_votes
    ADD CONSTRAINT issue_votes_issue_id_actor_id_086954ee_uniq UNIQUE (issue_id, actor_id);

ALTER TABLE ONLY labels
    ADD CONSTRAINT labels_name_project_id_d8b1b810_uniq UNIQUE (name, project_id);

ALTER TABLE ONLY module_favorites
    ADD CONSTRAINT module_favorites_module_id_user_id_5b36ecc1_uniq UNIQUE (module_id, user_id);

ALTER TABLE ONLY module_issues
    ADD CONSTRAINT module_issues_issue_id_7caa908b_uniq UNIQUE (issue_id);

ALTER TABLE ONLY module_members
    ADD CONSTRAINT module_member_module_id_member_id_1421c56c_uniq UNIQUE (module_id, member_id);

ALTER TABLE ONLY modules
    ADD CONSTRAINT module_name_project_id_c730d437_uniq UNIQUE (name, project_id);

ALTER TABLE ONLY page_favorites
    ADD CONSTRAINT page_favorites_page_id_user_id_6e2c24ba_uniq UNIQUE (page_id, user_id);

ALTER TABLE ONLY page_logs
    ADD CONSTRAINT page_logs_page_id_transaction_9ab05334_uniq UNIQUE (page_id, transaction);

ALTER TABLE ONLY project_deploy_boards
    ADD CONSTRAINT project_deploy_boards_anchor_key UNIQUE (anchor);

ALTER TABLE ONLY project_deploy_boards
    ADD CONSTRAINT project_deploy_boards_project_id_anchor_893d365a_uniq UNIQUE (project_id, anchor);

ALTER TABLE ONLY project_favorites
    ADD CONSTRAINT project_favorites_project_id_user_id_e7e43312_uniq UNIQUE (project_id, user_id);

ALTER TABLE ONLY project_identifiers
    ADD CONSTRAINT project_identifier_name_workspace_id_4b7404cb_uniq UNIQUE (name, workspace_id);

ALTER TABLE ONLY project_identifiers
    ADD CONSTRAINT project_identifier_project_id_key UNIQUE (project_id);

ALTER TABLE ONLY projects
    ADD CONSTRAINT project_identifier_workspace_id_35e9a4bf_uniq UNIQUE (identifier, workspace_id);

ALTER TABLE ONLY project_members
    ADD CONSTRAINT project_member_project_id_member_id_9489e47c_uniq UNIQUE (project_id, member_id);

ALTER TABLE ONLY projects
    ADD CONSTRAINT project_name_workspace_id_e858a38f_uniq UNIQUE (name, workspace_id);

ALTER TABLE ONLY project_public_members
    ADD CONSTRAINT project_public_members_project_id_member_id_51cd09a4_uniq UNIQUE (project_id, member_id);

ALTER TABLE ONLY slack_project_syncs
    ADD CONSTRAINT slack_project_syncs_team_id_project_id_50a144a7_uniq UNIQUE (team_id, project_id);

ALTER TABLE ONLY states
    ADD CONSTRAINT state_name_project_id_89897f31_uniq UNIQUE (name, project_id);
--
-- Name: states state_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--


--
-- Name: team_members team_member_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--


--
-- Name: team_members team_member_team_id_member_id_d0325b97_uniq; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY team_members
    ADD CONSTRAINT team_member_team_id_member_id_d0325b97_uniq UNIQUE (team_id, member_id);
--
-- Name: teams team_name_workspace_id_9538db2e_uniq; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY teams
    ADD CONSTRAINT team_name_workspace_id_9538db2e_uniq UNIQUE (name, workspace_id);
--
-- Name: teams team_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--


--
-- Name: token_blacklist_blacklistedtoken token_blacklist_blacklistedtoken_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--


--
-- Name: token_blacklist_blacklistedtoken token_blacklist_blacklistedtoken_token_id_key; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY token_blacklist_blacklistedtoken
    ADD CONSTRAINT token_blacklist_blacklistedtoken_token_id_key UNIQUE (token_id);
--
-- Name: token_blacklist_outstandingtoken token_blacklist_outstandingtoken_jti_hex_d9bdf6f7_uniq; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY token_blacklist_outstandingtoken
    ADD CONSTRAINT token_blacklist_outstandingtoken_jti_hex_d9bdf6f7_uniq UNIQUE (jti);
--
-- Name: token_blacklist_outstandingtoken token_blacklist_outstandingtoken_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--


--
-- Name: users user_email_key; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY users
    ADD CONSTRAINT user_email_key UNIQUE (email);
--
-- Name: users_groups user_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--


--
-- Name: users_groups user_groups_user_id_group_id_40beef00_uniq; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY users_groups
    ADD CONSTRAINT user_groups_user_id_group_id_40beef00_uniq UNIQUE (user_id, group_id);
--
-- Name: users user_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--


--
-- Name: users_user_permissions user_user_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--


--
-- Name: users_user_permissions user_user_permissions_user_id_permission_id_7dc6e2e0_uniq; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY users_user_permissions
    ADD CONSTRAINT user_user_permissions_user_id_permission_id_7dc6e2e0_uniq UNIQUE (user_id, permission_id);
--
-- Name: users user_username_key; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY users
    ADD CONSTRAINT user_username_key UNIQUE (username);
--
-- Name: view_favorites view_favorites_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--


--
-- Name: view_favorites view_favorites_view_id_user_id_3f287788_uniq; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY view_favorites
    ADD CONSTRAINT view_favorites_view_id_user_id_3f287788_uniq UNIQUE (view_id, user_id);
--
-- Name: webhook_logs webhook_logs_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--


--
-- Name: webhooks webhooks_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--


--
-- Name: webhooks webhooks_workspace_id_url_9e8012ba_uniq; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY webhooks
    ADD CONSTRAINT webhooks_workspace_id_url_9e8012ba_uniq UNIQUE (workspace_id, url);
--
-- Name: workspace_integrations workspace_integrations_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--


--
-- Name: workspace_integrations workspace_integrations_workspace_id_integration_fa041c22_uniq; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_integrations
    ADD CONSTRAINT workspace_integrations_workspace_id_integration_fa041c22_uniq UNIQUE (workspace_id, integration_id);
--
-- Name: workspace_member_invites workspace_member_invite_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--


--
-- Name: workspace_member_invites workspace_member_invites_email_workspace_id_9d830009_uniq; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_member_invites
    ADD CONSTRAINT workspace_member_invites_email_workspace_id_9d830009_uniq UNIQUE (email, workspace_id);
--
-- Name: workspace_members workspace_member_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--


--
-- Name: workspace_members workspace_member_workspace_id_member_id_2b61b0e8_uniq; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_members
    ADD CONSTRAINT workspace_member_workspace_id_member_id_2b61b0e8_uniq UNIQUE (workspace_id, member_id);
--
-- Name: workspaces workspace_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--


--
-- Name: workspaces workspace_slug_key; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspaces
    ADD CONSTRAINT workspace_slug_key UNIQUE (slug);
--
-- Name: workspace_themes workspace_themes_pkey; Type: CONSTRAINT; Schema: public; Owner: plane
--


--
-- Name: workspace_themes workspace_themes_workspace_id_name_500d4836_uniq; Type: CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_themes
    ADD CONSTRAINT workspace_themes_workspace_id_name_500d4836_uniq UNIQUE (workspace_id, name);
--
-- Name: analytic_views_created_by_id_1b3ca0a9; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX analytic_views_created_by_id_1b3ca0a9 ON analytic_views USING btree (created_by_id);
--
-- Name: analytic_views_updated_by_id_b6d827e1; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX analytic_views_updated_by_id_b6d827e1 ON analytic_views USING btree (updated_by_id);
--
-- Name: analytic_views_workspace_id_ca6e5c0b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX analytic_views_workspace_id_ca6e5c0b ON analytic_views USING btree (workspace_id);
--
-- Name: [REDACTED] Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX [REDACTED]ON api_activity_logs USING btree (created_by_id);
--
-- Name: [REDACTED] Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX [REDACTED]ON api_activity_logs USING btree (updated_by_id);
--
-- Name: [REDACTED] Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX [REDACTED]ON api_tokens USING btree (created_by_id);
--
-- Name: [REDACTED] Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX [REDACTED]ON api_tokens USING btree (token varchar_pattern_ops);
--
-- Name: [REDACTED] Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX [REDACTED]ON api_tokens USING btree (updated_by_id);
--
-- Name: [REDACTED] Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX [REDACTED]ON api_tokens USING btree (user_id);
--
-- Name: [REDACTED] Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX [REDACTED]ON api_tokens USING btree (workspace_id);
--
-- Name: auth_group_name_a6ea08ec_like; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX auth_group_name_a6ea08ec_like ON auth_group USING btree (name varchar_pattern_ops);
--
-- Name: auth_group_permissions_group_id_b120cbf9; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX auth_group_permissions_group_id_b120cbf9 ON auth_group_permissions USING btree (group_id);
--
-- Name: auth_group_permissions_permission_id_84c5c92e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX auth_group_permissions_permission_id_84c5c92e ON auth_group_permissions USING btree (permission_id);
--
-- Name: auth_permission_content_type_id_2f476e4b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX auth_permission_content_type_id_2f476e4b ON auth_permission USING btree (content_type_id);
--
-- Name: authtoken_token_key_10f0b77e_like; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX authtoken_token_key_10f0b77e_like ON authtoken_token USING btree (key varchar_pattern_ops);
--
-- Name: comment_reactions_actor_id_21219e9c; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX comment_reactions_actor_id_21219e9c ON comment_reactions USING btree (actor_id);
--
-- Name: comment_reactions_comment_id_87c59446; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX comment_reactions_comment_id_87c59446 ON comment_reactions USING btree (comment_id);
--
-- Name: comment_reactions_created_by_id_9aeb43c4; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX comment_reactions_created_by_id_9aeb43c4 ON comment_reactions USING btree (created_by_id);
--
-- Name: comment_reactions_project_id_ab9114b4; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX comment_reactions_project_id_ab9114b4 ON comment_reactions USING btree (project_id);
--
-- Name: comment_reactions_updated_by_id_c74c9bbd; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX comment_reactions_updated_by_id_c74c9bbd ON comment_reactions USING btree (updated_by_id);
--
-- Name: comment_reactions_workspace_id_b614ca4f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX comment_reactions_workspace_id_b614ca4f ON comment_reactions USING btree (workspace_id);
--
-- Name: cycle_created_by_id_78e43b79; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX cycle_created_by_id_78e43b79 ON cycles USING btree (created_by_id);
--
-- Name: cycle_favorites_created_by_id_e888870b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX cycle_favorites_created_by_id_e888870b ON cycle_favorites USING btree (created_by_id);
--
-- Name: cycle_favorites_cycle_id_8224e5ad; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX cycle_favorites_cycle_id_8224e5ad ON cycle_favorites USING btree (cycle_id);
--
-- Name: cycle_favorites_project_id_f2977b66; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX cycle_favorites_project_id_f2977b66 ON cycle_favorites USING btree (project_id);
--
-- Name: cycle_favorites_updated_by_id_8576232f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX cycle_favorites_updated_by_id_8576232f ON cycle_favorites USING btree (updated_by_id);
--
-- Name: cycle_favorites_user_id_8a04268d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX cycle_favorites_user_id_8a04268d ON cycle_favorites USING btree (user_id);
--
-- Name: cycle_favorites_workspace_id_07359b0b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX cycle_favorites_workspace_id_07359b0b ON cycle_favorites USING btree (workspace_id);
--
-- Name: cycle_issue_created_by_id_30b27539; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX cycle_issue_created_by_id_30b27539 ON cycle_issues USING btree (created_by_id);
--
-- Name: cycle_issue_cycle_id_ec681215; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX cycle_issue_cycle_id_ec681215 ON cycle_issues USING btree (cycle_id);
--
-- Name: cycle_issue_project_id_6ad3257a; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX cycle_issue_project_id_6ad3257a ON cycle_issues USING btree (project_id);
--
-- Name: cycle_issue_updated_by_id_cb4516f2; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX cycle_issue_updated_by_id_cb4516f2 ON cycle_issues USING btree (updated_by_id);
--
-- Name: cycle_issue_workspace_id_1d77330e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX cycle_issue_workspace_id_1d77330e ON cycle_issues USING btree (workspace_id);
--
-- Name: cycle_owned_by_id_5456a4d1; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX cycle_owned_by_id_5456a4d1 ON cycles USING btree (owned_by_id);
--
-- Name: cycle_project_id_0b590349; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX cycle_project_id_0b590349 ON cycles USING btree (project_id);
--
-- Name: cycle_updated_by_id_93baee43; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX cycle_updated_by_id_93baee43 ON cycles USING btree (updated_by_id);
--
-- Name: cycle_workspace_id_a199e8e1; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX cycle_workspace_id_a199e8e1 ON cycles USING btree (workspace_id);
--
-- Name: django_celery_beat_periodictask_clocked_id_47a69f82; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX django_celery_beat_periodictask_clocked_id_47a69f82 ON django_celery_beat_periodictask USING btree (clocked_id);
--
-- Name: django_celery_beat_periodictask_crontab_id_d3cba168; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX django_celery_beat_periodictask_crontab_id_d3cba168 ON django_celery_beat_periodictask USING btree (crontab_id);
--
-- Name: django_celery_beat_periodictask_interval_id_a8ca27da; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX django_celery_beat_periodictask_interval_id_a8ca27da ON django_celery_beat_periodictask USING btree (interval_id);
--
-- Name: django_celery_beat_periodictask_name_265a36b7_like; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX django_celery_beat_periodictask_name_265a36b7_like ON django_celery_beat_periodictask USING btree (name varchar_pattern_ops);
--
-- Name: django_celery_beat_periodictask_solar_id_a87ce72c; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX django_celery_beat_periodictask_solar_id_a87ce72c ON django_celery_beat_periodictask USING btree (solar_id);
--
-- Name: django_session_expire_date_a5c62663; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX django_session_expire_date_a5c62663 ON django_session USING btree (expire_date);
--
-- Name: django_session_session_key_c0390e0f_like; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX django_session_session_key_c0390e0f_like ON django_session USING btree (session_key varchar_pattern_ops);
--
-- Name: estimate_points_created_by_id_d1b04bd9; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX estimate_points_created_by_id_d1b04bd9 ON estimate_points USING btree (created_by_id);
--
-- Name: estimate_points_estimate_id_4b4cb706; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX estimate_points_estimate_id_4b4cb706 ON estimate_points USING btree (estimate_id);
--
-- Name: estimate_points_project_id_ba9bcb2c; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX estimate_points_project_id_ba9bcb2c ON estimate_points USING btree (project_id);
--
-- Name: estimate_points_updated_by_id_a1da94e1; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX estimate_points_updated_by_id_a1da94e1 ON estimate_points USING btree (updated_by_id);
--
-- Name: estimate_points_workspace_id_96fc4f92; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX estimate_points_workspace_id_96fc4f92 ON estimate_points USING btree (workspace_id);
--
-- Name: estimates_created_by_id_7e401493; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX estimates_created_by_id_7e401493 ON estimates USING btree (created_by_id);
--
-- Name: estimates_project_id_7f195a41; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX estimates_project_id_7f195a41 ON estimates USING btree (project_id);
--
-- Name: estimates_updated_by_id_b3fcfb1d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX estimates_updated_by_id_b3fcfb1d ON estimates USING btree (updated_by_id);
--
-- Name: estimates_workspace_id_718811eb; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX estimates_workspace_id_718811eb ON estimates USING btree (workspace_id);
--
-- Name: exporters_created_by_id_44e1d9b3; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX exporters_created_by_id_44e1d9b3 ON exporters USING btree (created_by_id);
--
-- Name: exporters_initiated_by_id_d51f7552; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX exporters_initiated_by_id_d51f7552 ON exporters USING btree (initiated_by_id);
--
-- Name: exporters_token_c774aeeb_like; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX exporters_token_c774aeeb_like ON exporters USING btree (token varchar_pattern_ops);
--
-- Name: exporters_updated_by_id_d2572861; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX exporters_updated_by_id_d2572861 ON exporters USING btree (updated_by_id);
--
-- Name: exporters_workspace_id_11a04317; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX exporters_workspace_id_11a04317 ON exporters USING btree (workspace_id);
--
-- Name: file_asset_created_by_id_966942a0; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX file_asset_created_by_id_966942a0 ON file_assets USING btree (created_by_id);
--
-- Name: file_asset_updated_by_id_d6aaf4f0; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX file_asset_updated_by_id_d6aaf4f0 ON file_assets USING btree (updated_by_id);
--
-- Name: file_assets_workspace_id_fa50b9c5; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX file_assets_workspace_id_fa50b9c5 ON file_assets USING btree (workspace_id);
--
-- Name: github_comment_syncs_comment_id_6feec6d1; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_comment_syncs_comment_id_6feec6d1 ON github_comment_syncs USING btree (comment_id);
--
-- Name: github_comment_syncs_created_by_id_b1ef2517; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_comment_syncs_created_by_id_b1ef2517 ON github_comment_syncs USING btree (created_by_id);
--
-- Name: github_comment_syncs_issue_sync_id_5e738eb5; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_comment_syncs_issue_sync_id_5e738eb5 ON github_comment_syncs USING btree (issue_sync_id);
--
-- Name: github_comment_syncs_project_id_6d199ace; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_comment_syncs_project_id_6d199ace ON github_comment_syncs USING btree (project_id);
--
-- Name: github_comment_syncs_updated_by_id_bb05c066; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_comment_syncs_updated_by_id_bb05c066 ON github_comment_syncs USING btree (updated_by_id);
--
-- Name: github_comment_syncs_workspace_id_b54528c8; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_comment_syncs_workspace_id_b54528c8 ON github_comment_syncs USING btree (workspace_id);
--
-- Name: github_issue_syncs_created_by_id_d02b7c56; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_issue_syncs_created_by_id_d02b7c56 ON github_issue_syncs USING btree (created_by_id);
--
-- Name: github_issue_syncs_issue_id_450cb083; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_issue_syncs_issue_id_450cb083 ON github_issue_syncs USING btree (issue_id);
--
-- Name: github_issue_syncs_project_id_4609ad0c; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_issue_syncs_project_id_4609ad0c ON github_issue_syncs USING btree (project_id);
--
-- Name: github_issue_syncs_repository_sync_id_ba0d4de4; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_issue_syncs_repository_sync_id_ba0d4de4 ON github_issue_syncs USING btree (repository_sync_id);
--
-- Name: github_issue_syncs_updated_by_id_e9cd6f86; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_issue_syncs_updated_by_id_e9cd6f86 ON github_issue_syncs USING btree (updated_by_id);
--
-- Name: github_issue_syncs_workspace_id_eae020ad; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_issue_syncs_workspace_id_eae020ad ON github_issue_syncs USING btree (workspace_id);
--
-- Name: github_repositories_created_by_id_104fa685; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_repositories_created_by_id_104fa685 ON github_repositories USING btree (created_by_id);
--
-- Name: github_repositories_project_id_65c546bb; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_repositories_project_id_65c546bb ON github_repositories USING btree (project_id);
--
-- Name: github_repositories_updated_by_id_8aa4d772; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_repositories_updated_by_id_8aa4d772 ON github_repositories USING btree (updated_by_id);
--
-- Name: github_repositories_workspace_id_c4de7326; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_repositories_workspace_id_c4de7326 ON github_repositories USING btree (workspace_id);
--
-- Name: github_repository_syncs_actor_id_1fa689fe; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_repository_syncs_actor_id_1fa689fe ON github_repository_syncs USING btree (actor_id);
--
-- Name: github_repository_syncs_created_by_id_0df94495; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_repository_syncs_created_by_id_0df94495 ON github_repository_syncs USING btree (created_by_id);
--
-- Name: github_repository_syncs_label_id_eb1e9bd7; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_repository_syncs_label_id_eb1e9bd7 ON github_repository_syncs USING btree (label_id);
--
-- Name: github_repository_syncs_project_id_e7e8291e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_repository_syncs_project_id_e7e8291e ON github_repository_syncs USING btree (project_id);
--
-- Name: github_repository_syncs_updated_by_id_07e9d065; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_repository_syncs_updated_by_id_07e9d065 ON github_repository_syncs USING btree (updated_by_id);
--
-- Name: github_repository_syncs_workspace_id_4a22a8b8; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_repository_syncs_workspace_id_4a22a8b8 ON github_repository_syncs USING btree (workspace_id);
--
-- Name: github_repository_syncs_workspace_integration_id_62858398; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX github_repository_syncs_workspace_integration_id_62858398 ON github_repository_syncs USING btree (workspace_integration_id);
--
-- Name: global_views_created_by_id_14b7d95c; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX global_views_created_by_id_14b7d95c ON global_views USING btree (created_by_id);
--
-- Name: global_views_updated_by_id_112e0281; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX global_views_updated_by_id_112e0281 ON global_views USING btree (updated_by_id);
--
-- Name: global_views_workspace_id_3c68eca7; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX global_views_workspace_id_3c68eca7 ON global_views USING btree (workspace_id);
--
-- Name: importers_created_by_id_7dd06433; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX importers_created_by_id_7dd06433 ON importers USING btree (created_by_id);
--
-- Name: importers_initiated_by_id_3cddbd23; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX importers_initiated_by_id_3cddbd23 ON importers USING btree (initiated_by_id);
--
-- Name: importers_project_id_1f8b43ef; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX importers_project_id_1f8b43ef ON importers USING btree (project_id);
--
-- Name: importers_token_id_c951e89f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX importers_token_id_c951e89f ON importers USING btree (token_id);
--
-- Name: importers_updated_by_id_3915139e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX importers_updated_by_id_3915139e ON importers USING btree (updated_by_id);
--
-- Name: importers_workspace_id_795b8985; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX importers_workspace_id_795b8985 ON importers USING btree (workspace_id);
--
-- Name: inbox_issues_created_by_id_483bce13; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX inbox_issues_created_by_id_483bce13 ON inbox_issues USING btree (created_by_id);
--
-- Name: inbox_issues_duplicate_to_id_6cb8d961; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX inbox_issues_duplicate_to_id_6cb8d961 ON inbox_issues USING btree (duplicate_to_id);
--
-- Name: inbox_issues_inbox_id_444b05b9; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX inbox_issues_inbox_id_444b05b9 ON inbox_issues USING btree (inbox_id);
--
-- Name: inbox_issues_issue_id_7d74b224; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX inbox_issues_issue_id_7d74b224 ON inbox_issues USING btree (issue_id);
--
-- Name: inbox_issues_project_id_5117a70b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX inbox_issues_project_id_5117a70b ON inbox_issues USING btree (project_id);
--
-- Name: inbox_issues_updated_by_id_d1b2b70f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX inbox_issues_updated_by_id_d1b2b70f ON inbox_issues USING btree (updated_by_id);
--
-- Name: inbox_issues_workspace_id_4a61a7bd; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX inbox_issues_workspace_id_4a61a7bd ON inbox_issues USING btree (workspace_id);
--
-- Name: inboxes_created_by_id_9f1cf5ec; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX inboxes_created_by_id_9f1cf5ec ON inboxes USING btree (created_by_id);
--
-- Name: inboxes_project_id_a0135c66; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX inboxes_project_id_a0135c66 ON inboxes USING btree (project_id);
--
-- Name: inboxes_updated_by_id_69b7b3ae; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX inboxes_updated_by_id_69b7b3ae ON inboxes USING btree (updated_by_id);
--
-- Name: inboxes_workspace_id_d6178865; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX inboxes_workspace_id_d6178865 ON inboxes USING btree (workspace_id);
--
-- Name: instance_admins_created_by_id_7f4e03b4; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX instance_admins_created_by_id_7f4e03b4 ON instance_admins USING btree (created_by_id);
--
-- Name: instance_admins_instance_id_66d1ba73; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX instance_admins_instance_id_66d1ba73 ON instance_admins USING btree (instance_id);
--
-- Name: instance_admins_updated_by_id_b7800403; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX instance_admins_updated_by_id_b7800403 ON instance_admins USING btree (updated_by_id);
--
-- Name: instance_admins_user_id_cc6e9b62; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX instance_admins_user_id_cc6e9b62 ON instance_admins USING btree (user_id);
--
-- Name: instance_configurations_created_by_id_e683f3e5; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX instance_configurations_created_by_id_e683f3e5 ON instance_configurations USING btree (created_by_id);
--
-- Name: instance_configurations_key_3eb64d36_like; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX instance_configurations_key_3eb64d36_like ON instance_configurations USING btree (key varchar_pattern_ops);
--
-- Name: instance_configurations_updated_by_id_f0d7542e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX instance_configurations_updated_by_id_f0d7542e ON instance_configurations USING btree (updated_by_id);
--
-- Name: instances_created_by_id_c76e92ef; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX instances_created_by_id_c76e92ef ON instances USING btree (created_by_id);
--
-- Name: instances_instance_id_cf688621_like; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX instances_instance_id_cf688621_like ON instances USING btree (instance_id varchar_pattern_ops);
--
-- Name: instances_updated_by_id_cce8fcdf; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX instances_updated_by_id_cce8fcdf ON instances USING btree (updated_by_id);
--
-- Name: integrations_created_by_id_0b6edd52; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX integrations_created_by_id_0b6edd52 ON integrations USING btree (created_by_id);
--
-- Name: integrations_provider_6537a106_like; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX integrations_provider_6537a106_like ON integrations USING btree (provider varchar_pattern_ops);
--
-- Name: integrations_updated_by_id_d6d00d15; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX integrations_updated_by_id_d6d00d15 ON integrations USING btree (updated_by_id);
--
-- Name: issue_activity_actor_id_52fdd42d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_activity_actor_id_52fdd42d ON issue_activities USING btree (actor_id);
--
-- Name: issue_activity_created_by_id_49516e3d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_activity_created_by_id_49516e3d ON issue_activities USING btree (created_by_id);
--
-- Name: issue_activity_issue_comment_id_701f3c3c; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_activity_issue_comment_id_701f3c3c ON issue_activities USING btree (issue_comment_id);
--
-- Name: issue_activity_issue_id_807fbde4; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_activity_issue_id_807fbde4 ON issue_activities USING btree (issue_id);
--
-- Name: issue_activity_project_id_d0ac2ccf; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_activity_project_id_d0ac2ccf ON issue_activities USING btree (project_id);
--
-- Name: issue_activity_updated_by_id_0075f9bd; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_activity_updated_by_id_0075f9bd ON issue_activities USING btree (updated_by_id);
--
-- Name: issue_activity_workspace_id_65acaf73; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_activity_workspace_id_65acaf73 ON issue_activities USING btree (workspace_id);
--
-- Name: issue_assignee_assignee_id_50f5c04e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_assignee_assignee_id_50f5c04e ON issue_assignees USING btree (assignee_id);
--
-- Name: issue_assignee_created_by_id_f693d43b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_assignee_created_by_id_f693d43b ON issue_assignees USING btree (created_by_id);
--
-- Name: issue_assignee_issue_id_72da08db; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_assignee_issue_id_72da08db ON issue_assignees USING btree (issue_id);
--
-- Name: issue_assignee_project_id_61c18bf2; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_assignee_project_id_61c18bf2 ON issue_assignees USING btree (project_id);
--
-- Name: issue_assignee_updated_by_id_c54088aa; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_assignee_updated_by_id_c54088aa ON issue_assignees USING btree (updated_by_id);
--
-- Name: issue_assignee_workspace_id_9aad55b7; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_assignee_workspace_id_9aad55b7 ON issue_assignees USING btree (workspace_id);
--
-- Name: issue_attachments_created_by_id_87be05bb; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_attachments_created_by_id_87be05bb ON issue_attachments USING btree (created_by_id);
--
-- Name: issue_attachments_issue_id_0faf88bf; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_attachments_issue_id_0faf88bf ON issue_attachments USING btree (issue_id);
--
-- Name: issue_attachments_project_id_a95fe706; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_attachments_project_id_a95fe706 ON issue_attachments USING btree (project_id);
--
-- Name: issue_attachments_updated_by_id_47dceec1; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_attachments_updated_by_id_47dceec1 ON issue_attachments USING btree (updated_by_id);
--
-- Name: issue_attachments_workspace_id_c456a532; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_attachments_workspace_id_c456a532 ON issue_attachments USING btree (workspace_id);
--
-- Name: issue_blocker_block_id_5d15a701; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_blocker_block_id_5d15a701 ON issue_blockers USING btree (block_id);
--
-- Name: issue_blocker_blocked_by_id_a138af71; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_blocker_blocked_by_id_a138af71 ON issue_blockers USING btree (blocked_by_id);
--
-- Name: issue_blocker_created_by_id_0d19f6ea; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_blocker_created_by_id_0d19f6ea ON issue_blockers USING btree (created_by_id);
--
-- Name: issue_blocker_project_id_380bd100; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_blocker_project_id_380bd100 ON issue_blockers USING btree (project_id);
--
-- Name: issue_blocker_updated_by_id_4af87d63; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_blocker_updated_by_id_4af87d63 ON issue_blockers USING btree (updated_by_id);
--
-- Name: issue_blocker_workspace_id_419a1c71; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_blocker_workspace_id_419a1c71 ON issue_blockers USING btree (workspace_id);
--
-- Name: issue_comment_actor_id_d312315b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_comment_actor_id_d312315b ON issue_comments USING btree (actor_id);
--
-- Name: issue_comment_created_by_id_0765f239; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_comment_created_by_id_0765f239 ON issue_comments USING btree (created_by_id);
--
-- Name: issue_comment_issue_id_d0195e35; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_comment_issue_id_d0195e35 ON issue_comments USING btree (issue_id);
--
-- Name: issue_comment_project_id_db37c105; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_comment_project_id_db37c105 ON issue_comments USING btree (project_id);
--
-- Name: issue_comment_updated_by_id_96cfb86e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_comment_updated_by_id_96cfb86e ON issue_comments USING btree (updated_by_id);
--
-- Name: issue_comment_workspace_id_3f7969ec; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_comment_workspace_id_3f7969ec ON issue_comments USING btree (workspace_id);
--
-- Name: issue_created_by_id_8f0ae62b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_created_by_id_8f0ae62b ON issues USING btree (created_by_id);
--
-- Name: issue_label_created_by_id_94075315; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_label_created_by_id_94075315 ON issue_labels USING btree (created_by_id);
--
-- Name: issue_label_issue_id_0f252e52; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_label_issue_id_0f252e52 ON issue_labels USING btree (issue_id);
--
-- Name: issue_label_label_id_5f22777f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_label_label_id_5f22777f ON issue_labels USING btree (label_id);
--
-- Name: issue_label_project_id_eaa2ba39; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_label_project_id_eaa2ba39 ON issue_labels USING btree (project_id);
--
-- Name: issue_label_updated_by_id_a97a6733; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_label_updated_by_id_a97a6733 ON issue_labels USING btree (updated_by_id);
--
-- Name: issue_label_workspace_id_b5b1faac; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_label_workspace_id_b5b1faac ON issue_labels USING btree (workspace_id);
--
-- Name: issue_links_created_by_id_5e4aa092; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_links_created_by_id_5e4aa092 ON issue_links USING btree (created_by_id);
--
-- Name: issue_links_issue_id_7032881f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_links_issue_id_7032881f ON issue_links USING btree (issue_id);
--
-- Name: issue_links_project_id_63d6e9ce; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_links_project_id_63d6e9ce ON issue_links USING btree (project_id);
--
-- Name: issue_links_updated_by_id_a771cce4; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_links_updated_by_id_a771cce4 ON issue_links USING btree (updated_by_id);
--
-- Name: issue_links_workspace_id_ff9038e7; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_links_workspace_id_ff9038e7 ON issue_links USING btree (workspace_id);
--
-- Name: issue_mentions_created_by_id_eb44759e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_mentions_created_by_id_eb44759e ON issue_mentions USING btree (created_by_id);
--
-- Name: issue_mentions_issue_id_d8821107; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_mentions_issue_id_d8821107 ON issue_mentions USING btree (issue_id);
--
-- Name: issue_mentions_mention_id_cf1b9346; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_mentions_mention_id_cf1b9346 ON issue_mentions USING btree (mention_id);
--
-- Name: issue_mentions_project_id_d0cccdf5; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_mentions_project_id_d0cccdf5 ON issue_mentions USING btree (project_id);
--
-- Name: issue_mentions_updated_by_id_c62106d3; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_mentions_updated_by_id_c62106d3 ON issue_mentions USING btree (updated_by_id);
--
-- Name: issue_mentions_workspace_id_4ca59d05; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_mentions_workspace_id_4ca59d05 ON issue_mentions USING btree (workspace_id);
--
-- Name: issue_parent_id_ce8d76ba; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_parent_id_ce8d76ba ON issues USING btree (parent_id);
--
-- Name: issue_project_id_fea0fc80; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_project_id_fea0fc80 ON issues USING btree (project_id);
--
-- Name: issue_property_created_by_id_8e92131c; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_property_created_by_id_8e92131c ON issue_properties USING btree (created_by_id);
--
-- Name: issue_property_project_id_30e7de7b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_property_project_id_30e7de7b ON issue_properties USING btree (project_id);
--
-- Name: issue_property_updated_by_id_ff158d4d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_property_updated_by_id_ff158d4d ON issue_properties USING btree (updated_by_id);
--
-- Name: issue_property_user_id_0b1d1c8f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_property_user_id_0b1d1c8f ON issue_properties USING btree (user_id);
--
-- Name: issue_property_workspace_id_17860d65; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_property_workspace_id_17860d65 ON issue_properties USING btree (workspace_id);
--
-- Name: issue_reactions_actor_id_5f5b8303; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_reactions_actor_id_5f5b8303 ON issue_reactions USING btree (actor_id);
--
-- Name: issue_reactions_created_by_id_3953b7de; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_reactions_created_by_id_3953b7de ON issue_reactions USING btree (created_by_id);
--
-- Name: issue_reactions_issue_id_2c324bae; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_reactions_issue_id_2c324bae ON issue_reactions USING btree (issue_id);
--
-- Name: issue_reactions_project_id_8708ecaf; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_reactions_project_id_8708ecaf ON issue_reactions USING btree (project_id);
--
-- Name: issue_reactions_updated_by_id_4069af90; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_reactions_updated_by_id_4069af90 ON issue_reactions USING btree (updated_by_id);
--
-- Name: issue_reactions_workspace_id_bd8d7550; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_reactions_workspace_id_bd8d7550 ON issue_reactions USING btree (workspace_id);
--
-- Name: issue_relations_created_by_id_854d07e7; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_relations_created_by_id_854d07e7 ON issue_relations USING btree (created_by_id);
--
-- Name: issue_relations_issue_id_e1db6f72; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_relations_issue_id_e1db6f72 ON issue_relations USING btree (issue_id);
--
-- Name: issue_relations_project_id_15350161; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_relations_project_id_15350161 ON issue_relations USING btree (project_id);
--
-- Name: issue_relations_related_issue_id_e1ea44a7; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_relations_related_issue_id_e1ea44a7 ON issue_relations USING btree (related_issue_id);
--
-- Name: issue_relations_updated_by_id_3dfa850f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_relations_updated_by_id_3dfa850f ON issue_relations USING btree (updated_by_id);
--
-- Name: issue_relations_workspace_id_00b50e90; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_relations_workspace_id_00b50e90 ON issue_relations USING btree (workspace_id);
--
-- Name: issue_sequence_created_by_id_59270506; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_sequence_created_by_id_59270506 ON issue_sequences USING btree (created_by_id);
--
-- Name: issue_sequence_issue_id_16e9f00f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_sequence_issue_id_16e9f00f ON issue_sequences USING btree (issue_id);
--
-- Name: issue_sequence_project_id_ce882e85; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_sequence_project_id_ce882e85 ON issue_sequences USING btree (project_id);
--
-- Name: issue_sequence_updated_by_id_310c8dd3; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_sequence_updated_by_id_310c8dd3 ON issue_sequences USING btree (updated_by_id);
--
-- Name: issue_sequence_workspace_id_0d3f0fd4; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_sequence_workspace_id_0d3f0fd4 ON issue_sequences USING btree (workspace_id);
--
-- Name: issue_state_id_1a65560d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_state_id_1a65560d ON issues USING btree (state_id);
--
-- Name: issue_subscribers_created_by_id_b6ea0157; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_subscribers_created_by_id_b6ea0157 ON issue_subscribers USING btree (created_by_id);
--
-- Name: issue_subscribers_issue_id_85cf2093; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_subscribers_issue_id_85cf2093 ON issue_subscribers USING btree (issue_id);
--
-- Name: issue_subscribers_project_id_cf48d75f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_subscribers_project_id_cf48d75f ON issue_subscribers USING btree (project_id);
--
-- Name: issue_subscribers_subscriber_id_2d89c988; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_subscribers_subscriber_id_2d89c988 ON issue_subscribers USING btree (subscriber_id);
--
-- Name: issue_subscribers_updated_by_id_1bfc2f55; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_subscribers_updated_by_id_1bfc2f55 ON issue_subscribers USING btree (updated_by_id);
--
-- Name: issue_subscribers_workspace_id_96afa91f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_subscribers_workspace_id_96afa91f ON issue_subscribers USING btree (workspace_id);
--
-- Name: issue_updated_by_id_f1261863; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_updated_by_id_f1261863 ON issues USING btree (updated_by_id);
--
-- Name: issue_views_created_by_id_0d2e456b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_views_created_by_id_0d2e456b ON issue_views USING btree (created_by_id);
--
-- Name: issue_views_project_id_55ee009f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_views_project_id_55ee009f ON issue_views USING btree (project_id);
--
-- Name: issue_views_updated_by_id_28cd9870; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_views_updated_by_id_28cd9870 ON issue_views USING btree (updated_by_id);
--
-- Name: issue_views_workspace_id_8785e03d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_views_workspace_id_8785e03d ON issue_views USING btree (workspace_id);
--
-- Name: issue_votes_actor_id_525cab61; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_votes_actor_id_525cab61 ON issue_votes USING btree (actor_id);
--
-- Name: issue_votes_created_by_id_86adcf5c; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_votes_created_by_id_86adcf5c ON issue_votes USING btree (created_by_id);
--
-- Name: issue_votes_issue_id_07a61ecb; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_votes_issue_id_07a61ecb ON issue_votes USING btree (issue_id);
--
-- Name: issue_votes_project_id_b649f55b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_votes_project_id_b649f55b ON issue_votes USING btree (project_id);
--
-- Name: issue_votes_updated_by_id_9e2a6cdc; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_votes_updated_by_id_9e2a6cdc ON issue_votes USING btree (updated_by_id);
--
-- Name: issue_votes_workspace_id_a3e91a6b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_votes_workspace_id_a3e91a6b ON issue_votes USING btree (workspace_id);
--
-- Name: issue_workspace_id_c84878c1; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX issue_workspace_id_c84878c1 ON issues USING btree (workspace_id);
--
-- Name: label_created_by_id_aa6ffcfa; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX label_created_by_id_aa6ffcfa ON labels USING btree (created_by_id);
--
-- Name: label_parent_id_7a853296; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX label_parent_id_7a853296 ON labels USING btree (parent_id);
--
-- Name: label_project_id_90e0f1a2; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX label_project_id_90e0f1a2 ON labels USING btree (project_id);
--
-- Name: label_updated_by_id_894a5464; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX label_updated_by_id_894a5464 ON labels USING btree (updated_by_id);
--
-- Name: label_workspace_id_c4c9ae5a; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX label_workspace_id_c4c9ae5a ON labels USING btree (workspace_id);
--
-- Name: module_created_by_id_ff7a5866; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_created_by_id_ff7a5866 ON modules USING btree (created_by_id);
--
-- Name: module_favorites_created_by_id_7f84820d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_favorites_created_by_id_7f84820d ON module_favorites USING btree (created_by_id);
--
-- Name: module_favorites_module_id_c4f0736b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_favorites_module_id_c4f0736b ON module_favorites USING btree (module_id);
--
-- Name: module_favorites_project_id_83d9d9e8; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_favorites_project_id_83d9d9e8 ON module_favorites USING btree (project_id);
--
-- Name: module_favorites_updated_by_id_2437fed0; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_favorites_updated_by_id_2437fed0 ON module_favorites USING btree (updated_by_id);
--
-- Name: module_favorites_user_id_c5b76375; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_favorites_user_id_c5b76375 ON module_favorites USING btree (user_id);
--
-- Name: module_favorites_workspace_id_65a4ac6f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_favorites_workspace_id_65a4ac6f ON module_favorites USING btree (workspace_id);
--
-- Name: module_issues_created_by_id_de0b995a; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_issues_created_by_id_de0b995a ON module_issues USING btree (created_by_id);
--
-- Name: module_issues_module_id_74e0ed5a; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_issues_module_id_74e0ed5a ON module_issues USING btree (module_id);
--
-- Name: module_issues_project_id_59836d1e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_issues_project_id_59836d1e ON module_issues USING btree (project_id);
--
-- Name: module_issues_updated_by_id_46dbf724; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_issues_updated_by_id_46dbf724 ON module_issues USING btree (updated_by_id);
--
-- Name: module_issues_workspace_id_6bf85201; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_issues_workspace_id_6bf85201 ON module_issues USING btree (workspace_id);
--
-- Name: module_lead_id_04966630; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_lead_id_04966630 ON modules USING btree (lead_id);
--
-- Name: module_links_created_by_id_eaf6492f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_links_created_by_id_eaf6492f ON module_links USING btree (created_by_id);
--
-- Name: module_links_module_id_0fda3f8a; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_links_module_id_0fda3f8a ON module_links USING btree (module_id);
--
-- Name: module_links_project_id_f720bb79; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_links_project_id_f720bb79 ON module_links USING btree (project_id);
--
-- Name: module_links_updated_by_id_4da419e7; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_links_updated_by_id_4da419e7 ON module_links USING btree (updated_by_id);
--
-- Name: module_links_workspace_id_0521c11c; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_links_workspace_id_0521c11c ON module_links USING btree (workspace_id);
--
-- Name: module_member_created_by_id_2ed84a65; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_member_created_by_id_2ed84a65 ON module_members USING btree (created_by_id);
--
-- Name: module_member_member_id_928f473e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_member_member_id_928f473e ON module_members USING btree (member_id);
--
-- Name: module_member_module_id_f00be7ef; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_member_module_id_f00be7ef ON module_members USING btree (module_id);
--
-- Name: module_member_project_id_ec8d2376; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_member_project_id_ec8d2376 ON module_members USING btree (project_id);
--
-- Name: module_member_updated_by_id_a9046438; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_member_updated_by_id_a9046438 ON module_members USING btree (updated_by_id);
--
-- Name: module_member_workspace_id_f2f23c73; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_member_workspace_id_f2f23c73 ON module_members USING btree (workspace_id);
--
-- Name: module_project_id_da84b04f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_project_id_da84b04f ON modules USING btree (project_id);
--
-- Name: module_updated_by_id_72ab6d5c; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_updated_by_id_72ab6d5c ON modules USING btree (updated_by_id);
--
-- Name: module_workspace_id_0a826fef; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX module_workspace_id_0a826fef ON modules USING btree (workspace_id);
--
-- Name: notifications_created_by_id_b9c3f81b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX notifications_created_by_id_b9c3f81b ON notifications USING btree (created_by_id);
--
-- Name: notifications_project_id_e4d4f192; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX notifications_project_id_e4d4f192 ON notifications USING btree (project_id);
--
-- Name: notifications_receiver_id_b708b2b0; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX notifications_receiver_id_b708b2b0 ON notifications USING btree (receiver_id);
--
-- Name: notifications_triggered_by_id_31cdec21; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX notifications_triggered_by_id_31cdec21 ON notifications USING btree (triggered_by_id);
--
-- Name: notifications_updated_by_id_8a651e96; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX notifications_updated_by_id_8a651e96 ON notifications USING btree (updated_by_id);
--
-- Name: notifications_workspace_id_b2f09ef7; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX notifications_workspace_id_b2f09ef7 ON notifications USING btree (workspace_id);
--
-- Name: page_blocks_created_by_id_696391e1; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_blocks_created_by_id_696391e1 ON page_blocks USING btree (created_by_id);
--
-- Name: page_blocks_issue_id_33cad86b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_blocks_issue_id_33cad86b ON page_blocks USING btree (issue_id);
--
-- Name: page_blocks_page_id_5f55e114; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_blocks_page_id_5f55e114 ON page_blocks USING btree (page_id);
--
-- Name: page_blocks_project_id_068d80f7; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_blocks_project_id_068d80f7 ON page_blocks USING btree (project_id);
--
-- Name: page_blocks_updated_by_id_1a29acb7; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_blocks_updated_by_id_1a29acb7 ON page_blocks USING btree (updated_by_id);
--
-- Name: page_blocks_workspace_id_b051825d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_blocks_workspace_id_b051825d ON page_blocks USING btree (workspace_id);
--
-- Name: page_favorites_created_by_id_3b672270; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_favorites_created_by_id_3b672270 ON page_favorites USING btree (created_by_id);
--
-- Name: page_favorites_page_id_0896034b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_favorites_page_id_0896034b ON page_favorites USING btree (page_id);
--
-- Name: page_favorites_project_id_e0e3c871; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_favorites_project_id_e0e3c871 ON page_favorites USING btree (project_id);
--
-- Name: page_favorites_updated_by_id_623c7ac5; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_favorites_updated_by_id_623c7ac5 ON page_favorites USING btree (updated_by_id);
--
-- Name: page_favorites_user_id_162640a9; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_favorites_user_id_162640a9 ON page_favorites USING btree (user_id);
--
-- Name: page_favorites_workspace_id_4b7858d9; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_favorites_workspace_id_4b7858d9 ON page_favorites USING btree (workspace_id);
--
-- Name: page_labels_created_by_id_fbd942c0; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_labels_created_by_id_fbd942c0 ON page_labels USING btree (created_by_id);
--
-- Name: page_labels_label_id_05958e53; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_labels_label_id_05958e53 ON page_labels USING btree (label_id);
--
-- Name: page_labels_page_id_0e6cdb3d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_labels_page_id_0e6cdb3d ON page_labels USING btree (page_id);
--
-- Name: page_labels_project_id_938a63ca; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_labels_project_id_938a63ca ON page_labels USING btree (project_id);
--
-- Name: page_labels_updated_by_id_d9fddbff; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_labels_updated_by_id_d9fddbff ON page_labels USING btree (updated_by_id);
--
-- Name: page_labels_workspace_id_078bb01c; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_labels_workspace_id_078bb01c ON page_labels USING btree (workspace_id);
--
-- Name: page_logs_created_by_id_4a295aec; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_logs_created_by_id_4a295aec ON page_logs USING btree (created_by_id);
--
-- Name: page_logs_page_id_0e0d747d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_logs_page_id_0e0d747d ON page_logs USING btree (page_id);
--
-- Name: page_logs_project_id_d5117f7a; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_logs_project_id_d5117f7a ON page_logs USING btree (project_id);
--
-- Name: page_logs_updated_by_id_1995190b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_logs_updated_by_id_1995190b ON page_logs USING btree (updated_by_id);
--
-- Name: page_logs_workspace_id_be7bde64; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX page_logs_workspace_id_be7bde64 ON page_logs USING btree (workspace_id);
--
-- Name: pages_created_by_id_d109a675; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX pages_created_by_id_d109a675 ON pages USING btree (created_by_id);
--
-- Name: pages_owned_by_id_bf50485f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX pages_owned_by_id_bf50485f ON pages USING btree (owned_by_id);
--
-- Name: pages_parent_id_8b823409; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX pages_parent_id_8b823409 ON pages USING btree (parent_id);
--
-- Name: pages_project_id_272eed09; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX pages_project_id_272eed09 ON pages USING btree (project_id);
--
-- Name: pages_updated_by_id_6c42de3e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX pages_updated_by_id_6c42de3e ON pages USING btree (updated_by_id);
--
-- Name: pages_workspace_id_c6c51010; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX pages_workspace_id_c6c51010 ON pages USING btree (workspace_id);
--
-- Name: project_created_by_id_6cc13408; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_created_by_id_6cc13408 ON projects USING btree (created_by_id);
--
-- Name: project_default_assignee_id_6ba45f90; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_default_assignee_id_6ba45f90 ON projects USING btree (default_assignee_id);
--
-- Name: project_deploy_boards_anchor_b61b8817_like; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_deploy_boards_anchor_b61b8817_like ON project_deploy_boards USING btree (anchor varchar_pattern_ops);
--
-- Name: project_deploy_boards_created_by_id_2ea72f98; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_deploy_boards_created_by_id_2ea72f98 ON project_deploy_boards USING btree (created_by_id);
--
-- Name: project_deploy_boards_inbox_id_a6a75525; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_deploy_boards_inbox_id_a6a75525 ON project_deploy_boards USING btree (inbox_id);
--
-- Name: project_deploy_boards_project_id_49d887b2; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_deploy_boards_project_id_49d887b2 ON project_deploy_boards USING btree (project_id);
--
-- Name: project_deploy_boards_updated_by_id_290eb99e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_deploy_boards_updated_by_id_290eb99e ON project_deploy_boards USING btree (updated_by_id);
--
-- Name: project_deploy_boards_workspace_id_cd92f164; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_deploy_boards_workspace_id_cd92f164 ON project_deploy_boards USING btree (workspace_id);
--
-- Name: project_favorites_created_by_id_613c0717; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_favorites_created_by_id_613c0717 ON project_favorites USING btree (created_by_id);
--
-- Name: project_favorites_project_id_df76634d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_favorites_project_id_df76634d ON project_favorites USING btree (project_id);
--
-- Name: project_favorites_updated_by_id_2a663e4d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_favorites_updated_by_id_2a663e4d ON project_favorites USING btree (updated_by_id);
--
-- Name: project_favorites_user_id_500f4f5b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_favorites_user_id_500f4f5b ON project_favorites USING btree (user_id);
--
-- Name: project_favorites_workspace_id_fa980513; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_favorites_workspace_id_fa980513 ON project_favorites USING btree (workspace_id);
--
-- Name: project_identifier_created_by_id_2b6f273a; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_identifier_created_by_id_2b6f273a ON project_identifiers USING btree (created_by_id);
--
-- Name: project_identifier_updated_by_id_1a00e2a0; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_identifier_updated_by_id_1a00e2a0 ON project_identifiers USING btree (updated_by_id);
--
-- Name: project_identifier_workspace_id_6024b517; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_identifier_workspace_id_6024b517 ON project_identifiers USING btree (workspace_id);
--
-- Name: project_member_created_by_id_8b363306; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_member_created_by_id_8b363306 ON project_members USING btree (created_by_id);
--
-- Name: project_member_invite_created_by_id_a87df45c; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_member_invite_created_by_id_a87df45c ON project_member_invites USING btree (created_by_id);
--
-- Name: project_member_invite_project_id_8fb7750e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_member_invite_project_id_8fb7750e ON project_member_invites USING btree (project_id);
--
-- Name: project_member_invite_updated_by_id_5aa55c96; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_member_invite_updated_by_id_5aa55c96 ON project_member_invites USING btree (updated_by_id);
--
-- Name: project_member_invite_workspace_id_64e2dc4c; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_member_invite_workspace_id_64e2dc4c ON project_member_invites USING btree (workspace_id);
--
-- Name: project_member_member_id_9d6b126b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_member_member_id_9d6b126b ON project_members USING btree (member_id);
--
-- Name: project_member_project_id_11ea1a9e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_member_project_id_11ea1a9e ON project_members USING btree (project_id);
--
-- Name: project_member_updated_by_id_cf6aaac4; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_member_updated_by_id_cf6aaac4 ON project_members USING btree (updated_by_id);
--
-- Name: project_member_workspace_id_88bb9a97; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_member_workspace_id_88bb9a97 ON project_members USING btree (workspace_id);
--
-- Name: project_project_lead_id_caf8e353; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_project_lead_id_caf8e353 ON projects USING btree (project_lead_id);
--
-- Name: project_public_members_created_by_id_c4c7c776; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_public_members_created_by_id_c4c7c776 ON project_public_members USING btree (created_by_id);
--
-- Name: project_public_members_member_id_52f257f9; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_public_members_member_id_52f257f9 ON project_public_members USING btree (member_id);
--
-- Name: project_public_members_project_id_2dfd893d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_public_members_project_id_2dfd893d ON project_public_members USING btree (project_id);
--
-- Name: project_public_members_updated_by_id_c3e4d675; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_public_members_updated_by_id_c3e4d675 ON project_public_members USING btree (updated_by_id);
--
-- Name: project_public_members_workspace_id_ebfce110; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_public_members_workspace_id_ebfce110 ON project_public_members USING btree (workspace_id);
--
-- Name: project_updated_by_id_fe290525; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_updated_by_id_fe290525 ON projects USING btree (updated_by_id);
--
-- Name: project_workspace_id_01764ff9; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX project_workspace_id_01764ff9 ON projects USING btree (workspace_id);
--
-- Name: projects_default_state_id_f13e8b95; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX projects_default_state_id_f13e8b95 ON projects USING btree (default_state_id);
--
-- Name: projects_estimate_id_85c7b2ac; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX projects_estimate_id_85c7b2ac ON projects USING btree (estimate_id);
--
-- Name: slack_project_syncs_created_by_id_ec405a17; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX slack_project_syncs_created_by_id_ec405a17 ON slack_project_syncs USING btree (created_by_id);
--
-- Name: slack_project_syncs_project_id_016dc792; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX slack_project_syncs_project_id_016dc792 ON slack_project_syncs USING btree (project_id);
--
-- Name: slack_project_syncs_updated_by_id_152eb3b5; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX slack_project_syncs_updated_by_id_152eb3b5 ON slack_project_syncs USING btree (updated_by_id);
--
-- Name: slack_project_syncs_workspace_id_d1822b06; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX slack_project_syncs_workspace_id_d1822b06 ON slack_project_syncs USING btree (workspace_id);
--
-- Name: slack_project_syncs_workspace_integration_id_d89c9b40; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX slack_project_syncs_workspace_integration_id_d89c9b40 ON slack_project_syncs USING btree (workspace_integration_id);
--
-- Name: social_login_connection_created_by_id_7ca2ef50; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX social_login_connection_created_by_id_7ca2ef50 ON social_login_connections USING btree (created_by_id);
--
-- Name: social_login_connection_updated_by_id_c13deb42; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX social_login_connection_updated_by_id_c13deb42 ON social_login_connections USING btree (updated_by_id);
--
-- Name: social_login_connection_user_id_0e26c0c5; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX social_login_connection_user_id_0e26c0c5 ON social_login_connections USING btree (user_id);
--
-- Name: state_created_by_id_ff51a50d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX state_created_by_id_ff51a50d ON states USING btree (created_by_id);
--
-- Name: state_project_id_23a65fd6; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX state_project_id_23a65fd6 ON states USING btree (project_id);
--
-- Name: state_slug_bab0af35; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX state_slug_bab0af35 ON states USING btree (slug);
--
-- Name: state_slug_bab0af35_like; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX state_slug_bab0af35_like ON states USING btree (slug varchar_pattern_ops);
--
-- Name: state_updated_by_id_be298453; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX state_updated_by_id_be298453 ON states USING btree (updated_by_id);
--
-- Name: state_workspace_id_2293282d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX state_workspace_id_2293282d ON states USING btree (workspace_id);
--
-- Name: team_created_by_id_725a9101; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX team_created_by_id_725a9101 ON teams USING btree (created_by_id);
--
-- Name: team_member_created_by_id_7cc0ad68; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX team_member_created_by_id_7cc0ad68 ON team_members USING btree (created_by_id);
--
-- Name: team_member_member_id_905a2628; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX team_member_member_id_905a2628 ON team_members USING btree (member_id);
--
-- Name: team_member_team_id_26812b86; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX team_member_team_id_26812b86 ON team_members USING btree (team_id);
--
-- Name: team_member_updated_by_id_b1d37059; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX team_member_updated_by_id_b1d37059 ON team_members USING btree (updated_by_id);
--
-- Name: team_member_workspace_id_5e13a185; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX team_member_workspace_id_5e13a185 ON team_members USING btree (workspace_id);
--
-- Name: team_updated_by_id_79bb36f2; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX team_updated_by_id_79bb36f2 ON teams USING btree (updated_by_id);
--
-- Name: team_workspace_id_1d56407f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX team_workspace_id_1d56407f ON teams USING btree (workspace_id);
--
-- Name: token_blacklist_outstandingtoken_jti_hex_d9bdf6f7_like; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX token_blacklist_outstandingtoken_jti_hex_d9bdf6f7_like ON token_blacklist_outstandingtoken USING btree (jti varchar_pattern_ops);
--
-- Name: token_blacklist_outstandingtoken_user_id_83bc629a; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX token_blacklist_outstandingtoken_user_id_83bc629a ON token_blacklist_outstandingtoken USING btree (user_id);
--
-- Name: user_email_54dc62b2_like; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX user_email_54dc62b2_like ON users USING btree (email varchar_pattern_ops);
--
-- Name: user_groups_group_id_b76f8aba; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX user_groups_group_id_b76f8aba ON users_groups USING btree (group_id);
--
-- Name: user_groups_user_id_abaea130; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX user_groups_user_id_abaea130 ON users_groups USING btree (user_id);
--
-- Name: user_user_permissions_permission_id_9deb68a3; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX user_user_permissions_permission_id_9deb68a3 ON users_user_permissions USING btree (permission_id);
--
-- Name: user_user_permissions_user_id_ed4a47ea; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX user_user_permissions_user_id_ed4a47ea ON users_user_permissions USING btree (user_id);
--
-- Name: user_username_cf016618_like; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX user_username_cf016618_like ON users USING btree (username varchar_pattern_ops);
--
-- Name: view_favorites_created_by_id_dc6047f5; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX view_favorites_created_by_id_dc6047f5 ON view_favorites USING btree (created_by_id);
--
-- Name: view_favorites_project_id_241c521d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX view_favorites_project_id_241c521d ON view_favorites USING btree (project_id);
--
-- Name: view_favorites_updated_by_id_2418b683; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX view_favorites_updated_by_id_2418b683 ON view_favorites USING btree (updated_by_id);
--
-- Name: view_favorites_user_id_b1e94c2e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX view_favorites_user_id_b1e94c2e ON view_favorites USING btree (user_id);
--
-- Name: view_favorites_view_id_3111e893; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX view_favorites_view_id_3111e893 ON view_favorites USING btree (view_id);
--
-- Name: view_favorites_workspace_id_3dbdd2a2; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX view_favorites_workspace_id_3dbdd2a2 ON view_favorites USING btree (workspace_id);
--
-- Name: webhook_logs_created_by_id_71e7bc38; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX webhook_logs_created_by_id_71e7bc38 ON webhook_logs USING btree (created_by_id);
--
-- Name: webhook_logs_updated_by_id_3d9bad04; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX webhook_logs_updated_by_id_3d9bad04 ON webhook_logs USING btree (updated_by_id);
--
-- Name: webhook_logs_webhook_id_53707b3d; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX webhook_logs_webhook_id_53707b3d ON webhook_logs USING btree (webhook_id);
--
-- Name: webhook_logs_workspace_id_ffcd0e31; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX webhook_logs_workspace_id_ffcd0e31 ON webhook_logs USING btree (workspace_id);
--
-- Name: webhooks_created_by_id_25aca1b0; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX webhooks_created_by_id_25aca1b0 ON webhooks USING btree (created_by_id);
--
-- Name: webhooks_updated_by_id_ea35154e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX webhooks_updated_by_id_ea35154e ON webhooks USING btree (updated_by_id);
--
-- Name: webhooks_workspace_id_da5865d7; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX webhooks_workspace_id_da5865d7 ON webhooks USING btree (workspace_id);
--
-- Name: workspace_created_by_id_10ad894e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_created_by_id_10ad894e ON workspaces USING btree (created_by_id);
--
-- Name: workspace_integrations_actor_id_21619aa1; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_integrations_actor_id_21619aa1 ON workspace_integrations USING btree (actor_id);
--
-- Name: workspace_integrations_api_token_id_bdb1759b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_integrations_api_token_id_bdb1759b ON workspace_integrations USING btree (api_token_id);
--
-- Name: workspace_integrations_created_by_id_37639c73; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_integrations_created_by_id_37639c73 ON workspace_integrations USING btree (created_by_id);
--
-- Name: workspace_integrations_integration_id_6cb0aace; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_integrations_integration_id_6cb0aace ON workspace_integrations USING btree (integration_id);
--
-- Name: workspace_integrations_updated_by_id_fce01dcb; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_integrations_updated_by_id_fce01dcb ON workspace_integrations USING btree (updated_by_id);
--
-- Name: workspace_integrations_workspace_id_27ebeb6b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_integrations_workspace_id_27ebeb6b ON workspace_integrations USING btree (workspace_id);
--
-- Name: workspace_member_created_by_id_8dc8b040; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_member_created_by_id_8dc8b040 ON workspace_members USING btree (created_by_id);
--
-- Name: workspace_member_invite_created_by_id_082f21d3; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_member_invite_created_by_id_082f21d3 ON workspace_member_invites USING btree (created_by_id);
--
-- Name: workspace_member_invite_updated_by_id_d31a9c7f; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_member_invite_updated_by_id_d31a9c7f ON workspace_member_invites USING btree (updated_by_id);
--
-- Name: workspace_member_invite_workspace_id_d935b364; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_member_invite_workspace_id_d935b364 ON workspace_member_invites USING btree (workspace_id);
--
-- Name: workspace_member_member_id_824f5497; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_member_member_id_824f5497 ON workspace_members USING btree (member_id);
--
-- Name: workspace_member_updated_by_id_1cec0062; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_member_updated_by_id_1cec0062 ON workspace_members USING btree (updated_by_id);
--
-- Name: workspace_member_workspace_id_33f66d4b; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_member_workspace_id_33f66d4b ON workspace_members USING btree (workspace_id);
--
-- Name: workspace_owner_id_60a8bafc; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_owner_id_60a8bafc ON workspaces USING btree (owner_id);
--
-- Name: workspace_slug_4d89d459_like; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_slug_4d89d459_like ON workspaces USING btree (slug varchar_pattern_ops);
--
-- Name: workspace_themes_actor_id_0e94172e; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_themes_actor_id_0e94172e ON workspace_themes USING btree (actor_id);
--
-- Name: workspace_themes_created_by_id_676e2655; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_themes_created_by_id_676e2655 ON workspace_themes USING btree (created_by_id);
--
-- Name: workspace_themes_updated_by_id_bba863fe; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_themes_updated_by_id_bba863fe ON workspace_themes USING btree (updated_by_id);
--
-- Name: workspace_themes_workspace_id_d1bffad8; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_themes_workspace_id_d1bffad8 ON workspace_themes USING btree (workspace_id);
--
-- Name: workspace_updated_by_id_09d249ed; Type: INDEX; Schema: public; Owner: plane
--

CREATE INDEX workspace_updated_by_id_09d249ed ON workspaces USING btree (updated_by_id);
--
-- Name: analytic_views analytic_views_created_by_id_1b3ca0a9_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY analytic_views
    ADD CONSTRAINT analytic_views_created_by_id_1b3ca0a9_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: analytic_views analytic_views_updated_by_id_b6d827e1_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY analytic_views
    ADD CONSTRAINT analytic_views_updated_by_id_b6d827e1_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: analytic_views analytic_views_workspace_id_ca6e5c0b_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY analytic_views
    ADD CONSTRAINT analytic_views_workspace_id_ca6e5c0b_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: api_activity_logs [REDACTED] Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY api_activity_logs
    ADD CONSTRAINT [REDACTED]FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: api_activity_logs [REDACTED] Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY api_activity_logs
    ADD CONSTRAINT [REDACTED]FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: api_tokens [REDACTED] Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY api_tokens
    ADD CONSTRAINT [REDACTED]FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: api_tokens [REDACTED] Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY api_tokens
    ADD CONSTRAINT [REDACTED]FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: api_tokens [REDACTED] Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY api_tokens
    ADD CONSTRAINT [REDACTED]FOREIGN KEY (user_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: api_tokens [REDACTED] Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY api_tokens
    ADD CONSTRAINT [REDACTED]FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: auth_group_permissions auth_group_permissio_permission_id_84c5c92e_fk_auth_perm; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY auth_group_permissions
    ADD CONSTRAINT auth_group_permissio_permission_id_84c5c92e_fk_auth_perm FOREIGN KEY (permission_id) REFERENCES auth_permission(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: auth_group_permissions auth_group_permissions_group_id_b120cbf9_fk_auth_group_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY auth_group_permissions
    ADD CONSTRAINT auth_group_permissions_group_id_b120cbf9_fk_auth_group_id FOREIGN KEY (group_id) REFERENCES auth_group(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: auth_permission auth_permission_content_type_id_2f476e4b_fk_django_co; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY auth_permission
    ADD CONSTRAINT auth_permission_content_type_id_2f476e4b_fk_django_co FOREIGN KEY (content_type_id) REFERENCES django_content_type(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: authtoken_token authtoken_token_user_id_35299eff_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY authtoken_token
    ADD CONSTRAINT authtoken_token_user_id_35299eff_fk_user_id FOREIGN KEY (user_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: comment_reactions comment_reactions_actor_id_21219e9c_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY comment_reactions
    ADD CONSTRAINT comment_reactions_actor_id_21219e9c_fk_users_id FOREIGN KEY (actor_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: comment_reactions comment_reactions_comment_id_87c59446_fk_issue_comments_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY comment_reactions
    ADD CONSTRAINT comment_reactions_comment_id_87c59446_fk_issue_comments_id FOREIGN KEY (comment_id) REFERENCES issue_comments(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: comment_reactions comment_reactions_created_by_id_9aeb43c4_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY comment_reactions
    ADD CONSTRAINT comment_reactions_created_by_id_9aeb43c4_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: comment_reactions comment_reactions_project_id_ab9114b4_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY comment_reactions
    ADD CONSTRAINT comment_reactions_project_id_ab9114b4_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: comment_reactions comment_reactions_updated_by_id_c74c9bbd_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY comment_reactions
    ADD CONSTRAINT comment_reactions_updated_by_id_c74c9bbd_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: comment_reactions comment_reactions_workspace_id_b614ca4f_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY comment_reactions
    ADD CONSTRAINT comment_reactions_workspace_id_b614ca4f_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycles cycle_created_by_id_78e43b79_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycles
    ADD CONSTRAINT cycle_created_by_id_78e43b79_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycle_favorites cycle_favorites_created_by_id_e888870b_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycle_favorites
    ADD CONSTRAINT cycle_favorites_created_by_id_e888870b_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycle_favorites cycle_favorites_cycle_id_8224e5ad_fk_cycles_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycle_favorites
    ADD CONSTRAINT cycle_favorites_cycle_id_8224e5ad_fk_cycles_id FOREIGN KEY (cycle_id) REFERENCES cycles(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycle_favorites cycle_favorites_project_id_f2977b66_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycle_favorites
    ADD CONSTRAINT cycle_favorites_project_id_f2977b66_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycle_favorites cycle_favorites_updated_by_id_8576232f_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycle_favorites
    ADD CONSTRAINT cycle_favorites_updated_by_id_8576232f_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycle_favorites cycle_favorites_user_id_8a04268d_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycle_favorites
    ADD CONSTRAINT cycle_favorites_user_id_8a04268d_fk_users_id FOREIGN KEY (user_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycle_favorites cycle_favorites_workspace_id_07359b0b_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycle_favorites
    ADD CONSTRAINT cycle_favorites_workspace_id_07359b0b_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycle_issues cycle_issue_created_by_id_30b27539_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycle_issues
    ADD CONSTRAINT cycle_issue_created_by_id_30b27539_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycle_issues cycle_issue_cycle_id_ec681215_fk_cycle_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycle_issues
    ADD CONSTRAINT cycle_issue_cycle_id_ec681215_fk_cycle_id FOREIGN KEY (cycle_id) REFERENCES cycles(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycle_issues cycle_issue_issue_id_fd06e284_fk_issue_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycle_issues
    ADD CONSTRAINT cycle_issue_issue_id_fd06e284_fk_issue_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycle_issues cycle_issue_project_id_6ad3257a_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycle_issues
    ADD CONSTRAINT cycle_issue_project_id_6ad3257a_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycle_issues cycle_issue_updated_by_id_cb4516f2_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycle_issues
    ADD CONSTRAINT cycle_issue_updated_by_id_cb4516f2_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycle_issues cycle_issue_workspace_id_1d77330e_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycle_issues
    ADD CONSTRAINT cycle_issue_workspace_id_1d77330e_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycles cycle_owned_by_id_5456a4d1_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycles
    ADD CONSTRAINT cycle_owned_by_id_5456a4d1_fk_user_id FOREIGN KEY (owned_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycles cycle_project_id_0b590349_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycles
    ADD CONSTRAINT cycle_project_id_0b590349_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycles cycle_updated_by_id_93baee43_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycles
    ADD CONSTRAINT cycle_updated_by_id_93baee43_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: cycles cycle_workspace_id_a199e8e1_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY cycles
    ADD CONSTRAINT cycle_workspace_id_a199e8e1_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: django_celery_beat_periodictask django_celery_beat_p_clocked_id_47a69f82_fk_django_ce; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY django_celery_beat_periodictask
    ADD CONSTRAINT django_celery_beat_p_clocked_id_47a69f82_fk_django_ce FOREIGN KEY (clocked_id) REFERENCES django_celery_beat_clockedschedule(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: django_celery_beat_periodictask django_celery_beat_p_crontab_id_d3cba168_fk_django_ce; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY django_celery_beat_periodictask
    ADD CONSTRAINT django_celery_beat_p_crontab_id_d3cba168_fk_django_ce FOREIGN KEY (crontab_id) REFERENCES django_celery_beat_crontabschedule(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: django_celery_beat_periodictask django_celery_beat_p_interval_id_a8ca27da_fk_django_ce; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY django_celery_beat_periodictask
    ADD CONSTRAINT django_celery_beat_p_interval_id_a8ca27da_fk_django_ce FOREIGN KEY (interval_id) REFERENCES django_celery_beat_intervalschedule(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: django_celery_beat_periodictask django_celery_beat_p_solar_id_a87ce72c_fk_django_ce; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY django_celery_beat_periodictask
    ADD CONSTRAINT django_celery_beat_p_solar_id_a87ce72c_fk_django_ce FOREIGN KEY (solar_id) REFERENCES django_celery_beat_solarschedule(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: estimate_points estimate_points_created_by_id_d1b04bd9_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY estimate_points
    ADD CONSTRAINT estimate_points_created_by_id_d1b04bd9_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: estimate_points estimate_points_estimate_id_4b4cb706_fk_estimates_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY estimate_points
    ADD CONSTRAINT estimate_points_estimate_id_4b4cb706_fk_estimates_id FOREIGN KEY (estimate_id) REFERENCES estimates(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: estimate_points estimate_points_project_id_ba9bcb2c_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY estimate_points
    ADD CONSTRAINT estimate_points_project_id_ba9bcb2c_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: estimate_points estimate_points_updated_by_id_a1da94e1_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY estimate_points
    ADD CONSTRAINT estimate_points_updated_by_id_a1da94e1_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: estimate_points estimate_points_workspace_id_96fc4f92_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY estimate_points
    ADD CONSTRAINT estimate_points_workspace_id_96fc4f92_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: estimates estimates_created_by_id_7e401493_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY estimates
    ADD CONSTRAINT estimates_created_by_id_7e401493_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: estimates estimates_project_id_7f195a41_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY estimates
    ADD CONSTRAINT estimates_project_id_7f195a41_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: estimates estimates_updated_by_id_b3fcfb1d_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY estimates
    ADD CONSTRAINT estimates_updated_by_id_b3fcfb1d_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: estimates estimates_workspace_id_718811eb_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY estimates
    ADD CONSTRAINT estimates_workspace_id_718811eb_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: exporters exporters_created_by_id_44e1d9b3_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY exporters
    ADD CONSTRAINT exporters_created_by_id_44e1d9b3_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: exporters exporters_initiated_by_id_d51f7552_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY exporters
    ADD CONSTRAINT exporters_initiated_by_id_d51f7552_fk_users_id FOREIGN KEY (initiated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: exporters exporters_updated_by_id_d2572861_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY exporters
    ADD CONSTRAINT exporters_updated_by_id_d2572861_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: exporters exporters_workspace_id_11a04317_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY exporters
    ADD CONSTRAINT exporters_workspace_id_11a04317_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: file_assets file_asset_created_by_id_966942a0_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY file_assets
    ADD CONSTRAINT file_asset_created_by_id_966942a0_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: file_assets file_asset_updated_by_id_d6aaf4f0_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY file_assets
    ADD CONSTRAINT file_asset_updated_by_id_d6aaf4f0_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: file_assets file_assets_workspace_id_fa50b9c5_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY file_assets
    ADD CONSTRAINT file_assets_workspace_id_fa50b9c5_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_comment_syncs github_comment_syncs_comment_id_6feec6d1_fk_issue_comments_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_comment_syncs
    ADD CONSTRAINT github_comment_syncs_comment_id_6feec6d1_fk_issue_comments_id FOREIGN KEY (comment_id) REFERENCES issue_comments(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_comment_syncs github_comment_syncs_created_by_id_b1ef2517_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_comment_syncs
    ADD CONSTRAINT github_comment_syncs_created_by_id_b1ef2517_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_comment_syncs github_comment_syncs_issue_sync_id_5e738eb5_fk_github_is; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_comment_syncs
    ADD CONSTRAINT github_comment_syncs_issue_sync_id_5e738eb5_fk_github_is FOREIGN KEY (issue_sync_id) REFERENCES github_issue_syncs(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_comment_syncs github_comment_syncs_project_id_6d199ace_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_comment_syncs
    ADD CONSTRAINT github_comment_syncs_project_id_6d199ace_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_comment_syncs github_comment_syncs_updated_by_id_bb05c066_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_comment_syncs
    ADD CONSTRAINT github_comment_syncs_updated_by_id_bb05c066_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_comment_syncs github_comment_syncs_workspace_id_b54528c8_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_comment_syncs
    ADD CONSTRAINT github_comment_syncs_workspace_id_b54528c8_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_issue_syncs github_issue_syncs_created_by_id_d02b7c56_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_issue_syncs
    ADD CONSTRAINT github_issue_syncs_created_by_id_d02b7c56_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_issue_syncs github_issue_syncs_issue_id_450cb083_fk_issues_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_issue_syncs
    ADD CONSTRAINT github_issue_syncs_issue_id_450cb083_fk_issues_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_issue_syncs github_issue_syncs_project_id_4609ad0c_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_issue_syncs
    ADD CONSTRAINT github_issue_syncs_project_id_4609ad0c_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_issue_syncs github_issue_syncs_repository_sync_id_ba0d4de4_fk_github_re; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_issue_syncs
    ADD CONSTRAINT github_issue_syncs_repository_sync_id_ba0d4de4_fk_github_re FOREIGN KEY (repository_sync_id) REFERENCES github_repository_syncs(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_issue_syncs github_issue_syncs_updated_by_id_e9cd6f86_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_issue_syncs
    ADD CONSTRAINT github_issue_syncs_updated_by_id_e9cd6f86_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_issue_syncs github_issue_syncs_workspace_id_eae020ad_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_issue_syncs
    ADD CONSTRAINT github_issue_syncs_workspace_id_eae020ad_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_repositories github_repositories_created_by_id_104fa685_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_repositories
    ADD CONSTRAINT github_repositories_created_by_id_104fa685_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_repositories github_repositories_project_id_65c546bb_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_repositories
    ADD CONSTRAINT github_repositories_project_id_65c546bb_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_repositories github_repositories_updated_by_id_8aa4d772_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_repositories
    ADD CONSTRAINT github_repositories_updated_by_id_8aa4d772_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_repositories github_repositories_workspace_id_c4de7326_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_repositories
    ADD CONSTRAINT github_repositories_workspace_id_c4de7326_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_repository_syncs github_repository_sy_repository_id_ead52404_fk_github_re; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_repository_syncs
    ADD CONSTRAINT github_repository_sy_repository_id_ead52404_fk_github_re FOREIGN KEY (repository_id) REFERENCES github_repositories(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_repository_syncs github_repository_sy_workspace_integratio_62858398_fk_workspace; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_repository_syncs
    ADD CONSTRAINT github_repository_sy_workspace_integratio_62858398_fk_workspace FOREIGN KEY (workspace_integration_id) REFERENCES workspace_integrations(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_repository_syncs github_repository_syncs_actor_id_1fa689fe_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_repository_syncs
    ADD CONSTRAINT github_repository_syncs_actor_id_1fa689fe_fk_users_id FOREIGN KEY (actor_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_repository_syncs github_repository_syncs_created_by_id_0df94495_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_repository_syncs
    ADD CONSTRAINT github_repository_syncs_created_by_id_0df94495_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_repository_syncs github_repository_syncs_label_id_eb1e9bd7_fk_labels_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_repository_syncs
    ADD CONSTRAINT github_repository_syncs_label_id_eb1e9bd7_fk_labels_id FOREIGN KEY (label_id) REFERENCES labels(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_repository_syncs github_repository_syncs_project_id_e7e8291e_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_repository_syncs
    ADD CONSTRAINT github_repository_syncs_project_id_e7e8291e_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_repository_syncs github_repository_syncs_updated_by_id_07e9d065_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_repository_syncs
    ADD CONSTRAINT github_repository_syncs_updated_by_id_07e9d065_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: github_repository_syncs github_repository_syncs_workspace_id_4a22a8b8_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY github_repository_syncs
    ADD CONSTRAINT github_repository_syncs_workspace_id_4a22a8b8_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: global_views global_views_created_by_id_14b7d95c_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY global_views
    ADD CONSTRAINT global_views_created_by_id_14b7d95c_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: global_views global_views_updated_by_id_112e0281_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY global_views
    ADD CONSTRAINT global_views_updated_by_id_112e0281_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: global_views global_views_workspace_id_3c68eca7_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY global_views
    ADD CONSTRAINT global_views_workspace_id_3c68eca7_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: importers importers_created_by_id_7dd06433_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY importers
    ADD CONSTRAINT importers_created_by_id_7dd06433_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: importers importers_initiated_by_id_3cddbd23_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY importers
    ADD CONSTRAINT importers_initiated_by_id_3cddbd23_fk_users_id FOREIGN KEY (initiated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: importers importers_project_id_1f8b43ef_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY importers
    ADD CONSTRAINT importers_project_id_1f8b43ef_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: importers importers_token_id_c951e89f_fk_api_tokens_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY importers
    ADD CONSTRAINT importers_token_id_c951e89f_fk_api_tokens_id FOREIGN KEY (token_id) REFERENCES api_tokens(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: importers importers_updated_by_id_3915139e_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY importers
    ADD CONSTRAINT importers_updated_by_id_3915139e_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: importers importers_workspace_id_795b8985_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY importers
    ADD CONSTRAINT importers_workspace_id_795b8985_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: inbox_issues inbox_issues_created_by_id_483bce13_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY inbox_issues
    ADD CONSTRAINT inbox_issues_created_by_id_483bce13_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: inbox_issues inbox_issues_duplicate_to_id_6cb8d961_fk_issues_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY inbox_issues
    ADD CONSTRAINT inbox_issues_duplicate_to_id_6cb8d961_fk_issues_id FOREIGN KEY (duplicate_to_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: inbox_issues inbox_issues_inbox_id_444b05b9_fk_inboxes_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY inbox_issues
    ADD CONSTRAINT inbox_issues_inbox_id_444b05b9_fk_inboxes_id FOREIGN KEY (inbox_id) REFERENCES inboxes(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: inbox_issues inbox_issues_issue_id_7d74b224_fk_issues_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY inbox_issues
    ADD CONSTRAINT inbox_issues_issue_id_7d74b224_fk_issues_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: inbox_issues inbox_issues_project_id_5117a70b_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY inbox_issues
    ADD CONSTRAINT inbox_issues_project_id_5117a70b_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: inbox_issues inbox_issues_updated_by_id_d1b2b70f_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY inbox_issues
    ADD CONSTRAINT inbox_issues_updated_by_id_d1b2b70f_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: inbox_issues inbox_issues_workspace_id_4a61a7bd_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY inbox_issues
    ADD CONSTRAINT inbox_issues_workspace_id_4a61a7bd_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: inboxes inboxes_created_by_id_9f1cf5ec_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY inboxes
    ADD CONSTRAINT inboxes_created_by_id_9f1cf5ec_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: inboxes inboxes_project_id_a0135c66_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY inboxes
    ADD CONSTRAINT inboxes_project_id_a0135c66_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: inboxes inboxes_updated_by_id_69b7b3ae_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY inboxes
    ADD CONSTRAINT inboxes_updated_by_id_69b7b3ae_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: inboxes inboxes_workspace_id_d6178865_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY inboxes
    ADD CONSTRAINT inboxes_workspace_id_d6178865_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: instance_admins instance_admins_created_by_id_7f4e03b4_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY instance_admins
    ADD CONSTRAINT instance_admins_created_by_id_7f4e03b4_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: instance_admins instance_admins_instance_id_66d1ba73_fk_instances_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY instance_admins
    ADD CONSTRAINT instance_admins_instance_id_66d1ba73_fk_instances_id FOREIGN KEY (instance_id) REFERENCES instances(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: instance_admins instance_admins_updated_by_id_b7800403_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY instance_admins
    ADD CONSTRAINT instance_admins_updated_by_id_b7800403_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: instance_admins instance_admins_user_id_cc6e9b62_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY instance_admins
    ADD CONSTRAINT instance_admins_user_id_cc6e9b62_fk_users_id FOREIGN KEY (user_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: instance_configurations instance_configurations_created_by_id_e683f3e5_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY instance_configurations
    ADD CONSTRAINT instance_configurations_created_by_id_e683f3e5_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: instance_configurations instance_configurations_updated_by_id_f0d7542e_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY instance_configurations
    ADD CONSTRAINT instance_configurations_updated_by_id_f0d7542e_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: instances instances_created_by_id_c76e92ef_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY instances
    ADD CONSTRAINT instances_created_by_id_c76e92ef_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: instances instances_updated_by_id_cce8fcdf_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY instances
    ADD CONSTRAINT instances_updated_by_id_cce8fcdf_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: integrations integrations_created_by_id_0b6edd52_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY integrations
    ADD CONSTRAINT integrations_created_by_id_0b6edd52_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: integrations integrations_updated_by_id_d6d00d15_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY integrations
    ADD CONSTRAINT integrations_updated_by_id_d6d00d15_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_activities issue_activities_issue_id_180e5662_fk_issues_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_activities
    ADD CONSTRAINT issue_activities_issue_id_180e5662_fk_issues_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_activities issue_activity_actor_id_52fdd42d_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_activities
    ADD CONSTRAINT issue_activity_actor_id_52fdd42d_fk_user_id FOREIGN KEY (actor_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_activities issue_activity_created_by_id_49516e3d_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_activities
    ADD CONSTRAINT issue_activity_created_by_id_49516e3d_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_activities issue_activity_issue_comment_id_701f3c3c_fk_issue_comment_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_activities
    ADD CONSTRAINT issue_activity_issue_comment_id_701f3c3c_fk_issue_comment_id FOREIGN KEY (issue_comment_id) REFERENCES issue_comments(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_activities issue_activity_project_id_d0ac2ccf_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_activities
    ADD CONSTRAINT issue_activity_project_id_d0ac2ccf_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_activities issue_activity_updated_by_id_0075f9bd_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_activities
    ADD CONSTRAINT issue_activity_updated_by_id_0075f9bd_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_activities issue_activity_workspace_id_65acaf73_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_activities
    ADD CONSTRAINT issue_activity_workspace_id_65acaf73_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_assignees issue_assignee_assignee_id_50f5c04e_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_assignees
    ADD CONSTRAINT issue_assignee_assignee_id_50f5c04e_fk_user_id FOREIGN KEY (assignee_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_assignees issue_assignee_created_by_id_f693d43b_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_assignees
    ADD CONSTRAINT issue_assignee_created_by_id_f693d43b_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_assignees issue_assignee_issue_id_72da08db_fk_issue_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_assignees
    ADD CONSTRAINT issue_assignee_issue_id_72da08db_fk_issue_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_assignees issue_assignee_project_id_61c18bf2_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_assignees
    ADD CONSTRAINT issue_assignee_project_id_61c18bf2_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_assignees issue_assignee_updated_by_id_c54088aa_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_assignees
    ADD CONSTRAINT issue_assignee_updated_by_id_c54088aa_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_assignees issue_assignee_workspace_id_9aad55b7_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_assignees
    ADD CONSTRAINT issue_assignee_workspace_id_9aad55b7_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_attachments issue_attachments_created_by_id_87be05bb_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_attachments
    ADD CONSTRAINT issue_attachments_created_by_id_87be05bb_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_attachments issue_attachments_issue_id_0faf88bf_fk_issues_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_attachments
    ADD CONSTRAINT issue_attachments_issue_id_0faf88bf_fk_issues_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_attachments issue_attachments_project_id_a95fe706_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_attachments
    ADD CONSTRAINT issue_attachments_project_id_a95fe706_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_attachments issue_attachments_updated_by_id_47dceec1_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_attachments
    ADD CONSTRAINT issue_attachments_updated_by_id_47dceec1_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_attachments issue_attachments_workspace_id_c456a532_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_attachments
    ADD CONSTRAINT issue_attachments_workspace_id_c456a532_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_blockers issue_blocker_block_id_5d15a701_fk_issue_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_blockers
    ADD CONSTRAINT issue_blocker_block_id_5d15a701_fk_issue_id FOREIGN KEY (block_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_blockers issue_blocker_blocked_by_id_a138af71_fk_issue_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_blockers
    ADD CONSTRAINT issue_blocker_blocked_by_id_a138af71_fk_issue_id FOREIGN KEY (blocked_by_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_blockers issue_blocker_created_by_id_0d19f6ea_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_blockers
    ADD CONSTRAINT issue_blocker_created_by_id_0d19f6ea_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_blockers issue_blocker_project_id_380bd100_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_blockers
    ADD CONSTRAINT issue_blocker_project_id_380bd100_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_blockers issue_blocker_updated_by_id_4af87d63_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_blockers
    ADD CONSTRAINT issue_blocker_updated_by_id_4af87d63_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_blockers issue_blocker_workspace_id_419a1c71_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_blockers
    ADD CONSTRAINT issue_blocker_workspace_id_419a1c71_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_comments issue_comment_actor_id_d312315b_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_comments
    ADD CONSTRAINT issue_comment_actor_id_d312315b_fk_user_id FOREIGN KEY (actor_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_comments issue_comment_created_by_id_0765f239_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_comments
    ADD CONSTRAINT issue_comment_created_by_id_0765f239_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_comments issue_comment_issue_id_d0195e35_fk_issue_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_comments
    ADD CONSTRAINT issue_comment_issue_id_d0195e35_fk_issue_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_comments issue_comment_project_id_db37c105_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_comments
    ADD CONSTRAINT issue_comment_project_id_db37c105_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_comments issue_comment_updated_by_id_96cfb86e_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_comments
    ADD CONSTRAINT issue_comment_updated_by_id_96cfb86e_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_comments issue_comment_workspace_id_3f7969ec_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_comments
    ADD CONSTRAINT issue_comment_workspace_id_3f7969ec_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issues issue_created_by_id_8f0ae62b_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issues
    ADD CONSTRAINT issue_created_by_id_8f0ae62b_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_labels issue_label_created_by_id_94075315_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_labels
    ADD CONSTRAINT issue_label_created_by_id_94075315_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_labels issue_label_issue_id_0f252e52_fk_issue_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_labels
    ADD CONSTRAINT issue_label_issue_id_0f252e52_fk_issue_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_labels issue_label_label_id_5f22777f_fk_label_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_labels
    ADD CONSTRAINT issue_label_label_id_5f22777f_fk_label_id FOREIGN KEY (label_id) REFERENCES labels(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_labels issue_label_project_id_eaa2ba39_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_labels
    ADD CONSTRAINT issue_label_project_id_eaa2ba39_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_labels issue_label_updated_by_id_a97a6733_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_labels
    ADD CONSTRAINT issue_label_updated_by_id_a97a6733_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_labels issue_label_workspace_id_b5b1faac_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_labels
    ADD CONSTRAINT issue_label_workspace_id_b5b1faac_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_links issue_links_created_by_id_5e4aa092_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_links
    ADD CONSTRAINT issue_links_created_by_id_5e4aa092_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_links issue_links_issue_id_7032881f_fk_issues_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_links
    ADD CONSTRAINT issue_links_issue_id_7032881f_fk_issues_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_links issue_links_project_id_63d6e9ce_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_links
    ADD CONSTRAINT issue_links_project_id_63d6e9ce_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_links issue_links_updated_by_id_a771cce4_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_links
    ADD CONSTRAINT issue_links_updated_by_id_a771cce4_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_links issue_links_workspace_id_ff9038e7_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_links
    ADD CONSTRAINT issue_links_workspace_id_ff9038e7_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_mentions issue_mentions_created_by_id_eb44759e_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_mentions
    ADD CONSTRAINT issue_mentions_created_by_id_eb44759e_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_mentions issue_mentions_issue_id_d8821107_fk_issues_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_mentions
    ADD CONSTRAINT issue_mentions_issue_id_d8821107_fk_issues_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_mentions issue_mentions_mention_id_cf1b9346_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_mentions
    ADD CONSTRAINT issue_mentions_mention_id_cf1b9346_fk_users_id FOREIGN KEY (mention_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_mentions issue_mentions_project_id_d0cccdf5_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_mentions
    ADD CONSTRAINT issue_mentions_project_id_d0cccdf5_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_mentions issue_mentions_updated_by_id_c62106d3_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_mentions
    ADD CONSTRAINT issue_mentions_updated_by_id_c62106d3_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_mentions issue_mentions_workspace_id_4ca59d05_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_mentions
    ADD CONSTRAINT issue_mentions_workspace_id_4ca59d05_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issues issue_parent_id_ce8d76ba_fk_issue_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issues
    ADD CONSTRAINT issue_parent_id_ce8d76ba_fk_issue_id FOREIGN KEY (parent_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issues issue_project_id_fea0fc80_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issues
    ADD CONSTRAINT issue_project_id_fea0fc80_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_properties issue_property_created_by_id_8e92131c_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_properties
    ADD CONSTRAINT issue_property_created_by_id_8e92131c_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_properties issue_property_project_id_30e7de7b_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_properties
    ADD CONSTRAINT issue_property_project_id_30e7de7b_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_properties issue_property_updated_by_id_ff158d4d_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_properties
    ADD CONSTRAINT issue_property_updated_by_id_ff158d4d_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_properties issue_property_user_id_0b1d1c8f_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_properties
    ADD CONSTRAINT issue_property_user_id_0b1d1c8f_fk_user_id FOREIGN KEY (user_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_properties issue_property_workspace_id_17860d65_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_properties
    ADD CONSTRAINT issue_property_workspace_id_17860d65_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_reactions issue_reactions_actor_id_5f5b8303_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_reactions
    ADD CONSTRAINT issue_reactions_actor_id_5f5b8303_fk_users_id FOREIGN KEY (actor_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_reactions issue_reactions_created_by_id_3953b7de_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_reactions
    ADD CONSTRAINT issue_reactions_created_by_id_3953b7de_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_reactions issue_reactions_issue_id_2c324bae_fk_issues_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_reactions
    ADD CONSTRAINT issue_reactions_issue_id_2c324bae_fk_issues_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_reactions issue_reactions_project_id_8708ecaf_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_reactions
    ADD CONSTRAINT issue_reactions_project_id_8708ecaf_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_reactions issue_reactions_updated_by_id_4069af90_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_reactions
    ADD CONSTRAINT issue_reactions_updated_by_id_4069af90_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_reactions issue_reactions_workspace_id_bd8d7550_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_reactions
    ADD CONSTRAINT issue_reactions_workspace_id_bd8d7550_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_relations issue_relations_created_by_id_854d07e7_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_relations
    ADD CONSTRAINT issue_relations_created_by_id_854d07e7_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_relations issue_relations_issue_id_e1db6f72_fk_issues_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_relations
    ADD CONSTRAINT issue_relations_issue_id_e1db6f72_fk_issues_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_relations issue_relations_project_id_15350161_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_relations
    ADD CONSTRAINT issue_relations_project_id_15350161_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_relations issue_relations_related_issue_id_e1ea44a7_fk_issues_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_relations
    ADD CONSTRAINT issue_relations_related_issue_id_e1ea44a7_fk_issues_id FOREIGN KEY (related_issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_relations issue_relations_updated_by_id_3dfa850f_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_relations
    ADD CONSTRAINT issue_relations_updated_by_id_3dfa850f_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_relations issue_relations_workspace_id_00b50e90_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_relations
    ADD CONSTRAINT issue_relations_workspace_id_00b50e90_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_sequences issue_sequence_created_by_id_59270506_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_sequences
    ADD CONSTRAINT issue_sequence_created_by_id_59270506_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_sequences issue_sequence_issue_id_16e9f00f_fk_issue_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_sequences
    ADD CONSTRAINT issue_sequence_issue_id_16e9f00f_fk_issue_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_sequences issue_sequence_project_id_ce882e85_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_sequences
    ADD CONSTRAINT issue_sequence_project_id_ce882e85_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_sequences issue_sequence_updated_by_id_310c8dd3_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_sequences
    ADD CONSTRAINT issue_sequence_updated_by_id_310c8dd3_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_sequences issue_sequence_workspace_id_0d3f0fd4_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_sequences
    ADD CONSTRAINT issue_sequence_workspace_id_0d3f0fd4_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issues issue_state_id_1a65560d_fk_state_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issues
    ADD CONSTRAINT issue_state_id_1a65560d_fk_state_id FOREIGN KEY (state_id) REFERENCES states(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_subscribers issue_subscribers_created_by_id_b6ea0157_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_subscribers
    ADD CONSTRAINT issue_subscribers_created_by_id_b6ea0157_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_subscribers issue_subscribers_issue_id_85cf2093_fk_issues_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_subscribers
    ADD CONSTRAINT issue_subscribers_issue_id_85cf2093_fk_issues_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_subscribers issue_subscribers_project_id_cf48d75f_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_subscribers
    ADD CONSTRAINT issue_subscribers_project_id_cf48d75f_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_subscribers issue_subscribers_subscriber_id_2d89c988_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_subscribers
    ADD CONSTRAINT issue_subscribers_subscriber_id_2d89c988_fk_users_id FOREIGN KEY (subscriber_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_subscribers issue_subscribers_updated_by_id_1bfc2f55_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_subscribers
    ADD CONSTRAINT issue_subscribers_updated_by_id_1bfc2f55_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_subscribers issue_subscribers_workspace_id_96afa91f_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_subscribers
    ADD CONSTRAINT issue_subscribers_workspace_id_96afa91f_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issues issue_updated_by_id_f1261863_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issues
    ADD CONSTRAINT issue_updated_by_id_f1261863_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_views issue_views_created_by_id_0d2e456b_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_views
    ADD CONSTRAINT issue_views_created_by_id_0d2e456b_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_views issue_views_project_id_55ee009f_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_views
    ADD CONSTRAINT issue_views_project_id_55ee009f_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_views issue_views_updated_by_id_28cd9870_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_views
    ADD CONSTRAINT issue_views_updated_by_id_28cd9870_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_views issue_views_workspace_id_8785e03d_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_views
    ADD CONSTRAINT issue_views_workspace_id_8785e03d_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_votes issue_votes_actor_id_525cab61_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_votes
    ADD CONSTRAINT issue_votes_actor_id_525cab61_fk_users_id FOREIGN KEY (actor_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_votes issue_votes_created_by_id_86adcf5c_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_votes
    ADD CONSTRAINT issue_votes_created_by_id_86adcf5c_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_votes issue_votes_issue_id_07a61ecb_fk_issues_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_votes
    ADD CONSTRAINT issue_votes_issue_id_07a61ecb_fk_issues_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_votes issue_votes_project_id_b649f55b_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_votes
    ADD CONSTRAINT issue_votes_project_id_b649f55b_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_votes issue_votes_updated_by_id_9e2a6cdc_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_votes
    ADD CONSTRAINT issue_votes_updated_by_id_9e2a6cdc_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issue_votes issue_votes_workspace_id_a3e91a6b_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issue_votes
    ADD CONSTRAINT issue_votes_workspace_id_a3e91a6b_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: issues issue_workspace_id_c84878c1_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY issues
    ADD CONSTRAINT issue_workspace_id_c84878c1_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: labels label_created_by_id_aa6ffcfa_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY labels
    ADD CONSTRAINT label_created_by_id_aa6ffcfa_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: labels label_parent_id_7a853296_fk_label_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY labels
    ADD CONSTRAINT label_parent_id_7a853296_fk_label_id FOREIGN KEY (parent_id) REFERENCES labels(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: labels label_project_id_90e0f1a2_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY labels
    ADD CONSTRAINT label_project_id_90e0f1a2_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: labels label_updated_by_id_894a5464_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY labels
    ADD CONSTRAINT label_updated_by_id_894a5464_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: labels label_workspace_id_c4c9ae5a_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY labels
    ADD CONSTRAINT label_workspace_id_c4c9ae5a_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: modules module_created_by_id_ff7a5866_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY modules
    ADD CONSTRAINT module_created_by_id_ff7a5866_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_favorites module_favorites_created_by_id_7f84820d_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_favorites
    ADD CONSTRAINT module_favorites_created_by_id_7f84820d_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_favorites module_favorites_module_id_c4f0736b_fk_modules_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_favorites
    ADD CONSTRAINT module_favorites_module_id_c4f0736b_fk_modules_id FOREIGN KEY (module_id) REFERENCES modules(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_favorites module_favorites_project_id_83d9d9e8_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_favorites
    ADD CONSTRAINT module_favorites_project_id_83d9d9e8_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_favorites module_favorites_updated_by_id_2437fed0_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_favorites
    ADD CONSTRAINT module_favorites_updated_by_id_2437fed0_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_favorites module_favorites_user_id_c5b76375_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_favorites
    ADD CONSTRAINT module_favorites_user_id_c5b76375_fk_users_id FOREIGN KEY (user_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_favorites module_favorites_workspace_id_65a4ac6f_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_favorites
    ADD CONSTRAINT module_favorites_workspace_id_65a4ac6f_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_issues module_issues_created_by_id_de0b995a_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_issues
    ADD CONSTRAINT module_issues_created_by_id_de0b995a_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_issues module_issues_issue_id_7caa908b_fk_issue_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_issues
    ADD CONSTRAINT module_issues_issue_id_7caa908b_fk_issue_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_issues module_issues_module_id_74e0ed5a_fk_module_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_issues
    ADD CONSTRAINT module_issues_module_id_74e0ed5a_fk_module_id FOREIGN KEY (module_id) REFERENCES modules(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_issues module_issues_project_id_59836d1e_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_issues
    ADD CONSTRAINT module_issues_project_id_59836d1e_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_issues module_issues_updated_by_id_46dbf724_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_issues
    ADD CONSTRAINT module_issues_updated_by_id_46dbf724_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_issues module_issues_workspace_id_6bf85201_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_issues
    ADD CONSTRAINT module_issues_workspace_id_6bf85201_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: modules module_lead_id_04966630_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY modules
    ADD CONSTRAINT module_lead_id_04966630_fk_user_id FOREIGN KEY (lead_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_links module_links_created_by_id_eaf6492f_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_links
    ADD CONSTRAINT module_links_created_by_id_eaf6492f_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_links module_links_module_id_0fda3f8a_fk_modules_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_links
    ADD CONSTRAINT module_links_module_id_0fda3f8a_fk_modules_id FOREIGN KEY (module_id) REFERENCES modules(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_links module_links_project_id_f720bb79_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_links
    ADD CONSTRAINT module_links_project_id_f720bb79_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_links module_links_updated_by_id_4da419e7_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_links
    ADD CONSTRAINT module_links_updated_by_id_4da419e7_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_links module_links_workspace_id_0521c11c_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_links
    ADD CONSTRAINT module_links_workspace_id_0521c11c_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_members module_member_created_by_id_2ed84a65_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_members
    ADD CONSTRAINT module_member_created_by_id_2ed84a65_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_members module_member_member_id_928f473e_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_members
    ADD CONSTRAINT module_member_member_id_928f473e_fk_user_id FOREIGN KEY (member_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_members module_member_module_id_f00be7ef_fk_module_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_members
    ADD CONSTRAINT module_member_module_id_f00be7ef_fk_module_id FOREIGN KEY (module_id) REFERENCES modules(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_members module_member_project_id_ec8d2376_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_members
    ADD CONSTRAINT module_member_project_id_ec8d2376_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_members module_member_updated_by_id_a9046438_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_members
    ADD CONSTRAINT module_member_updated_by_id_a9046438_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: module_members module_member_workspace_id_f2f23c73_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY module_members
    ADD CONSTRAINT module_member_workspace_id_f2f23c73_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: modules module_project_id_da84b04f_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY modules
    ADD CONSTRAINT module_project_id_da84b04f_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: modules module_updated_by_id_72ab6d5c_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY modules
    ADD CONSTRAINT module_updated_by_id_72ab6d5c_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: modules module_workspace_id_0a826fef_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY modules
    ADD CONSTRAINT module_workspace_id_0a826fef_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: notifications notifications_created_by_id_b9c3f81b_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY notifications
    ADD CONSTRAINT notifications_created_by_id_b9c3f81b_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: notifications notifications_project_id_e4d4f192_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY notifications
    ADD CONSTRAINT notifications_project_id_e4d4f192_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: notifications notifications_receiver_id_b708b2b0_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY notifications
    ADD CONSTRAINT notifications_receiver_id_b708b2b0_fk_users_id FOREIGN KEY (receiver_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: notifications notifications_triggered_by_id_31cdec21_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY notifications
    ADD CONSTRAINT notifications_triggered_by_id_31cdec21_fk_users_id FOREIGN KEY (triggered_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: notifications notifications_updated_by_id_8a651e96_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY notifications
    ADD CONSTRAINT notifications_updated_by_id_8a651e96_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: notifications notifications_workspace_id_b2f09ef7_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY notifications
    ADD CONSTRAINT notifications_workspace_id_b2f09ef7_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_blocks page_blocks_created_by_id_696391e1_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_blocks
    ADD CONSTRAINT page_blocks_created_by_id_696391e1_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_blocks page_blocks_issue_id_33cad86b_fk_issues_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_blocks
    ADD CONSTRAINT page_blocks_issue_id_33cad86b_fk_issues_id FOREIGN KEY (issue_id) REFERENCES issues(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_blocks page_blocks_page_id_5f55e114_fk_pages_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_blocks
    ADD CONSTRAINT page_blocks_page_id_5f55e114_fk_pages_id FOREIGN KEY (page_id) REFERENCES pages(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_blocks page_blocks_project_id_068d80f7_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_blocks
    ADD CONSTRAINT page_blocks_project_id_068d80f7_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_blocks page_blocks_updated_by_id_1a29acb7_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_blocks
    ADD CONSTRAINT page_blocks_updated_by_id_1a29acb7_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_blocks page_blocks_workspace_id_b051825d_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_blocks
    ADD CONSTRAINT page_blocks_workspace_id_b051825d_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_favorites page_favorites_created_by_id_3b672270_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_favorites
    ADD CONSTRAINT page_favorites_created_by_id_3b672270_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_favorites page_favorites_page_id_0896034b_fk_pages_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_favorites
    ADD CONSTRAINT page_favorites_page_id_0896034b_fk_pages_id FOREIGN KEY (page_id) REFERENCES pages(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_favorites page_favorites_project_id_e0e3c871_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_favorites
    ADD CONSTRAINT page_favorites_project_id_e0e3c871_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_favorites page_favorites_updated_by_id_623c7ac5_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_favorites
    ADD CONSTRAINT page_favorites_updated_by_id_623c7ac5_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_favorites page_favorites_user_id_162640a9_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_favorites
    ADD CONSTRAINT page_favorites_user_id_162640a9_fk_users_id FOREIGN KEY (user_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_favorites page_favorites_workspace_id_4b7858d9_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_favorites
    ADD CONSTRAINT page_favorites_workspace_id_4b7858d9_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_labels page_labels_created_by_id_fbd942c0_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_labels
    ADD CONSTRAINT page_labels_created_by_id_fbd942c0_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_labels page_labels_label_id_05958e53_fk_labels_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_labels
    ADD CONSTRAINT page_labels_label_id_05958e53_fk_labels_id FOREIGN KEY (label_id) REFERENCES labels(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_labels page_labels_page_id_0e6cdb3d_fk_pages_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_labels
    ADD CONSTRAINT page_labels_page_id_0e6cdb3d_fk_pages_id FOREIGN KEY (page_id) REFERENCES pages(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_labels page_labels_project_id_938a63ca_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_labels
    ADD CONSTRAINT page_labels_project_id_938a63ca_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_labels page_labels_updated_by_id_d9fddbff_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_labels
    ADD CONSTRAINT page_labels_updated_by_id_d9fddbff_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_labels page_labels_workspace_id_078bb01c_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_labels
    ADD CONSTRAINT page_labels_workspace_id_078bb01c_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_logs page_logs_created_by_id_4a295aec_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_logs
    ADD CONSTRAINT page_logs_created_by_id_4a295aec_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_logs page_logs_page_id_0e0d747d_fk_pages_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_logs
    ADD CONSTRAINT page_logs_page_id_0e0d747d_fk_pages_id FOREIGN KEY (page_id) REFERENCES pages(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_logs page_logs_project_id_d5117f7a_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_logs
    ADD CONSTRAINT page_logs_project_id_d5117f7a_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_logs page_logs_updated_by_id_1995190b_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_logs
    ADD CONSTRAINT page_logs_updated_by_id_1995190b_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: page_logs page_logs_workspace_id_be7bde64_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY page_logs
    ADD CONSTRAINT page_logs_workspace_id_be7bde64_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: pages pages_created_by_id_d109a675_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY pages
    ADD CONSTRAINT pages_created_by_id_d109a675_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: pages pages_owned_by_id_bf50485f_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY pages
    ADD CONSTRAINT pages_owned_by_id_bf50485f_fk_users_id FOREIGN KEY (owned_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: pages pages_parent_id_8b823409_fk_pages_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY pages
    ADD CONSTRAINT pages_parent_id_8b823409_fk_pages_id FOREIGN KEY (parent_id) REFERENCES pages(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: pages pages_project_id_272eed09_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY pages
    ADD CONSTRAINT pages_project_id_272eed09_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: pages pages_updated_by_id_6c42de3e_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY pages
    ADD CONSTRAINT pages_updated_by_id_6c42de3e_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: pages pages_workspace_id_c6c51010_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY pages
    ADD CONSTRAINT pages_workspace_id_c6c51010_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: projects project_created_by_id_6cc13408_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY projects
    ADD CONSTRAINT project_created_by_id_6cc13408_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: projects project_default_assignee_id_6ba45f90_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY projects
    ADD CONSTRAINT project_default_assignee_id_6ba45f90_fk_user_id FOREIGN KEY (default_assignee_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_deploy_boards project_deploy_boards_created_by_id_2ea72f98_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_deploy_boards
    ADD CONSTRAINT project_deploy_boards_created_by_id_2ea72f98_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_deploy_boards project_deploy_boards_inbox_id_a6a75525_fk_inboxes_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_deploy_boards
    ADD CONSTRAINT project_deploy_boards_inbox_id_a6a75525_fk_inboxes_id FOREIGN KEY (inbox_id) REFERENCES inboxes(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_deploy_boards project_deploy_boards_project_id_49d887b2_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_deploy_boards
    ADD CONSTRAINT project_deploy_boards_project_id_49d887b2_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_deploy_boards project_deploy_boards_updated_by_id_290eb99e_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_deploy_boards
    ADD CONSTRAINT project_deploy_boards_updated_by_id_290eb99e_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_deploy_boards project_deploy_boards_workspace_id_cd92f164_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_deploy_boards
    ADD CONSTRAINT project_deploy_boards_workspace_id_cd92f164_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_favorites project_favorites_created_by_id_613c0717_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_favorites
    ADD CONSTRAINT project_favorites_created_by_id_613c0717_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_favorites project_favorites_project_id_df76634d_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_favorites
    ADD CONSTRAINT project_favorites_project_id_df76634d_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_favorites project_favorites_updated_by_id_2a663e4d_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_favorites
    ADD CONSTRAINT project_favorites_updated_by_id_2a663e4d_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_favorites project_favorites_user_id_500f4f5b_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_favorites
    ADD CONSTRAINT project_favorites_user_id_500f4f5b_fk_users_id FOREIGN KEY (user_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_favorites project_favorites_workspace_id_fa980513_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_favorites
    ADD CONSTRAINT project_favorites_workspace_id_fa980513_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_identifiers project_identifier_created_by_id_2b6f273a_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_identifiers
    ADD CONSTRAINT project_identifier_created_by_id_2b6f273a_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_identifiers project_identifier_project_id_13de58a9_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_identifiers
    ADD CONSTRAINT project_identifier_project_id_13de58a9_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_identifiers project_identifier_updated_by_id_1a00e2a0_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_identifiers
    ADD CONSTRAINT project_identifier_updated_by_id_1a00e2a0_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_identifiers project_identifier_workspace_id_6024b517_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_identifiers
    ADD CONSTRAINT project_identifier_workspace_id_6024b517_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_members project_member_created_by_id_8b363306_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_members
    ADD CONSTRAINT project_member_created_by_id_8b363306_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_member_invites project_member_invite_created_by_id_a87df45c_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_member_invites
    ADD CONSTRAINT project_member_invite_created_by_id_a87df45c_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_member_invites project_member_invite_project_id_8fb7750e_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_member_invites
    ADD CONSTRAINT project_member_invite_project_id_8fb7750e_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_member_invites project_member_invite_updated_by_id_5aa55c96_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_member_invites
    ADD CONSTRAINT project_member_invite_updated_by_id_5aa55c96_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_member_invites project_member_invite_workspace_id_64e2dc4c_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_member_invites
    ADD CONSTRAINT project_member_invite_workspace_id_64e2dc4c_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_members project_member_member_id_9d6b126b_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_members
    ADD CONSTRAINT project_member_member_id_9d6b126b_fk_user_id FOREIGN KEY (member_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_members project_member_project_id_11ea1a9e_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_members
    ADD CONSTRAINT project_member_project_id_11ea1a9e_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_members project_member_updated_by_id_cf6aaac4_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_members
    ADD CONSTRAINT project_member_updated_by_id_cf6aaac4_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_members project_member_workspace_id_88bb9a97_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_members
    ADD CONSTRAINT project_member_workspace_id_88bb9a97_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: projects project_project_lead_id_caf8e353_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY projects
    ADD CONSTRAINT project_project_lead_id_caf8e353_fk_user_id FOREIGN KEY (project_lead_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_public_members project_public_members_created_by_id_c4c7c776_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_public_members
    ADD CONSTRAINT project_public_members_created_by_id_c4c7c776_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_public_members project_public_members_member_id_52f257f9_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_public_members
    ADD CONSTRAINT project_public_members_member_id_52f257f9_fk_users_id FOREIGN KEY (member_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_public_members project_public_members_project_id_2dfd893d_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_public_members
    ADD CONSTRAINT project_public_members_project_id_2dfd893d_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_public_members project_public_members_updated_by_id_c3e4d675_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_public_members
    ADD CONSTRAINT project_public_members_updated_by_id_c3e4d675_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: project_public_members project_public_members_workspace_id_ebfce110_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY project_public_members
    ADD CONSTRAINT project_public_members_workspace_id_ebfce110_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: projects project_updated_by_id_fe290525_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY projects
    ADD CONSTRAINT project_updated_by_id_fe290525_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: projects project_workspace_id_01764ff9_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY projects
    ADD CONSTRAINT project_workspace_id_01764ff9_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: projects projects_default_state_id_f13e8b95_fk_states_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY projects
    ADD CONSTRAINT projects_default_state_id_f13e8b95_fk_states_id FOREIGN KEY (default_state_id) REFERENCES states(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: projects projects_estimate_id_85c7b2ac_fk_estimates_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY projects
    ADD CONSTRAINT projects_estimate_id_85c7b2ac_fk_estimates_id FOREIGN KEY (estimate_id) REFERENCES estimates(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: slack_project_syncs slack_project_syncs_created_by_id_ec405a17_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY slack_project_syncs
    ADD CONSTRAINT slack_project_syncs_created_by_id_ec405a17_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: slack_project_syncs slack_project_syncs_project_id_016dc792_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY slack_project_syncs
    ADD CONSTRAINT slack_project_syncs_project_id_016dc792_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: slack_project_syncs slack_project_syncs_updated_by_id_152eb3b5_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY slack_project_syncs
    ADD CONSTRAINT slack_project_syncs_updated_by_id_152eb3b5_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: slack_project_syncs slack_project_syncs_workspace_id_d1822b06_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY slack_project_syncs
    ADD CONSTRAINT slack_project_syncs_workspace_id_d1822b06_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: slack_project_syncs slack_project_syncs_workspace_integratio_d89c9b40_fk_workspace; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY slack_project_syncs
    ADD CONSTRAINT slack_project_syncs_workspace_integratio_d89c9b40_fk_workspace FOREIGN KEY (workspace_integration_id) REFERENCES workspace_integrations(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: social_login_connections social_login_connection_created_by_id_7ca2ef50_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY social_login_connections
    ADD CONSTRAINT social_login_connection_created_by_id_7ca2ef50_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: social_login_connections social_login_connection_updated_by_id_c13deb42_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY social_login_connections
    ADD CONSTRAINT social_login_connection_updated_by_id_c13deb42_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: social_login_connections social_login_connection_user_id_0e26c0c5_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY social_login_connections
    ADD CONSTRAINT social_login_connection_user_id_0e26c0c5_fk_user_id FOREIGN KEY (user_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: states state_created_by_id_ff51a50d_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY states
    ADD CONSTRAINT state_created_by_id_ff51a50d_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: states state_project_id_23a65fd6_fk_project_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY states
    ADD CONSTRAINT state_project_id_23a65fd6_fk_project_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: states state_updated_by_id_be298453_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY states
    ADD CONSTRAINT state_updated_by_id_be298453_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: states state_workspace_id_2293282d_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY states
    ADD CONSTRAINT state_workspace_id_2293282d_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: teams team_created_by_id_725a9101_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY teams
    ADD CONSTRAINT team_created_by_id_725a9101_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: team_members team_member_created_by_id_7cc0ad68_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY team_members
    ADD CONSTRAINT team_member_created_by_id_7cc0ad68_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: team_members team_member_member_id_905a2628_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY team_members
    ADD CONSTRAINT team_member_member_id_905a2628_fk_user_id FOREIGN KEY (member_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: team_members team_member_team_id_26812b86_fk_team_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY team_members
    ADD CONSTRAINT team_member_team_id_26812b86_fk_team_id FOREIGN KEY (team_id) REFERENCES teams(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: team_members team_member_updated_by_id_b1d37059_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY team_members
    ADD CONSTRAINT team_member_updated_by_id_b1d37059_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: team_members team_member_workspace_id_5e13a185_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY team_members
    ADD CONSTRAINT team_member_workspace_id_5e13a185_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: teams team_updated_by_id_79bb36f2_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY teams
    ADD CONSTRAINT team_updated_by_id_79bb36f2_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: teams team_workspace_id_1d56407f_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY teams
    ADD CONSTRAINT team_workspace_id_1d56407f_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: token_blacklist_blacklistedtoken token_blacklist_blacklistedtoken_token_id_3cc7fe56_fk; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY token_blacklist_blacklistedtoken
    ADD CONSTRAINT token_blacklist_blacklistedtoken_token_id_3cc7fe56_fk FOREIGN KEY (token_id) REFERENCES token_blacklist_outstandingtoken(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: token_blacklist_outstandingtoken token_blacklist_outstandingtoken_user_id_83bc629a_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY token_blacklist_outstandingtoken
    ADD CONSTRAINT token_blacklist_outstandingtoken_user_id_83bc629a_fk_users_id FOREIGN KEY (user_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: users_groups user_groups_group_id_b76f8aba_fk_auth_group_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY users_groups
    ADD CONSTRAINT user_groups_group_id_b76f8aba_fk_auth_group_id FOREIGN KEY (group_id) REFERENCES auth_group(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: users_groups user_groups_user_id_abaea130_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY users_groups
    ADD CONSTRAINT user_groups_user_id_abaea130_fk_user_id FOREIGN KEY (user_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: users_user_permissions user_user_permission_permission_id_9deb68a3_fk_auth_perm; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY users_user_permissions
    ADD CONSTRAINT user_user_permission_permission_id_9deb68a3_fk_auth_perm FOREIGN KEY (permission_id) REFERENCES auth_permission(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: users_user_permissions user_user_permissions_user_id_ed4a47ea_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY users_user_permissions
    ADD CONSTRAINT user_user_permissions_user_id_ed4a47ea_fk_user_id FOREIGN KEY (user_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: view_favorites view_favorites_created_by_id_dc6047f5_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY view_favorites
    ADD CONSTRAINT view_favorites_created_by_id_dc6047f5_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: view_favorites view_favorites_project_id_241c521d_fk_projects_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY view_favorites
    ADD CONSTRAINT view_favorites_project_id_241c521d_fk_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: view_favorites view_favorites_updated_by_id_2418b683_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY view_favorites
    ADD CONSTRAINT view_favorites_updated_by_id_2418b683_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: view_favorites view_favorites_user_id_b1e94c2e_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY view_favorites
    ADD CONSTRAINT view_favorites_user_id_b1e94c2e_fk_users_id FOREIGN KEY (user_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: view_favorites view_favorites_view_id_3111e893_fk_issue_views_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY view_favorites
    ADD CONSTRAINT view_favorites_view_id_3111e893_fk_issue_views_id FOREIGN KEY (view_id) REFERENCES issue_views(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: view_favorites view_favorites_workspace_id_3dbdd2a2_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY view_favorites
    ADD CONSTRAINT view_favorites_workspace_id_3dbdd2a2_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: webhook_logs webhook_logs_created_by_id_71e7bc38_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY webhook_logs
    ADD CONSTRAINT webhook_logs_created_by_id_71e7bc38_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: webhook_logs webhook_logs_updated_by_id_3d9bad04_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY webhook_logs
    ADD CONSTRAINT webhook_logs_updated_by_id_3d9bad04_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: webhook_logs webhook_logs_webhook_id_53707b3d_fk_webhooks_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY webhook_logs
    ADD CONSTRAINT webhook_logs_webhook_id_53707b3d_fk_webhooks_id FOREIGN KEY (webhook_id) REFERENCES webhooks(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: webhook_logs webhook_logs_workspace_id_ffcd0e31_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY webhook_logs
    ADD CONSTRAINT webhook_logs_workspace_id_ffcd0e31_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: webhooks webhooks_created_by_id_25aca1b0_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY webhooks
    ADD CONSTRAINT webhooks_created_by_id_25aca1b0_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: webhooks webhooks_updated_by_id_ea35154e_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY webhooks
    ADD CONSTRAINT webhooks_updated_by_id_ea35154e_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: webhooks webhooks_workspace_id_da5865d7_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY webhooks
    ADD CONSTRAINT webhooks_workspace_id_da5865d7_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspaces workspace_created_by_id_10ad894e_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspaces
    ADD CONSTRAINT workspace_created_by_id_10ad894e_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_integrations workspace_integratio_integration_id_6cb0aace_fk_integrati; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_integrations
    ADD CONSTRAINT workspace_integratio_integration_id_6cb0aace_fk_integrati FOREIGN KEY (integration_id) REFERENCES integrations(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_integrations workspace_integrations_actor_id_21619aa1_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_integrations
    ADD CONSTRAINT workspace_integrations_actor_id_21619aa1_fk_users_id FOREIGN KEY (actor_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_integrations workspace_integrations_api_token_id_bdb1759b_fk_api_tokens_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_integrations
    ADD CONSTRAINT workspace_integrations_api_token_id_bdb1759b_fk_api_tokens_id FOREIGN KEY (api_token_id) REFERENCES api_tokens(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_integrations workspace_integrations_created_by_id_37639c73_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_integrations
    ADD CONSTRAINT workspace_integrations_created_by_id_37639c73_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_integrations workspace_integrations_updated_by_id_fce01dcb_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_integrations
    ADD CONSTRAINT workspace_integrations_updated_by_id_fce01dcb_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_integrations workspace_integrations_workspace_id_27ebeb6b_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_integrations
    ADD CONSTRAINT workspace_integrations_workspace_id_27ebeb6b_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_members workspace_member_created_by_id_8dc8b040_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_members
    ADD CONSTRAINT workspace_member_created_by_id_8dc8b040_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_member_invites workspace_member_invite_created_by_id_082f21d3_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_member_invites
    ADD CONSTRAINT workspace_member_invite_created_by_id_082f21d3_fk_user_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_member_invites workspace_member_invite_updated_by_id_d31a9c7f_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_member_invites
    ADD CONSTRAINT workspace_member_invite_updated_by_id_d31a9c7f_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_member_invites workspace_member_invite_workspace_id_d935b364_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_member_invites
    ADD CONSTRAINT workspace_member_invite_workspace_id_d935b364_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_members workspace_member_member_id_824f5497_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_members
    ADD CONSTRAINT workspace_member_member_id_824f5497_fk_user_id FOREIGN KEY (member_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_members workspace_member_updated_by_id_1cec0062_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_members
    ADD CONSTRAINT workspace_member_updated_by_id_1cec0062_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_members workspace_member_workspace_id_33f66d4b_fk_workspace_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_members
    ADD CONSTRAINT workspace_member_workspace_id_33f66d4b_fk_workspace_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspaces workspace_owner_id_60a8bafc_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspaces
    ADD CONSTRAINT workspace_owner_id_60a8bafc_fk_user_id FOREIGN KEY (owner_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_themes workspace_themes_actor_id_0e94172e_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_themes
    ADD CONSTRAINT workspace_themes_actor_id_0e94172e_fk_users_id FOREIGN KEY (actor_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_themes workspace_themes_created_by_id_676e2655_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_themes
    ADD CONSTRAINT workspace_themes_created_by_id_676e2655_fk_users_id FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_themes workspace_themes_updated_by_id_bba863fe_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_themes
    ADD CONSTRAINT workspace_themes_updated_by_id_bba863fe_fk_users_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspace_themes workspace_themes_workspace_id_d1bffad8_fk_workspaces_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspace_themes
    ADD CONSTRAINT workspace_themes_workspace_id_d1bffad8_fk_workspaces_id FOREIGN KEY (workspace_id) REFERENCES workspaces(id) DEFERRABLE INITIALLY DEFERRED;

--
-- Name: workspaces workspace_updated_by_id_09d249ed_fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: plane
--

ALTER TABLE ONLY workspaces
    ADD CONSTRAINT workspace_updated_by_id_09d249ed_fk_user_id FOREIGN KEY (updated_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;

