
--
-- Name: ir_category; Type: TABLE; Schema: public; Owner: mattermost
--

CREATE TABLE IF NOT EXISTS public.ir_category (
    id character varying(26) NOT NULL,
    name character varying(512) NOT NULL,
    teamid character varying(26) NOT NULL,
    userid character varying(26) NOT NULL,
    collapsed boolean DEFAULT false,
    createat bigint NOT NULL,
    updateat bigint DEFAULT 0 NOT NULL,
    deleteat bigint DEFAULT 0 NOT NULL
);
ALTER TABLE public.ir_category OWNER TO mattermost;


--
-- Name: ir_category_item; Type: TABLE; Schema: public; Owner: mattermost
--


CREATE TABLE IF NOT EXISTS public.ir_category_item (
    type character varying(1) NOT NULL,
    categoryid character varying(26) NOT NULL,
    itemid character varying(26) NOT NULL
);
ALTER TABLE public.ir_category_item OWNER TO mattermost;


--
-- Name: ir_channelaction; Type: TABLE; Schema: public; Owner: mattermost
--

CREATE TABLE IF NOT EXISTS public.ir_channelaction (
    id character varying(26) NOT NULL,
    channelid character varying(26),
    enabled boolean DEFAULT false,
    deleteat bigint DEFAULT '0'::bigint NOT NULL,
    actiontype character varying(65536) NOT NULL,
    triggertype character varying(65536) NOT NULL,
    payload json NOT NULL
);


ALTER TABLE public.ir_channelaction OWNER TO mattermost;

--
-- Name: ir_incident; Type: TABLE; Schema: public; Owner: mattermost
--

CREATE TABLE public.ir_incident (
    id character varying(26) NOT NULL,
    name character varying(1024) NOT NULL,
    description character varying(4096) NOT NULL,
    isactive boolean NOT NULL,
    commanderuserid character varying(26) NOT NULL,
    teamid character varying(26) NOT NULL,
    channelid character varying(26) NOT NULL,
    createat bigint NOT NULL,
    endat bigint DEFAULT '0'::bigint NOT NULL,
    deleteat bigint DEFAULT '0'::bigint NOT NULL,
    activestage bigint NOT NULL,
    postid character varying(26) DEFAULT ''::character varying NOT NULL,
    playbookid character varying(26) DEFAULT ''::character varying NOT NULL,
    checklistsjson json NOT NULL,
    activestagetitle character varying(1024) DEFAULT ''::character varying,
    reminderpostid character varying(26),
    broadcastchannelid character varying(26) DEFAULT ''::character varying,
    previousreminder bigint DEFAULT '0'::bigint NOT NULL,
    remindermessagetemplate character varying(65536) DEFAULT ''::text,
    currentstatus character varying(1024) DEFAULT 'Active'::character varying NOT NULL,
    reporteruserid character varying(26) DEFAULT ''::character varying NOT NULL,
    concatenatedinviteduserids character varying(65536) DEFAULT ''::text,
    defaultcommanderid character varying(26) DEFAULT ''::character varying,
    announcementchannelid character varying(26) DEFAULT ''::character varying,
    concatenatedwebhookoncreationurls character varying(65536) DEFAULT ''::text,
    concatenatedinvitedgroupids character varying(65536) DEFAULT ''::text,
    retrospective character varying(65536) DEFAULT ''::text,
    messageonjoin character varying(65536) DEFAULT ''::text,
    retrospectivepublishedat bigint DEFAULT '0'::bigint NOT NULL,
    retrospectivereminderintervalseconds bigint DEFAULT '0'::bigint NOT NULL,
    retrospectivewascanceled boolean DEFAULT false,
    concatenatedwebhookonstatusupdateurls character varying(65536) DEFAULT ''::text,
    laststatusupdateat bigint DEFAULT '0'::bigint,
    exportchannelonfinishedenabled boolean DEFAULT false NOT NULL,
    categorizechannelenabled boolean DEFAULT false,
    categoryname character varying(65536) DEFAULT ''::text,
    concatenatedbroadcastchannelids character varying(65536) DEFAULT ''::text,
    channelidtorootid character varying(65536) DEFAULT ''::text,
    remindertimerdefaultseconds bigint DEFAULT '0'::bigint NOT NULL,
    statusupdateenabled boolean DEFAULT true,
    retrospectiveenabled boolean DEFAULT true
);


ALTER TABLE public.ir_incident OWNER TO mattermost;


--
-- Name: focalboard_blocks; Type: TABLE; Schema: public; Owner: mattermost
--

CREATE TABLE IF NOT EXISTS public.focalboard_blocks (
    id character varying(36) NOT NULL,
    insert_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    parent_id character varying(36),
    schema bigint,
    type text,
    title text,
    fields json,
    create_at bigint,
    update_at bigint,
    delete_at bigint,
    root_id character varying(36),
    modified_by character varying(36) NOT NULL,
    workspace_id character varying(36) NOT NULL,
    created_by character varying(36) NOT NULL
);

ALTER TABLE public.focalboard_blocks OWNER TO mattermost;


--
-- Name: focalboard_blocks_history; Type: TABLE; Schema: public; Owner: mattermost
--

CREATE TABLE IF NOT EXISTS public.focalboard_blocks_history (
    id character varying(36) NOT NULL,
    insert_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    parent_id character varying(36),
    schema bigint,
    type text,
    title text,
    fields json,
    create_at bigint,
    update_at bigint,
    delete_at bigint,
    root_id character varying(36),
    modified_by character varying(36),
    workspace_id character varying(36),
    created_by character varying(36)
);

ALTER TABLE public.focalboard_blocks_history OWNER TO mattermost;


--
-- Name: focalboard_sessions; Type: TABLE; Schema: public; Owner: mattermost
--

CREATE TABLE IF NOT EXISTS public.focalboard_sessions (
    id character varying(100) NOT NULL,
    token character varying(100),
    user_id character varying(100),
    props json,
    create_at bigint,
    update_at bigint,
    auth_service character varying(20)
);


ALTER TABLE public.focalboard_sessions OWNER TO mattermost;


--
-- Name: focalboard_users; Type: TABLE; Schema: public; Owner: mattermost
--

CREATE TABLE IF NOT EXISTS public.focalboard_users (
    id character varying(100) NOT NULL,
    username character varying(100),
    email character varying(255),
    password character varying(100),
    mfa_secret character varying(100),
    auth_service character varying(20),
    auth_data character varying(255),
    props json,
    create_at bigint,
    update_at bigint,
    delete_at bigint
);

ALTER TABLE public.focalboard_users OWNER TO mattermost;


--
-- Name: focalboard_blocks idx_25969_primary; Type: CONSTRAINT; Schema: public; Owner: mattermost
--

ALTER TABLE ONLY public.focalboard_blocks
    ADD CONSTRAINT idx_25969_primary PRIMARY KEY (workspace_id, id);


--
-- Name: focalboard_blocks_history idx_25975_primary; Type: CONSTRAINT; Schema: public; Owner: mattermost
--

ALTER TABLE ONLY public.focalboard_blocks_history
    ADD CONSTRAINT idx_25975_primary PRIMARY KEY (id, insert_at);


--
-- Name: focalboard_sessions idx_25987_primary; Type: CONSTRAINT; Schema: public; Owner: mattermost
--

ALTER TABLE ONLY public.focalboard_sessions
    ADD CONSTRAINT idx_25987_primary PRIMARY KEY (id);


--
-- Name: focalboard_users idx_26003_primary; Type: CONSTRAINT; Schema: public; Owner: mattermost
--

ALTER TABLE ONLY public.focalboard_users
    ADD CONSTRAINT idx_26003_primary PRIMARY KEY (id);


--
-- Name: ir_channelaction idx_26042_primary; Type: CONSTRAINT; Schema: public; Owner: mattermost
--

ALTER TABLE ONLY public.ir_channelaction
    ADD CONSTRAINT idx_26042_primary PRIMARY KEY (id);


--  
-- Name: ir_incident idx_26049_primary; Type: CONSTRAINT; Schema: public; Owner: mattermost
--

ALTER TABLE ONLY public.ir_incident
    ADD CONSTRAINT idx_26049_primary PRIMARY KEY (id);



--
-- Name: ir_category_item ir_category_item_pkey; Type: CONSTRAINT; Schema: public; Owner: mattermost
--

ALTER TABLE ONLY public.ir_category_item
    ADD CONSTRAINT ir_category_item_pkey PRIMARY KEY (categoryid, itemid, type);


--
-- Name: ir_category ir_category_pkey; Type: CONSTRAINT; Schema: public; Owner: mattermost
--

ALTER TABLE ONLY public.ir_category
    ADD CONSTRAINT ir_category_pkey PRIMARY KEY (id);


--
-- Name: ir_category_item_categoryid; Type: INDEX; Schema: public; Owner: mattermost
--

CREATE INDEX IF NOT EXISTS ir_category_item_categoryid ON public.ir_category_item USING btree (categoryid);


--
-- Name: ir_category_teamid_userid; Type: INDEX; Schema: public; Owner: mattermost
--

CREATE INDEX IF NOT EXISTS ir_category_teamid_userid ON public.ir_category USING btree (teamid, userid);

