--
--


SELECT pg_catalog.set_config('search_path', '', false);

--
-- Name: public; Type: SCHEMA; Schema: -; Owner: dotcms
--

-- *not* creating schema, since initdb creates it


ALTER SCHEMA public OWNER TO dotcms;

--
-- Name: bigIntBoolResult(boolean, bigint); Type: FUNCTION; Schema: public; Owner: dotcms
--

CREATE FUNCTION public."bigIntBoolResult"("boolParam" boolean, "intParam" bigint) RETURNS boolean
    LANGUAGE sql
    AS $_$select case
		WHEN $1 AND $2 != 0 then true
		WHEN $1 != true AND $2 = 0 then true
		ELSE false
	END$_$;


ALTER FUNCTION public."bigIntBoolResult"("boolParam" boolean, "intParam" bigint) OWNER TO dotcms;

--
-- Name: boolBigIntResult(bigint, boolean); Type: FUNCTION; Schema: public; Owner: dotcms
--

CREATE FUNCTION public."boolBigIntResult"("intParam" bigint, "boolParam" boolean) RETURNS boolean
    LANGUAGE sql
    AS $_$select case
		WHEN $2 AND $1 != 0 then true
		WHEN $2 != true AND $1 = 0 then true
		ELSE false
	END$_$;


ALTER FUNCTION public."boolBigIntResult"("intParam" bigint, "boolParam" boolean) OWNER TO dotcms;

--
-- Name: boolIntResult(integer, boolean); Type: FUNCTION; Schema: public; Owner: dotcms
--

CREATE FUNCTION public."boolIntResult"("intParam" integer, "boolParam" boolean) RETURNS boolean
    LANGUAGE sql
    AS $_$select case
		WHEN $2 AND $1 != 0 then true
		WHEN $2 != true AND $1 = 0 then true
		ELSE false
	END$_$;


ALTER FUNCTION public."boolIntResult"("intParam" integer, "boolParam" boolean) OWNER TO dotcms;

--
-- Name: check_child_assets(); Type: FUNCTION; Schema: public; Owner: dotcms
--

CREATE FUNCTION public.check_child_assets() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
DECLARE
   pathCount integer;
BEGIN
   IF (tg_op = 'DELETE') THEN
      IF(OLD.asset_type ='folder') THEN
	   select count(*) into pathCount from identifier where parent_path = OLD.parent_path||OLD.asset_name||'/'  and host_inode = OLD.host_inode;
	END IF;
	IF(OLD.asset_type ='contentlet') THEN
	   select count(*) into pathCount from identifier where host_inode = OLD.id;
	END IF;
	IF (pathCount > 0 )THEN
	  RAISE EXCEPTION 'Cannot delete as this path has children';
	  RETURN NULL;
	ELSE
	  RETURN OLD;
	END IF;
   END IF;
   RETURN NULL;
END
$$;


ALTER FUNCTION public.check_child_assets() OWNER TO dotcms;

--
-- Name: container_versions_check(); Type: FUNCTION; Schema: public; Owner: dotcms
--

CREATE FUNCTION public.container_versions_check() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
  DECLARE
	versionsCount integer;
  BEGIN
  IF (tg_op = 'DELETE') THEN
    select count(*) into versionsCount from dot_containers where identifier = OLD.identifier;
    IF (versionsCount = 0)THEN
	DELETE from identifier where id = OLD.identifier;
    ELSE
	RETURN OLD;
    END IF;
  END IF;
RETURN NULL;
END
$$;


ALTER FUNCTION public.container_versions_check() OWNER TO dotcms;

--
-- Name: content_versions_check(); Type: FUNCTION; Schema: public; Owner: dotcms
--

CREATE FUNCTION public.content_versions_check() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
   DECLARE
       versionsCount integer;
   BEGIN
       IF (tg_op = 'DELETE') THEN
         select count(*) into versionsCount from contentlet where identifier = OLD.identifier;
         IF (versionsCount = 0)THEN
		DELETE from identifier where id = OLD.identifier;
	   ELSE
	      RETURN OLD;
	   END IF;
	END IF;
   RETURN NULL;
   END
  $$;


ALTER FUNCTION public.content_versions_check() OWNER TO dotcms;

--
-- Name: dotfolderpath(text, text); Type: FUNCTION; Schema: public; Owner: dotcms
--

CREATE FUNCTION public.dotfolderpath(parent_path text, asset_name text) RETURNS text
    LANGUAGE plpgsql
    AS $$
BEGIN
  IF(parent_path='/System folder') THEN
    RETURN '/';
  ELSE
    RETURN parent_path || asset_name || '/';
  END IF;
END;$$;


ALTER FUNCTION public.dotfolderpath(parent_path text, asset_name text) OWNER TO dotcms;

--
-- Name: folder_identifier_check(); Type: FUNCTION; Schema: public; Owner: dotcms
--

CREATE FUNCTION public.folder_identifier_check() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
DECLARE
   versionsCount integer;
BEGIN
   IF (tg_op = 'DELETE') THEN
      select count(*) into versionsCount from folder where identifier = OLD.identifier;
	IF (versionsCount = 0)THEN
	  DELETE from identifier where id = OLD.identifier;
	ELSE
	  RETURN OLD;
	END IF;
   END IF;
   RETURN NULL;
END
$$;


ALTER FUNCTION public.folder_identifier_check() OWNER TO dotcms;



--
-- Name: identifier; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.identifier (
    id character varying(36) NOT NULL,
    parent_path character varying(255),
    asset_name character varying(255),
    host_inode character varying(36),
    asset_type character varying(64),
    syspublish_date timestamp without time zone,
    sysexpire_date timestamp without time zone,
    owner character varying(255),
    create_date timestamp without time zone,
    asset_subtype character varying(255)
);


ALTER TABLE public.identifier OWNER TO dotcms;

--
-- Name: full_path_lc(public.identifier); Type: FUNCTION; Schema: public; Owner: dotcms
--

CREATE FUNCTION public.full_path_lc(public.identifier) RETURNS text
    LANGUAGE sql
    AS $_$ SELECT CASE WHEN $1.parent_path = '/System folder' then '/' else LOWER($1.parent_path || $1.asset_name) end; $_$;


ALTER FUNCTION public.full_path_lc(public.identifier) OWNER TO dotcms;

--
-- Name: identifier_host_inode_check(); Type: FUNCTION; Schema: public; Owner: dotcms
--

CREATE FUNCTION public.identifier_host_inode_check() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
DECLARE
	inodeType varchar(100);
BEGIN
  IF (tg_op = 'INSERT' OR tg_op = 'UPDATE') AND substr(NEW.asset_type, 0, 8) <> 'content' AND
		(NEW.host_inode IS NULL OR NEW.host_inode = '') THEN
		RAISE EXCEPTION 'Cannot insert/update a null or empty host inode for this kind of identifier';
		RETURN NULL;
  ELSE
		RETURN NEW;
  END IF;

  RETURN NULL;
END
$$;


ALTER FUNCTION public.identifier_host_inode_check() OWNER TO dotcms;

--
-- Name: intBoolResult(boolean, integer); Type: FUNCTION; Schema: public; Owner: dotcms
--

CREATE FUNCTION public."intBoolResult"("boolParam" boolean, "intParam" integer) RETURNS boolean
    LANGUAGE sql
    AS $_$select case
		WHEN $1 AND $2 != 0 then true
		WHEN $1 != true AND $2 = 0 then true
		ELSE false
	END$_$;


ALTER FUNCTION public."intBoolResult"("boolParam" boolean, "intParam" integer) OWNER TO dotcms;

--
-- Name: link_versions_check(); Type: FUNCTION; Schema: public; Owner: dotcms
--

CREATE FUNCTION public.link_versions_check() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
  DECLARE
	versionsCount integer;
  BEGIN
  IF (tg_op = 'DELETE') THEN
    select count(*) into versionsCount from links where identifier = OLD.identifier;
    IF (versionsCount = 0)THEN
	DELETE from identifier where id = OLD.identifier;
    ELSE
	RETURN OLD;
    END IF;
  END IF;
RETURN NULL;
END
$$;


ALTER FUNCTION public.link_versions_check() OWNER TO dotcms;

--
-- Name: rename_folder_and_assets(); Type: FUNCTION; Schema: public; Owner: dotcms
--

CREATE FUNCTION public.rename_folder_and_assets() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
DECLARE
   old_parent_path varchar(255);
   old_path varchar(255);
   new_path varchar(255);
   old_name varchar(255);
   hostInode varchar(100);
BEGIN
   IF (tg_op = 'UPDATE' AND NEW.name<>OLD.name) THEN
      select asset_name,parent_path,host_inode INTO old_name,old_parent_path,hostInode from identifier where id = NEW.identifier;
      old_path := old_parent_path || old_name || '/';
      new_path := old_parent_path || NEW.name || '/';
      UPDATE identifier SET asset_name = NEW.name where id = NEW.identifier;
      PERFORM renameFolderChildren(old_path,new_path,hostInode);
      RETURN NEW;
   END IF;
RETURN NULL;
END
$$;


ALTER FUNCTION public.rename_folder_and_assets() OWNER TO dotcms;

--
-- Name: renamefolderchildren(character varying, character varying, character varying); Type: FUNCTION; Schema: public; Owner: dotcms
--

CREATE FUNCTION public.renamefolderchildren(old_path character varying, new_path character varying, hostinode character varying) RETURNS void
    LANGUAGE plpgsql
    AS $$
DECLARE
   fi identifier;
   new_folder_path varchar(255);
   old_folder_path varchar(255);
BEGIN
    UPDATE identifier SET  parent_path  = new_path where parent_path = old_path and host_inode = hostInode;
    FOR fi IN select * from identifier where asset_type='folder' and parent_path = new_path and host_inode = hostInode LOOP
	 new_folder_path := new_path ||fi.asset_name||'/';
	 old_folder_path := old_path ||fi.asset_name||'/';
	 PERFORM renameFolderChildren(old_folder_path,new_folder_path,hostInode);
    END LOOP;
END
$$;


ALTER FUNCTION public.renamefolderchildren(old_path character varying, new_path character varying, hostinode character varying) OWNER TO dotcms;

--
-- Name: structure_host_folder_check(); Type: FUNCTION; Schema: public; Owner: dotcms
--

CREATE FUNCTION public.structure_host_folder_check() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
DECLARE
    folderInode varchar(100);
    hostInode varchar(100);
BEGIN
    IF ((tg_op = 'INSERT' OR tg_op = 'UPDATE') AND (NEW.host IS NOT NULL AND NEW.host <> '' AND NEW.host <> 'SYSTEM_HOST'
          AND NEW.folder IS NOT NULL AND NEW.folder <> 'SYSTEM_FOLDER' AND NEW.folder <> '')) THEN
          select host_inode,folder.inode INTO hostInode,folderInode from folder,identifier where folder.identifier = identifier.id and folder.inode=NEW.folder;
	  IF (FOUND AND NEW.host = hostInode) THEN
		 RETURN NEW;
	  ELSE
		 RAISE EXCEPTION 'Cannot assign host/folder to structure, folder does not belong to given host';
		 RETURN NULL;
	  END IF;
    ELSE
        IF((tg_op = 'INSERT' OR tg_op = 'UPDATE') AND (NEW.host IS NULL OR NEW.host = '' OR NEW.host= 'SYSTEM_HOST'
           OR NEW.folder IS NULL OR NEW.folder = '' OR NEW.folder = 'SYSTEM_FOLDER')) THEN
          IF(NEW.host = 'SYSTEM_HOST' OR NEW.host IS NULL OR NEW.host = '') THEN
             NEW.host = 'SYSTEM_HOST';
             NEW.folder = 'SYSTEM_FOLDER';
          END IF;
          IF(NEW.folder = 'SYSTEM_FOLDER' OR NEW.folder IS NULL OR NEW.folder = '') THEN
             NEW.folder = 'SYSTEM_FOLDER';
          END IF;
        RETURN NEW;
        END IF;
    END IF;
  RETURN NULL;
END
$$;


ALTER FUNCTION public.structure_host_folder_check() OWNER TO dotcms;

--
-- Name: template_versions_check(); Type: FUNCTION; Schema: public; Owner: dotcms
--

CREATE FUNCTION public.template_versions_check() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
  DECLARE
	versionsCount integer;
  BEGIN
  IF (tg_op = 'DELETE') THEN
    select count(*) into versionsCount from template where identifier = OLD.identifier;
    IF (versionsCount = 0)THEN
	DELETE from identifier where id = OLD.identifier;
    ELSE
	RETURN OLD;
    END IF;
  END IF;
RETURN NULL;
END
$$;


ALTER FUNCTION public.template_versions_check() OWNER TO dotcms;

--
-- Name: =; Type: OPERATOR; Schema: public; Owner: dotcms
--

CREATE OPERATOR public.= (
    FUNCTION = public."intBoolResult",
    LEFTARG = boolean,
    RIGHTARG = integer
);


ALTER OPERATOR public.= (boolean, integer) OWNER TO dotcms;

--
-- Name: =; Type: OPERATOR; Schema: public; Owner: dotcms
--

CREATE OPERATOR public.= (
    FUNCTION = public."boolIntResult",
    LEFTARG = integer,
    RIGHTARG = boolean
);


ALTER OPERATOR public.= (integer, boolean) OWNER TO dotcms;

--
-- Name: =; Type: OPERATOR; Schema: public; Owner: dotcms
--

CREATE OPERATOR public.= (
    FUNCTION = public."bigIntBoolResult",
    LEFTARG = boolean,
    RIGHTARG = bigint
);


ALTER OPERATOR public.= (boolean, bigint) OWNER TO dotcms;

--
-- Name: =; Type: OPERATOR; Schema: public; Owner: dotcms
--

CREATE OPERATOR public.= (
    FUNCTION = public."boolBigIntResult",
    LEFTARG = bigint,
    RIGHTARG = boolean
);


ALTER OPERATOR public.= (bigint, boolean) OWNER TO dotcms;

--
-- Name: address; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.address (
    addressid character varying(100) NOT NULL,
    companyid character varying(100) NOT NULL,
    userid character varying(100) NOT NULL,
    username character varying(100),
    createdate timestamp without time zone,
    modifieddate timestamp without time zone,
    classname character varying(100),
    classpk character varying(100),
    description character varying(100),
    street1 character varying(100),
    street2 character varying(100),
    city character varying(100),
    state character varying(100),
    zip character varying(100),
    country character varying(100),
    phone character varying(100),
    fax character varying(100),
    cell character varying(100),
    priority integer
);


ALTER TABLE public.address OWNER TO dotcms;

--
-- Name: adminconfig; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.adminconfig (
    configid character varying(100) NOT NULL,
    companyid character varying(100) NOT NULL,
    type_ character varying(100),
    name character varying(100),
    config text
);


ALTER TABLE public.adminconfig OWNER TO dotcms;

--
-- Name: analytic_summary; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.analytic_summary (
    id bigint NOT NULL,
    summary_period_id bigint NOT NULL,
    host_id character varying(36) NOT NULL,
    visits bigint,
    page_views bigint,
    unique_visits bigint,
    new_visits bigint,
    direct_traffic bigint,
    referring_sites bigint,
    search_engines bigint,
    bounce_rate integer,
    avg_time_on_site timestamp without time zone
);


ALTER TABLE public.analytic_summary OWNER TO dotcms;

--
-- Name: analytic_summary_404; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.analytic_summary_404 (
    id bigint NOT NULL,
    summary_period_id bigint NOT NULL,
    host_id character varying(36),
    uri character varying(255),
    referer_uri character varying(255)
);


ALTER TABLE public.analytic_summary_404 OWNER TO dotcms;

--
-- Name: analytic_summary_content; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.analytic_summary_content (
    id bigint NOT NULL,
    summary_id bigint NOT NULL,
    inode character varying(255),
    hits bigint,
    uri character varying(255),
    title character varying(255)
);


ALTER TABLE public.analytic_summary_content OWNER TO dotcms;

--
-- Name: analytic_summary_pages; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.analytic_summary_pages (
    id bigint NOT NULL,
    summary_id bigint NOT NULL,
    inode character varying(255),
    hits bigint,
    uri character varying(255)
);


ALTER TABLE public.analytic_summary_pages OWNER TO dotcms;

--
-- Name: analytic_summary_period; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.analytic_summary_period (
    id bigint NOT NULL,
    full_date timestamp without time zone,
    day integer,
    week integer,
    month integer,
    year character varying(255),
    dayname character varying(50) NOT NULL,
    monthname character varying(50) NOT NULL
);


ALTER TABLE public.analytic_summary_period OWNER TO dotcms;

--
-- Name: analytic_summary_referer; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.analytic_summary_referer (
    id bigint NOT NULL,
    summary_id bigint NOT NULL,
    hits bigint,
    uri character varying(255)
);


ALTER TABLE public.analytic_summary_referer OWNER TO dotcms;

--
-- Name: analytic_summary_visits; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.analytic_summary_visits (
    id bigint NOT NULL,
    summary_period_id bigint NOT NULL,
    host_id character varying(36),
    visit_time timestamp without time zone,
    visits bigint
);


ALTER TABLE public.analytic_summary_visits OWNER TO dotcms;

--
-- Name: analytic_summary_workstream; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.analytic_summary_workstream (
    id bigint NOT NULL,
    inode character varying(255),
    asset_type character varying(255),
    mod_user_id character varying(255),
    host_id character varying(36),
    mod_date timestamp without time zone,
    action character varying(255),
    name character varying(255)
);


ALTER TABLE public.analytic_summary_workstream OWNER TO dotcms;

--
-- Name: api_token_issued; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.api_token_issued (
    token_id character varying(255) NOT NULL,
    token_userid character varying(255) NOT NULL,
    issue_date timestamp without time zone NOT NULL,
    expire_date timestamp without time zone NOT NULL,
    requested_by_userid character varying(255) NOT NULL,
    requested_by_ip character varying(255) NOT NULL,
    revoke_date timestamp without time zone,
    allowed_from character varying(255),
    issuer character varying(255),
    claims text,
    mod_date timestamp without time zone NOT NULL
);


ALTER TABLE public.api_token_issued OWNER TO dotcms;

--
-- Name: broken_link; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.broken_link (
    id character varying(36) NOT NULL,
    inode character varying(36) NOT NULL,
    field character varying(36) NOT NULL,
    link character varying(255) NOT NULL,
    title character varying(255) NOT NULL,
    status_code integer NOT NULL
);


ALTER TABLE public.broken_link OWNER TO dotcms;

--
-- Name: calendar_reminder; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.calendar_reminder (
    user_id character varying(255) NOT NULL,
    event_id character varying(36) NOT NULL,
    send_date timestamp without time zone NOT NULL
);


ALTER TABLE public.calendar_reminder OWNER TO dotcms;

--
-- Name: campaign; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.campaign (
    inode character varying(36) NOT NULL,
    title character varying(255),
    from_email character varying(255),
    from_name character varying(255),
    subject character varying(255),
    message text,
    user_id character varying(255),
    start_date timestamp without time zone,
    completed_date timestamp without time zone,
    active boolean DEFAULT false,
    locked boolean,
    sends_per_hour character varying(15),
    sendemail boolean,
    communicationinode character varying(36),
    userfilterinode character varying(36),
    sendto character varying(15),
    isrecurrent boolean,
    wassent boolean,
    expiration_date timestamp without time zone,
    parent_campaign character varying(36)
);


ALTER TABLE public.campaign OWNER TO dotcms;

--
-- Name: category; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.category (
    inode character varying(36) NOT NULL,
    category_name character varying(255),
    category_key character varying(255),
    sort_order integer,
    active boolean,
    keywords text,
    category_velocity_var_name character varying(255) NOT NULL,
    mod_date timestamp without time zone
);


ALTER TABLE public.category OWNER TO dotcms;

--
-- Name: chain; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.chain (
    id bigint NOT NULL,
    key_name character varying(255),
    name character varying(255) NOT NULL,
    success_value character varying(255) NOT NULL,
    failure_value character varying(255) NOT NULL
);


ALTER TABLE public.chain OWNER TO dotcms;

--
-- Name: chain_link_code; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.chain_link_code (
    id bigint NOT NULL,
    class_name character varying(255),
    code text NOT NULL,
    last_mod_date timestamp without time zone NOT NULL,
    language character varying(255) NOT NULL
);


ALTER TABLE public.chain_link_code OWNER TO dotcms;

--
-- Name: chain_link_code_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.chain_link_code_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.chain_link_code_seq OWNER TO dotcms;

--
-- Name: chain_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.chain_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.chain_seq OWNER TO dotcms;

--
-- Name: chain_state; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.chain_state (
    id bigint NOT NULL,
    chain_id bigint NOT NULL,
    link_code_id bigint NOT NULL,
    state_order bigint NOT NULL
);


ALTER TABLE public.chain_state OWNER TO dotcms;

--
-- Name: chain_state_parameter; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.chain_state_parameter (
    id bigint NOT NULL,
    chain_state_id bigint NOT NULL,
    name character varying(255) NOT NULL,
    value character varying(255) NOT NULL
);


ALTER TABLE public.chain_state_parameter OWNER TO dotcms;

--
-- Name: chain_state_parameter_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.chain_state_parameter_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.chain_state_parameter_seq OWNER TO dotcms;

--
-- Name: chain_state_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.chain_state_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.chain_state_seq OWNER TO dotcms;

--
-- Name: challenge_question; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.challenge_question (
    cquestionid bigint NOT NULL,
    cqtext character varying(255)
);


ALTER TABLE public.challenge_question OWNER TO dotcms;

--
-- Name: click; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.click (
    inode character varying(36) NOT NULL,
    link character varying(255),
    click_count integer
);


ALTER TABLE public.click OWNER TO dotcms;

--
-- Name: clickstream; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.clickstream (
    clickstream_id bigint NOT NULL,
    cookie_id character varying(255),
    user_id character varying(255),
    start_date timestamp without time zone,
    end_date timestamp without time zone,
    referer character varying(255),
    remote_address character varying(255),
    remote_hostname character varying(255),
    user_agent character varying(255),
    bot boolean,
    host_id character varying(36),
    last_page_id character varying(50),
    first_page_id character varying(50),
    operating_system character varying(50),
    browser_name character varying(50),
    browser_version character varying(50),
    mobile_device boolean,
    number_of_requests integer
);


ALTER TABLE public.clickstream OWNER TO dotcms;

--
-- Name: clickstream_404; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.clickstream_404 (
    clickstream_404_id bigint NOT NULL,
    referer_uri character varying(255),
    query_string text,
    request_uri character varying(255),
    user_id character varying(255),
    host_id character varying(36),
    timestampper timestamp without time zone
);


ALTER TABLE public.clickstream_404 OWNER TO dotcms;

--
-- Name: clickstream_404_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.clickstream_404_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.clickstream_404_seq OWNER TO dotcms;

--
-- Name: clickstream_request; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.clickstream_request (
    clickstream_request_id bigint NOT NULL,
    clickstream_id bigint,
    server_name character varying(255),
    protocol character varying(255),
    server_port integer,
    request_uri character varying(255),
    request_order integer,
    query_string text,
    language_id bigint,
    timestampper timestamp without time zone,
    host_id character varying(36),
    associated_identifier character varying(36)
);


ALTER TABLE public.clickstream_request OWNER TO dotcms;

--
-- Name: clickstream_request_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.clickstream_request_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.clickstream_request_seq OWNER TO dotcms;

--
-- Name: clickstream_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.clickstream_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.clickstream_seq OWNER TO dotcms;

--
-- Name: cluster_server; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.cluster_server (
    server_id character varying(36) NOT NULL,
    cluster_id character varying(36) NOT NULL,
    name character varying(100),
    ip_address character varying(39) NOT NULL,
    host character varying(255),
    cache_port smallint,
    es_transport_tcp_port smallint,
    es_network_port smallint,
    es_http_port smallint,
    key_ character varying(100)
);


ALTER TABLE public.cluster_server OWNER TO dotcms;

--
-- Name: cluster_server_action; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.cluster_server_action (
    server_action_id character varying(36) NOT NULL,
    originator_id character varying(36) NOT NULL,
    server_id character varying(36) NOT NULL,
    failed boolean,
    response character varying(2048),
    action_id character varying(1024) NOT NULL,
    completed boolean,
    entered_date timestamp without time zone NOT NULL,
    time_out_seconds bigint NOT NULL
);


ALTER TABLE public.cluster_server_action OWNER TO dotcms;

--
-- Name: cluster_server_uptime; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.cluster_server_uptime (
    id character varying(36) NOT NULL,
    server_id character varying(36),
    startup timestamp without time zone,
    heartbeat timestamp without time zone
);


ALTER TABLE public.cluster_server_uptime OWNER TO dotcms;

--
-- Name: cms_layout; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.cms_layout (
    id character varying(36) NOT NULL,
    layout_name character varying(255) NOT NULL,
    description character varying(255),
    tab_order integer
);


ALTER TABLE public.cms_layout OWNER TO dotcms;

--
-- Name: cms_layouts_portlets; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.cms_layouts_portlets (
    id character varying(36) NOT NULL,
    layout_id character varying(36) NOT NULL,
    portlet_id character varying(100) NOT NULL,
    portlet_order integer
);


ALTER TABLE public.cms_layouts_portlets OWNER TO dotcms;

--
-- Name: cms_role; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.cms_role (
    id character varying(36) NOT NULL,
    role_name character varying(255) NOT NULL,
    description text,
    role_key character varying(255),
    db_fqn character varying(1000) NOT NULL,
    parent character varying(36) NOT NULL,
    edit_permissions boolean,
    edit_users boolean,
    edit_layouts boolean,
    locked boolean,
    system boolean
);


ALTER TABLE public.cms_role OWNER TO dotcms;

--
-- Name: cms_roles_ir; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.cms_roles_ir (
    name character varying(1000),
    role_key character varying(255),
    local_role_id character varying(36) NOT NULL,
    remote_role_id character varying(36),
    local_role_fqn character varying(1000),
    remote_role_fqn character varying(1000),
    endpoint_id character varying(40) NOT NULL
);


ALTER TABLE public.cms_roles_ir OWNER TO dotcms;

--
-- Name: communication; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.communication (
    inode character varying(36) NOT NULL,
    title character varying(255),
    trackback_link_inode character varying(36),
    communication_type character varying(255),
    from_name character varying(255),
    from_email character varying(255),
    email_subject character varying(255),
    html_page_inode character varying(36),
    text_message text,
    mod_date timestamp without time zone,
    modified_by character varying(255),
    ext_comm_id character varying(255)
);


ALTER TABLE public.communication OWNER TO dotcms;

--
-- Name: company; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.company (
    companyid character varying(100) NOT NULL,
    key_ text,
    portalurl character varying(100) NOT NULL,
    homeurl character varying(100) NOT NULL,
    mx character varying(100) NOT NULL,
    name character varying(100) NOT NULL,
    shortname character varying(100) NOT NULL,
    type_ character varying(100),
    size_ character varying(100),
    street character varying(100),
    city character varying(100),
    state character varying(100),
    zip character varying(100),
    phone character varying(100),
    fax character varying(100),
    emailaddress character varying(100),
    authtype character varying(100),
    autologin boolean,
    strangers boolean
);


ALTER TABLE public.company OWNER TO dotcms;

--
-- Name: container_structures; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.container_structures (
    id character varying(36) NOT NULL,
    container_id character varying(36) NOT NULL,
    container_inode character varying(36) NOT NULL,
    structure_id character varying(36) NOT NULL,
    code text
);


ALTER TABLE public.container_structures OWNER TO dotcms;

--
-- Name: container_version_info; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.container_version_info (
    identifier character varying(36) NOT NULL,
    working_inode character varying(36) NOT NULL,
    live_inode character varying(36),
    deleted boolean NOT NULL,
    locked_by character varying(100),
    locked_on timestamp without time zone,
    version_ts timestamp without time zone NOT NULL
);


ALTER TABLE public.container_version_info OWNER TO dotcms;

--
-- Name: content_rating; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.content_rating (
    id bigint NOT NULL,
    rating real,
    user_id character varying(255),
    session_id character varying(255),
    identifier character varying(36),
    rating_date timestamp without time zone,
    user_ip character varying(255),
    long_live_cookie_id character varying(255)
);


ALTER TABLE public.content_rating OWNER TO dotcms;

--
-- Name: content_rating_sequence; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.content_rating_sequence
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.content_rating_sequence OWNER TO dotcms;

--
-- Name: contentlet; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.contentlet (
    inode character varying(36) NOT NULL,
    show_on_menu boolean,
    title character varying(255),
    mod_date timestamp without time zone,
    mod_user character varying(100),
    sort_order integer,
    friendly_name character varying(255),
    structure_inode character varying(36),
    last_review timestamp without time zone,
    next_review timestamp without time zone,
    review_interval character varying(255),
    disabled_wysiwyg character varying(255),
    identifier character varying(36),
    language_id bigint,
    date1 timestamp without time zone,
    date2 timestamp without time zone,
    date3 timestamp without time zone,
    date4 timestamp without time zone,
    date5 timestamp without time zone,
    date6 timestamp without time zone,
    date7 timestamp without time zone,
    date8 timestamp without time zone,
    date9 timestamp without time zone,
    date10 timestamp without time zone,
    date11 timestamp without time zone,
    date12 timestamp without time zone,
    date13 timestamp without time zone,
    date14 timestamp without time zone,
    date15 timestamp without time zone,
    date16 timestamp without time zone,
    date17 timestamp without time zone,
    date18 timestamp without time zone,
    date19 timestamp without time zone,
    date20 timestamp without time zone,
    date21 timestamp without time zone,
    date22 timestamp without time zone,
    date23 timestamp without time zone,
    date24 timestamp without time zone,
    date25 timestamp without time zone,
    text1 character varying(255),
    text2 character varying(255),
    text3 character varying(255),
    text4 character varying(255),
    text5 character varying(255),
    text6 character varying(255),
    text7 character varying(255),
    text8 character varying(255),
    text9 character varying(255),
    text10 character varying(255),
    text11 character varying(255),
    text12 character varying(255),
    text13 character varying(255),
    text14 character varying(255),
    text15 character varying(255),
    text16 character varying(255),
    text17 character varying(255),
    text18 character varying(255),
    text19 character varying(255),
    text20 character varying(255),
    text21 character varying(255),
    text22 character varying(255),
    text23 character varying(255),
    text24 character varying(255),
    text25 character varying(255),
    text_area1 text,
    text_area2 text,
    text_area3 text,
    text_area4 text,
    text_area5 text,
    text_area6 text,
    text_area7 text,
    text_area8 text,
    text_area9 text,
    text_area10 text,
    text_area11 text,
    text_area12 text,
    text_area13 text,
    text_area14 text,
    text_area15 text,
    text_area16 text,
    text_area17 text,
    text_area18 text,
    text_area19 text,
    text_area20 text,
    text_area21 text,
    text_area22 text,
    text_area23 text,
    text_area24 text,
    text_area25 text,
    integer1 bigint,
    integer2 bigint,
    integer3 bigint,
    integer4 bigint,
    integer5 bigint,
    integer6 bigint,
    integer7 bigint,
    integer8 bigint,
    integer9 bigint,
    integer10 bigint,
    integer11 bigint,
    integer12 bigint,
    integer13 bigint,
    integer14 bigint,
    integer15 bigint,
    integer16 bigint,
    integer17 bigint,
    integer18 bigint,
    integer19 bigint,
    integer20 bigint,
    integer21 bigint,
    integer22 bigint,
    integer23 bigint,
    integer24 bigint,
    integer25 bigint,
    float1 real,
    float2 real,
    float3 real,
    float4 real,
    float5 real,
    float6 real,
    float7 real,
    float8 real,
    float9 real,
    float10 real,
    float11 real,
    float12 real,
    float13 real,
    float14 real,
    float15 real,
    float16 real,
    float17 real,
    float18 real,
    float19 real,
    float20 real,
    float21 real,
    float22 real,
    float23 real,
    float24 real,
    float25 real,
    bool1 boolean,
    bool2 boolean,
    bool3 boolean,
    bool4 boolean,
    bool5 boolean,
    bool6 boolean,
    bool7 boolean,
    bool8 boolean,
    bool9 boolean,
    bool10 boolean,
    bool11 boolean,
    bool12 boolean,
    bool13 boolean,
    bool14 boolean,
    bool15 boolean,
    bool16 boolean,
    bool17 boolean,
    bool18 boolean,
    bool19 boolean,
    bool20 boolean,
    bool21 boolean,
    bool22 boolean,
    bool23 boolean,
    bool24 boolean,
    bool25 boolean
);


ALTER TABLE public.contentlet OWNER TO dotcms;

--
-- Name: contentlet_version_info; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.contentlet_version_info (
    identifier character varying(36) NOT NULL,
    lang bigint NOT NULL,
    working_inode character varying(36) NOT NULL,
    live_inode character varying(36),
    deleted boolean NOT NULL,
    locked_by character varying(100),
    locked_on timestamp without time zone,
    version_ts timestamp without time zone NOT NULL
);


ALTER TABLE public.contentlet_version_info OWNER TO dotcms;

--
-- Name: counter; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.counter (
    name character varying(100) NOT NULL,
    currentid integer
);


ALTER TABLE public.counter OWNER TO dotcms;

--
-- Name: dashboard_user_preferences; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.dashboard_user_preferences (
    id bigint NOT NULL,
    summary_404_id bigint,
    user_id character varying(255),
    ignored boolean,
    mod_date timestamp without time zone
);


ALTER TABLE public.dashboard_user_preferences OWNER TO dotcms;

--
-- Name: dashboard_usrpref_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.dashboard_usrpref_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.dashboard_usrpref_seq OWNER TO dotcms;

--
-- Name: db_version; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.db_version (
    db_version integer NOT NULL,
    date_update timestamp with time zone NOT NULL
);


ALTER TABLE public.db_version OWNER TO dotcms;

--
-- Name: dist_journal; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.dist_journal (
    id bigint NOT NULL,
    object_to_index character varying(1024) NOT NULL,
    serverid character varying(64),
    journal_type integer NOT NULL,
    time_entered timestamp without time zone NOT NULL
);


ALTER TABLE public.dist_journal OWNER TO dotcms;

--
-- Name: dist_journal_id_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.dist_journal_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.dist_journal_id_seq OWNER TO dotcms;

--
-- Name: dist_journal_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dotcms
--

ALTER SEQUENCE public.dist_journal_id_seq OWNED BY public.dist_journal.id;


--
-- Name: dist_process; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.dist_process (
    id bigint NOT NULL,
    object_to_index character varying(1024) NOT NULL,
    serverid character varying(64),
    journal_type integer NOT NULL,
    time_entered timestamp without time zone NOT NULL
);


ALTER TABLE public.dist_process OWNER TO dotcms;

--
-- Name: dist_process_id_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.dist_process_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.dist_process_id_seq OWNER TO dotcms;

--
-- Name: dist_process_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dotcms
--

ALTER SEQUENCE public.dist_process_id_seq OWNED BY public.dist_process.id;


--
-- Name: dist_reindex_journal; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.dist_reindex_journal (
    id bigint NOT NULL,
    inode_to_index character varying(100) NOT NULL,
    ident_to_index character varying(100) NOT NULL,
    serverid character varying(64),
    priority integer NOT NULL,
    time_entered timestamp without time zone DEFAULT CURRENT_DATE NOT NULL,
    index_val character varying(325),
    dist_action integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.dist_reindex_journal OWNER TO dotcms;

--
-- Name: dist_reindex_journal_id_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.dist_reindex_journal_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.dist_reindex_journal_id_seq OWNER TO dotcms;

--
-- Name: dist_reindex_journal_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dotcms
--

ALTER SEQUENCE public.dist_reindex_journal_id_seq OWNED BY public.dist_reindex_journal.id;


--
-- Name: dot_cluster; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.dot_cluster (
    cluster_id character varying(36) NOT NULL,
    cluster_salt character varying(256)
);


ALTER TABLE public.dot_cluster OWNER TO dotcms;

--
-- Name: dot_containers; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.dot_containers (
    inode character varying(36) NOT NULL,
    code text,
    pre_loop text,
    post_loop text,
    show_on_menu boolean,
    title character varying(255),
    mod_date timestamp without time zone,
    mod_user character varying(100),
    sort_order integer,
    friendly_name character varying(255),
    max_contentlets integer,
    use_div boolean,
    staticify boolean,
    sort_contentlets_by character varying(255),
    lucene_query text,
    notes character varying(255),
    identifier character varying(36)
);


ALTER TABLE public.dot_containers OWNER TO dotcms;

--
-- Name: dot_rule; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.dot_rule (
    id character varying(36) NOT NULL,
    name character varying(255) NOT NULL,
    fire_on character varying(20),
    short_circuit boolean DEFAULT false,
    parent_id character varying(36) NOT NULL,
    folder character varying(36) NOT NULL,
    priority integer DEFAULT 0,
    enabled boolean DEFAULT false,
    mod_date timestamp without time zone
);


ALTER TABLE public.dot_rule OWNER TO dotcms;

--
-- Name: field; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.field (
    inode character varying(36) NOT NULL,
    structure_inode character varying(255),
    field_name character varying(255),
    field_type character varying(255),
    field_relation_type character varying(255),
    field_contentlet character varying(255),
    required boolean,
    indexed boolean,
    listed boolean,
    velocity_var_name character varying(255),
    sort_order integer,
    field_values text,
    regex_check character varying(255),
    hint character varying(255),
    default_value character varying(255),
    fixed boolean DEFAULT false NOT NULL,
    read_only boolean DEFAULT false NOT NULL,
    searchable boolean,
    unique_ boolean,
    mod_date timestamp without time zone
);


ALTER TABLE public.field OWNER TO dotcms;

--
-- Name: field_variable; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.field_variable (
    id character varying(36) NOT NULL,
    field_id character varying(36),
    variable_name character varying(255),
    variable_key character varying(255),
    variable_value text,
    user_id character varying(255),
    last_mod_date timestamp without time zone
);


ALTER TABLE public.field_variable OWNER TO dotcms;

--
-- Name: fileassets_ir; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.fileassets_ir (
    file_name character varying(255),
    local_working_inode character varying(36) NOT NULL,
    local_live_inode character varying(36),
    remote_working_inode character varying(36),
    remote_live_inode character varying(36),
    local_identifier character varying(36),
    remote_identifier character varying(36),
    endpoint_id character varying(40) NOT NULL,
    language_id bigint NOT NULL
);


ALTER TABLE public.fileassets_ir OWNER TO dotcms;

--
-- Name: fixes_audit; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.fixes_audit (
    id character varying(36) NOT NULL,
    table_name character varying(255),
    action character varying(255),
    records_altered integer,
    datetime timestamp without time zone
);


ALTER TABLE public.fixes_audit OWNER TO dotcms;

--
-- Name: folder; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.folder (
    inode character varying(36) NOT NULL,
    name character varying(255),
    title character varying(255) NOT NULL,
    show_on_menu boolean,
    sort_order integer,
    files_masks character varying(255),
    identifier character varying(36),
    default_file_type character varying(36),
    mod_date timestamp without time zone
);


ALTER TABLE public.folder OWNER TO dotcms;

--
-- Name: folders_ir; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.folders_ir (
    folder character varying(255),
    local_inode character varying(36) NOT NULL,
    remote_inode character varying(36),
    local_identifier character varying(36),
    remote_identifier character varying(36),
    endpoint_id character varying(40) NOT NULL
);


ALTER TABLE public.folders_ir OWNER TO dotcms;

--
-- Name: host_variable; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.host_variable (
    id character varying(36) NOT NULL,
    host_id character varying(36),
    variable_name character varying(255),
    variable_key character varying(255),
    variable_value character varying(255),
    user_id character varying(255),
    last_mod_date timestamp without time zone
);


ALTER TABLE public.host_variable OWNER TO dotcms;

--
-- Name: htmlpages_ir; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.htmlpages_ir (
    html_page character varying(255),
    local_working_inode character varying(36) NOT NULL,
    local_live_inode character varying(36),
    remote_working_inode character varying(36),
    remote_live_inode character varying(36),
    local_identifier character varying(36),
    remote_identifier character varying(36),
    endpoint_id character varying(40) NOT NULL,
    language_id bigint NOT NULL
);


ALTER TABLE public.htmlpages_ir OWNER TO dotcms;

--
-- Name: image; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.image (
    imageid character varying(200) NOT NULL,
    text_ text NOT NULL
);


ALTER TABLE public.image OWNER TO dotcms;

--
-- Name: import_audit; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.import_audit (
    id bigint NOT NULL,
    start_date timestamp without time zone,
    userid character varying(255),
    filename character varying(512),
    status integer,
    last_inode character varying(100),
    records_to_import bigint,
    serverid character varying(255),
    warnings text,
    errors text,
    results text,
    messages text
);


ALTER TABLE public.import_audit OWNER TO dotcms;

--
-- Name: indicies; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.indicies (
    index_name character varying(100) NOT NULL,
    index_type character varying(16) NOT NULL
);


ALTER TABLE public.indicies OWNER TO dotcms;

--
-- Name: inode; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.inode (
    inode character varying(36) NOT NULL,
    owner character varying(255),
    idate timestamp without time zone,
    type character varying(64)
);


ALTER TABLE public.inode OWNER TO dotcms;

--
-- Name: language; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.language (
    id bigint NOT NULL,
    language_code character varying(5),
    country_code character varying(255),
    language character varying(255),
    country character varying(255)
);


ALTER TABLE public.language OWNER TO dotcms;

--
-- Name: layouts_cms_roles; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.layouts_cms_roles (
    id character varying(36) NOT NULL,
    layout_id character varying(36) NOT NULL,
    role_id character varying(36) NOT NULL
);


ALTER TABLE public.layouts_cms_roles OWNER TO dotcms;

--
-- Name: link_version_info; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.link_version_info (
    identifier character varying(36) NOT NULL,
    working_inode character varying(36) NOT NULL,
    live_inode character varying(36),
    deleted boolean NOT NULL,
    locked_by character varying(100),
    locked_on timestamp without time zone,
    version_ts timestamp without time zone NOT NULL
);


ALTER TABLE public.link_version_info OWNER TO dotcms;

--
-- Name: links; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.links (
    inode character varying(36) NOT NULL,
    show_on_menu boolean,
    title character varying(255),
    mod_date timestamp without time zone,
    mod_user character varying(100),
    sort_order integer,
    friendly_name character varying(255),
    identifier character varying(36),
    protocal character varying(100),
    url character varying(255),
    target character varying(100),
    internal_link_identifier character varying(36),
    link_type character varying(255),
    link_code text
);


ALTER TABLE public.links OWNER TO dotcms;

--
-- Name: log_mapper; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.log_mapper (
    enabled numeric(1,0) NOT NULL,
    log_name character varying(30) NOT NULL,
    description character varying(50) NOT NULL
);


ALTER TABLE public.log_mapper OWNER TO dotcms;

--
-- Name: mailing_list; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.mailing_list (
    inode character varying(36) NOT NULL,
    title character varying(255),
    public_list boolean,
    user_id character varying(255)
);


ALTER TABLE public.mailing_list OWNER TO dotcms;

--
-- Name: multi_tree; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.multi_tree (
    child character varying(36) NOT NULL,
    parent1 character varying(36) NOT NULL,
    parent2 character varying(36) NOT NULL,
    relation_type character varying(64) NOT NULL,
    tree_order integer,
    personalization character varying(255) DEFAULT 'dot:default'::character varying NOT NULL
);


ALTER TABLE public.multi_tree OWNER TO dotcms;

--
-- Name: notification; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.notification (
    group_id character varying(36) NOT NULL,
    user_id character varying(255) NOT NULL,
    message text NOT NULL,
    notification_type character varying(100),
    notification_level character varying(100),
    time_sent timestamp without time zone NOT NULL,
    was_read boolean DEFAULT false
);


ALTER TABLE public.notification OWNER TO dotcms;

--
-- Name: passwordtracker; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.passwordtracker (
    passwordtrackerid character varying(100) NOT NULL,
    userid character varying(100) NOT NULL,
    createdate timestamp without time zone NOT NULL,
    password_ character varying(100) NOT NULL
);


ALTER TABLE public.passwordtracker OWNER TO dotcms;

--
-- Name: permission; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.permission (
    id bigint NOT NULL,
    permission_type character varying(500),
    inode_id character varying(36),
    roleid character varying(36),
    permission integer
);


ALTER TABLE public.permission OWNER TO dotcms;

--
-- Name: permission_reference; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.permission_reference (
    id bigint NOT NULL,
    asset_id character varying(36),
    reference_id character varying(36),
    permission_type character varying(100)
);


ALTER TABLE public.permission_reference OWNER TO dotcms;

--
-- Name: permission_reference_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.permission_reference_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.permission_reference_seq OWNER TO dotcms;

--
-- Name: permission_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.permission_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.permission_seq OWNER TO dotcms;

--
-- Name: plugin; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.plugin (
    id character varying(255) NOT NULL,
    plugin_name character varying(255) NOT NULL,
    plugin_version character varying(255) NOT NULL,
    author character varying(255) NOT NULL,
    first_deployed_date timestamp without time zone NOT NULL,
    last_deployed_date timestamp without time zone NOT NULL
);


ALTER TABLE public.plugin OWNER TO dotcms;

--
-- Name: plugin_property; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.plugin_property (
    plugin_id character varying(255) NOT NULL,
    propkey character varying(255) NOT NULL,
    original_value character varying(255) NOT NULL,
    current_value character varying(255) NOT NULL
);


ALTER TABLE public.plugin_property OWNER TO dotcms;

--
-- Name: pollschoice; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.pollschoice (
    choiceid character varying(100) NOT NULL,
    questionid character varying(100) NOT NULL,
    description text
);


ALTER TABLE public.pollschoice OWNER TO dotcms;

--
-- Name: pollsdisplay; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.pollsdisplay (
    layoutid character varying(100) NOT NULL,
    userid character varying(100) NOT NULL,
    portletid character varying(100) NOT NULL,
    questionid character varying(100) NOT NULL
);


ALTER TABLE public.pollsdisplay OWNER TO dotcms;

--
-- Name: pollsquestion; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.pollsquestion (
    questionid character varying(100) NOT NULL,
    portletid character varying(100) NOT NULL,
    groupid character varying(100) NOT NULL,
    companyid character varying(100) NOT NULL,
    userid character varying(100) NOT NULL,
    username character varying(100),
    createdate timestamp without time zone,
    modifieddate timestamp without time zone,
    title character varying(100),
    description text,
    expirationdate timestamp without time zone,
    lastvotedate timestamp without time zone
);


ALTER TABLE public.pollsquestion OWNER TO dotcms;

--
-- Name: pollsvote; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.pollsvote (
    questionid character varying(100) NOT NULL,
    userid character varying(100) NOT NULL,
    choiceid character varying(100) NOT NULL,
    votedate timestamp without time zone
);


ALTER TABLE public.pollsvote OWNER TO dotcms;

--
-- Name: portlet; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.portlet (
    portletid character varying(100) NOT NULL,
    groupid character varying(100) NOT NULL,
    companyid character varying(100) NOT NULL,
    defaultpreferences text,
    narrow boolean,
    roles text,
    active_ boolean
);


ALTER TABLE public.portlet OWNER TO dotcms;

--
-- Name: portletpreferences; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.portletpreferences (
    portletid character varying(100) NOT NULL,
    userid character varying(100) NOT NULL,
    layoutid character varying(100) NOT NULL,
    preferences text
);


ALTER TABLE public.portletpreferences OWNER TO dotcms;

--
-- Name: publishing_bundle; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.publishing_bundle (
    id character varying(36) NOT NULL,
    name character varying(255) NOT NULL,
    publish_date timestamp without time zone,
    expire_date timestamp without time zone,
    owner character varying(100),
    force_push boolean,
    filter_key character varying(100)
);


ALTER TABLE public.publishing_bundle OWNER TO dotcms;

--
-- Name: publishing_bundle_environment; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.publishing_bundle_environment (
    id character varying(36) NOT NULL,
    bundle_id character varying(36) NOT NULL,
    environment_id character varying(36) NOT NULL
);


ALTER TABLE public.publishing_bundle_environment OWNER TO dotcms;

--
-- Name: publishing_end_point; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.publishing_end_point (
    id character varying(36) NOT NULL,
    group_id character varying(700),
    server_name character varying(700),
    address character varying(250),
    port character varying(10),
    protocol character varying(10),
    enabled boolean,
    auth_key text,
    sending boolean
);


ALTER TABLE public.publishing_end_point OWNER TO dotcms;

--
-- Name: publishing_environment; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.publishing_environment (
    id character varying(36) NOT NULL,
    name character varying(255) NOT NULL,
    push_to_all boolean NOT NULL
);


ALTER TABLE public.publishing_environment OWNER TO dotcms;

--
-- Name: publishing_pushed_assets; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.publishing_pushed_assets (
    bundle_id character varying(36) NOT NULL,
    asset_id character varying(36) NOT NULL,
    asset_type character varying(255) NOT NULL,
    push_date timestamp without time zone,
    environment_id character varying(36) NOT NULL,
    endpoint_ids text,
    publisher text
);


ALTER TABLE public.publishing_pushed_assets OWNER TO dotcms;

--
-- Name: publishing_queue; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.publishing_queue (
    id bigint NOT NULL,
    operation bigint,
    asset character varying(2000) NOT NULL,
    language_id bigint NOT NULL,
    entered_date timestamp without time zone,
    publish_date timestamp without time zone,
    type character varying(256),
    bundle_id character varying(256)
);


ALTER TABLE public.publishing_queue OWNER TO dotcms;

--
-- Name: publishing_queue_audit; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.publishing_queue_audit (
    bundle_id character varying(256) NOT NULL,
    status integer,
    status_pojo text,
    status_updated timestamp without time zone,
    create_date timestamp without time zone
);


ALTER TABLE public.publishing_queue_audit OWNER TO dotcms;

--
-- Name: publishing_queue_id_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.publishing_queue_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.publishing_queue_id_seq OWNER TO dotcms;

--
-- Name: publishing_queue_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dotcms
--

ALTER SEQUENCE public.publishing_queue_id_seq OWNED BY public.publishing_queue.id;


--
-- Name: qrtz_blob_triggers; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_blob_triggers (
    trigger_name character varying(80) NOT NULL,
    trigger_group character varying(80) NOT NULL,
    blob_data bytea
);


ALTER TABLE public.qrtz_blob_triggers OWNER TO dotcms;

--
-- Name: qrtz_calendars; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_calendars (
    calendar_name character varying(80) NOT NULL,
    calendar bytea NOT NULL
);


ALTER TABLE public.qrtz_calendars OWNER TO dotcms;

--
-- Name: qrtz_cron_triggers; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_cron_triggers (
    trigger_name character varying(80) NOT NULL,
    trigger_group character varying(80) NOT NULL,
    cron_expression character varying(80) NOT NULL,
    time_zone_id character varying(80)
);


ALTER TABLE public.qrtz_cron_triggers OWNER TO dotcms;

--
-- Name: qrtz_excl_blob_triggers; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_excl_blob_triggers (
    trigger_name character varying(80) NOT NULL,
    trigger_group character varying(80) NOT NULL,
    blob_data bytea
);


ALTER TABLE public.qrtz_excl_blob_triggers OWNER TO dotcms;

--
-- Name: qrtz_excl_calendars; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_excl_calendars (
    calendar_name character varying(80) NOT NULL,
    calendar bytea NOT NULL
);


ALTER TABLE public.qrtz_excl_calendars OWNER TO dotcms;

--
-- Name: qrtz_excl_cron_triggers; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_excl_cron_triggers (
    trigger_name character varying(80) NOT NULL,
    trigger_group character varying(80) NOT NULL,
    cron_expression character varying(80) NOT NULL,
    time_zone_id character varying(80)
);


ALTER TABLE public.qrtz_excl_cron_triggers OWNER TO dotcms;

--
-- Name: qrtz_excl_fired_triggers; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_excl_fired_triggers (
    entry_id character varying(95) NOT NULL,
    trigger_name character varying(80) NOT NULL,
    trigger_group character varying(80) NOT NULL,
    is_volatile boolean NOT NULL,
    instance_name character varying(80) NOT NULL,
    fired_time bigint NOT NULL,
    priority integer NOT NULL,
    state character varying(16) NOT NULL,
    job_name character varying(80),
    job_group character varying(80),
    is_stateful boolean,
    requests_recovery boolean
);


ALTER TABLE public.qrtz_excl_fired_triggers OWNER TO dotcms;

--
-- Name: qrtz_excl_job_details; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_excl_job_details (
    job_name character varying(80) NOT NULL,
    job_group character varying(80) NOT NULL,
    description character varying(120),
    job_class_name character varying(128) NOT NULL,
    is_durable boolean NOT NULL,
    is_volatile boolean NOT NULL,
    is_stateful boolean NOT NULL,
    requests_recovery boolean NOT NULL,
    job_data bytea
);


ALTER TABLE public.qrtz_excl_job_details OWNER TO dotcms;

--
-- Name: qrtz_excl_job_listeners; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_excl_job_listeners (
    job_name character varying(80) NOT NULL,
    job_group character varying(80) NOT NULL,
    job_listener character varying(80) NOT NULL
);


ALTER TABLE public.qrtz_excl_job_listeners OWNER TO dotcms;

--
-- Name: qrtz_excl_locks; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_excl_locks (
    lock_name character varying(40) NOT NULL
);


ALTER TABLE public.qrtz_excl_locks OWNER TO dotcms;

--
-- Name: qrtz_excl_paused_trigger_grps; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_excl_paused_trigger_grps (
    trigger_group character varying(80) NOT NULL
);


ALTER TABLE public.qrtz_excl_paused_trigger_grps OWNER TO dotcms;

--
-- Name: qrtz_excl_scheduler_state; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_excl_scheduler_state (
    instance_name character varying(80) NOT NULL,
    last_checkin_time bigint NOT NULL,
    checkin_interval bigint NOT NULL
);


ALTER TABLE public.qrtz_excl_scheduler_state OWNER TO dotcms;

--
-- Name: qrtz_excl_simple_triggers; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_excl_simple_triggers (
    trigger_name character varying(80) NOT NULL,
    trigger_group character varying(80) NOT NULL,
    repeat_count bigint NOT NULL,
    repeat_interval bigint NOT NULL,
    times_triggered bigint NOT NULL
);


ALTER TABLE public.qrtz_excl_simple_triggers OWNER TO dotcms;

--
-- Name: qrtz_excl_trigger_listeners; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_excl_trigger_listeners (
    trigger_name character varying(80) NOT NULL,
    trigger_group character varying(80) NOT NULL,
    trigger_listener character varying(80) NOT NULL
);


ALTER TABLE public.qrtz_excl_trigger_listeners OWNER TO dotcms;

--
-- Name: qrtz_excl_triggers; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_excl_triggers (
    trigger_name character varying(80) NOT NULL,
    trigger_group character varying(80) NOT NULL,
    job_name character varying(80) NOT NULL,
    job_group character varying(80) NOT NULL,
    is_volatile boolean NOT NULL,
    description character varying(120),
    next_fire_time bigint,
    prev_fire_time bigint,
    priority integer,
    trigger_state character varying(16) NOT NULL,
    trigger_type character varying(8) NOT NULL,
    start_time bigint NOT NULL,
    end_time bigint,
    calendar_name character varying(80),
    misfire_instr smallint,
    job_data bytea
);


ALTER TABLE public.qrtz_excl_triggers OWNER TO dotcms;

--
-- Name: qrtz_fired_triggers; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_fired_triggers (
    entry_id character varying(95) NOT NULL,
    trigger_name character varying(80) NOT NULL,
    trigger_group character varying(80) NOT NULL,
    is_volatile boolean NOT NULL,
    instance_name character varying(80) NOT NULL,
    fired_time bigint NOT NULL,
    priority integer NOT NULL,
    state character varying(16) NOT NULL,
    job_name character varying(80),
    job_group character varying(80),
    is_stateful boolean,
    requests_recovery boolean
);


ALTER TABLE public.qrtz_fired_triggers OWNER TO dotcms;

--
-- Name: qrtz_job_details; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_job_details (
    job_name character varying(80) NOT NULL,
    job_group character varying(80) NOT NULL,
    description character varying(120),
    job_class_name character varying(128) NOT NULL,
    is_durable boolean NOT NULL,
    is_volatile boolean NOT NULL,
    is_stateful boolean NOT NULL,
    requests_recovery boolean NOT NULL,
    job_data bytea
);


ALTER TABLE public.qrtz_job_details OWNER TO dotcms;

--
-- Name: qrtz_job_listeners; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_job_listeners (
    job_name character varying(80) NOT NULL,
    job_group character varying(80) NOT NULL,
    job_listener character varying(80) NOT NULL
);


ALTER TABLE public.qrtz_job_listeners OWNER TO dotcms;

--
-- Name: qrtz_locks; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_locks (
    lock_name character varying(40) NOT NULL
);


ALTER TABLE public.qrtz_locks OWNER TO dotcms;

--
-- Name: qrtz_paused_trigger_grps; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_paused_trigger_grps (
    trigger_group character varying(80) NOT NULL
);


ALTER TABLE public.qrtz_paused_trigger_grps OWNER TO dotcms;

--
-- Name: qrtz_scheduler_state; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_scheduler_state (
    instance_name character varying(80) NOT NULL,
    last_checkin_time bigint NOT NULL,
    checkin_interval bigint NOT NULL
);


ALTER TABLE public.qrtz_scheduler_state OWNER TO dotcms;

--
-- Name: qrtz_simple_triggers; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_simple_triggers (
    trigger_name character varying(80) NOT NULL,
    trigger_group character varying(80) NOT NULL,
    repeat_count bigint NOT NULL,
    repeat_interval bigint NOT NULL,
    times_triggered bigint NOT NULL
);


ALTER TABLE public.qrtz_simple_triggers OWNER TO dotcms;

--
-- Name: qrtz_trigger_listeners; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_trigger_listeners (
    trigger_name character varying(80) NOT NULL,
    trigger_group character varying(80) NOT NULL,
    trigger_listener character varying(80) NOT NULL
);


ALTER TABLE public.qrtz_trigger_listeners OWNER TO dotcms;

--
-- Name: qrtz_triggers; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.qrtz_triggers (
    trigger_name character varying(80) NOT NULL,
    trigger_group character varying(80) NOT NULL,
    job_name character varying(80) NOT NULL,
    job_group character varying(80) NOT NULL,
    is_volatile boolean NOT NULL,
    description character varying(120),
    next_fire_time bigint,
    prev_fire_time bigint,
    priority integer,
    trigger_state character varying(16) NOT NULL,
    trigger_type character varying(8) NOT NULL,
    start_time bigint NOT NULL,
    end_time bigint,
    calendar_name character varying(80),
    misfire_instr smallint,
    job_data bytea
);


ALTER TABLE public.qrtz_triggers OWNER TO dotcms;

--
-- Name: quartz_log; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.quartz_log (
    id bigint NOT NULL,
    job_name character varying(255) NOT NULL,
    serverid character varying(64),
    time_started timestamp without time zone NOT NULL
);


ALTER TABLE public.quartz_log OWNER TO dotcms;

--
-- Name: quartz_log_id_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.quartz_log_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.quartz_log_id_seq OWNER TO dotcms;

--
-- Name: quartz_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dotcms
--

ALTER SEQUENCE public.quartz_log_id_seq OWNED BY public.quartz_log.id;


--
-- Name: recipient; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.recipient (
    inode character varying(36) NOT NULL,
    name character varying(255),
    lastname character varying(255),
    email character varying(255),
    sent timestamp without time zone,
    opened timestamp without time zone,
    last_result integer,
    last_message character varying(255),
    user_id character varying(100)
);


ALTER TABLE public.recipient OWNER TO dotcms;

--
-- Name: relationship; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.relationship (
    inode character varying(36) NOT NULL,
    parent_structure_inode character varying(255),
    child_structure_inode character varying(255),
    parent_relation_name character varying(255),
    child_relation_name character varying(255),
    relation_type_value character varying(255),
    cardinality integer,
    parent_required boolean,
    child_required boolean,
    fixed boolean
);


ALTER TABLE public.relationship OWNER TO dotcms;

--
-- Name: release_; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.release_ (
    releaseid character varying(100) NOT NULL,
    createdate timestamp without time zone,
    modifieddate timestamp without time zone,
    buildnumber integer,
    builddate timestamp without time zone
);


ALTER TABLE public.release_ OWNER TO dotcms;

--
-- Name: report_asset; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.report_asset (
    inode character varying(36) NOT NULL,
    report_name character varying(255) NOT NULL,
    report_description character varying(1000) NOT NULL,
    requires_input boolean,
    ds character varying(100) NOT NULL,
    web_form_report boolean
);


ALTER TABLE public.report_asset OWNER TO dotcms;

--
-- Name: report_parameter; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.report_parameter (
    inode character varying(36) NOT NULL,
    report_inode character varying(36),
    parameter_description character varying(1000),
    parameter_name character varying(255),
    class_type character varying(250),
    default_value character varying(4000)
);


ALTER TABLE public.report_parameter OWNER TO dotcms;

--
-- Name: rule_action; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.rule_action (
    id character varying(36) NOT NULL,
    rule_id character varying(36),
    priority integer DEFAULT 0,
    actionlet text NOT NULL,
    mod_date timestamp without time zone
);


ALTER TABLE public.rule_action OWNER TO dotcms;

--
-- Name: rule_action_pars; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.rule_action_pars (
    id character varying(36) NOT NULL,
    rule_action_id character varying(36),
    paramkey character varying(255) NOT NULL,
    value text
);


ALTER TABLE public.rule_action_pars OWNER TO dotcms;

--
-- Name: rule_condition; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.rule_condition (
    id character varying(36) NOT NULL,
    conditionlet text NOT NULL,
    condition_group character varying(36),
    comparison character varying(36) NOT NULL,
    operator character varying(10) NOT NULL,
    priority integer DEFAULT 0,
    mod_date timestamp without time zone
);


ALTER TABLE public.rule_condition OWNER TO dotcms;

--
-- Name: rule_condition_group; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.rule_condition_group (
    id character varying(36) NOT NULL,
    rule_id character varying(36),
    operator character varying(10) NOT NULL,
    priority integer DEFAULT 0,
    mod_date timestamp without time zone
);


ALTER TABLE public.rule_condition_group OWNER TO dotcms;

--
-- Name: rule_condition_value; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.rule_condition_value (
    id character varying(36) NOT NULL,
    condition_id character varying(36),
    paramkey character varying(255) NOT NULL,
    value text,
    priority integer DEFAULT 0
);


ALTER TABLE public.rule_condition_value OWNER TO dotcms;

--
-- Name: schemes_ir; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.schemes_ir (
    name character varying(255),
    local_inode character varying(36) NOT NULL,
    remote_inode character varying(36),
    endpoint_id character varying(40) NOT NULL
);


ALTER TABLE public.schemes_ir OWNER TO dotcms;

--
-- Name: sitelic; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.sitelic (
    id character varying(36) NOT NULL,
    serverid character varying(100),
    license text NOT NULL,
    lastping timestamp without time zone NOT NULL,
    startup_time bigint
);


ALTER TABLE public.sitelic OWNER TO dotcms;

--
-- Name: sitesearch_audit; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.sitesearch_audit (
    job_id character varying(36) NOT NULL,
    job_name character varying(255) NOT NULL,
    fire_date timestamp without time zone NOT NULL,
    incremental boolean NOT NULL,
    start_date timestamp without time zone,
    end_date timestamp without time zone,
    host_list character varying(500) NOT NULL,
    all_hosts boolean NOT NULL,
    lang_list character varying(500) NOT NULL,
    path character varying(500) NOT NULL,
    path_include boolean NOT NULL,
    files_count integer NOT NULL,
    pages_count integer NOT NULL,
    urlmaps_count integer NOT NULL,
    index_name character varying(100) NOT NULL
);


ALTER TABLE public.sitesearch_audit OWNER TO dotcms;

--
-- Name: storage; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.storage (
    path character varying(255) NOT NULL,
    group_name character varying(255) NOT NULL,
    hash character varying(64) NOT NULL,
    mod_date timestamp without time zone DEFAULT CURRENT_DATE NOT NULL,
    hash_ref character varying(64)
);


ALTER TABLE public.storage OWNER TO dotcms;

--
-- Name: storage_data; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.storage_data (
    hash_id character varying(64) NOT NULL,
    data bytea NOT NULL,
    mod_date timestamp without time zone DEFAULT CURRENT_DATE NOT NULL
);


ALTER TABLE public.storage_data OWNER TO dotcms;

--
-- Name: storage_group; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.storage_group (
    group_name character varying(255) NOT NULL,
    mod_date timestamp without time zone DEFAULT CURRENT_DATE NOT NULL
);


ALTER TABLE public.storage_group OWNER TO dotcms;

--
-- Name: storage_x_data; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.storage_x_data (
    storage_hash character varying(64) NOT NULL,
    data_hash character varying(64) NOT NULL,
    data_order integer NOT NULL,
    mod_date timestamp without time zone DEFAULT CURRENT_DATE NOT NULL
);


ALTER TABLE public.storage_x_data OWNER TO dotcms;

--
-- Name: structure; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.structure (
    inode character varying(36) NOT NULL,
    name character varying(255),
    description character varying(255),
    default_structure boolean,
    review_interval character varying(255),
    reviewer_role character varying(255),
    page_detail character varying(36),
    structuretype integer,
    system boolean,
    fixed boolean DEFAULT false NOT NULL,
    velocity_var_name character varying(255) NOT NULL,
    url_map_pattern character varying(512),
    host character varying(36) DEFAULT 'SYSTEM_HOST'::character varying NOT NULL,
    folder character varying(36) DEFAULT 'SYSTEM_FOLDER'::character varying NOT NULL,
    expire_date_var character varying(255),
    publish_date_var character varying(255),
    mod_date timestamp without time zone
);


ALTER TABLE public.structure OWNER TO dotcms;

--
-- Name: structures_ir; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.structures_ir (
    velocity_name character varying(255),
    local_inode character varying(36) NOT NULL,
    remote_inode character varying(36),
    endpoint_id character varying(40) NOT NULL
);


ALTER TABLE public.structures_ir OWNER TO dotcms;

--
-- Name: summary_404_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.summary_404_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.summary_404_seq OWNER TO dotcms;

--
-- Name: summary_content_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.summary_content_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.summary_content_seq OWNER TO dotcms;

--
-- Name: summary_pages_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.summary_pages_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.summary_pages_seq OWNER TO dotcms;

--
-- Name: summary_period_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.summary_period_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.summary_period_seq OWNER TO dotcms;

--
-- Name: summary_referer_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.summary_referer_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.summary_referer_seq OWNER TO dotcms;

--
-- Name: summary_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.summary_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.summary_seq OWNER TO dotcms;

--
-- Name: summary_visits_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.summary_visits_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.summary_visits_seq OWNER TO dotcms;

--
-- Name: system_event; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.system_event (
    identifier character varying(36) NOT NULL,
    event_type character varying(50) NOT NULL,
    payload text NOT NULL,
    created bigint NOT NULL,
    server_id character varying(36) NOT NULL
);


ALTER TABLE public.system_event OWNER TO dotcms;

--
-- Name: tag; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.tag (
    tag_id character varying(100) NOT NULL,
    tagname character varying(255) NOT NULL,
    host_id character varying(255) DEFAULT 'SYSTEM_HOST'::character varying,
    user_id text,
    persona boolean DEFAULT false,
    mod_date timestamp without time zone
);


ALTER TABLE public.tag OWNER TO dotcms;

--
-- Name: tag_inode; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.tag_inode (
    tag_id character varying(100) NOT NULL,
    inode character varying(100) NOT NULL,
    field_var_name character varying(255),
    mod_date timestamp without time zone
);


ALTER TABLE public.tag_inode OWNER TO dotcms;

--
-- Name: template; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.template (
    inode character varying(36) NOT NULL,
    show_on_menu boolean,
    title character varying(255),
    mod_date timestamp without time zone,
    mod_user character varying(100),
    sort_order integer,
    friendly_name character varying(255),
    body text,
    header text,
    footer text,
    image character varying(36),
    identifier character varying(36),
    drawed boolean,
    drawed_body text,
    add_container_links integer,
    containers_added integer,
    head_code text,
    theme character varying(255)
);


ALTER TABLE public.template OWNER TO dotcms;

--
-- Name: template_containers; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.template_containers (
    id character varying(36) NOT NULL,
    template_id character varying(36) NOT NULL,
    container_id character varying(36) NOT NULL
);


ALTER TABLE public.template_containers OWNER TO dotcms;

--
-- Name: template_version_info; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.template_version_info (
    identifier character varying(36) NOT NULL,
    working_inode character varying(36) NOT NULL,
    live_inode character varying(36),
    deleted boolean NOT NULL,
    locked_by character varying(100),
    locked_on timestamp without time zone,
    version_ts timestamp without time zone NOT NULL
);


ALTER TABLE public.template_version_info OWNER TO dotcms;

--
-- Name: trackback; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.trackback (
    id bigint NOT NULL,
    asset_identifier character varying(36),
    title character varying(255),
    excerpt character varying(255),
    url character varying(255),
    blog_name character varying(255),
    track_date timestamp without time zone NOT NULL
);


ALTER TABLE public.trackback OWNER TO dotcms;

--
-- Name: trackback_sequence; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.trackback_sequence
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.trackback_sequence OWNER TO dotcms;

--
-- Name: tree; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.tree (
    child character varying(36) NOT NULL,
    parent character varying(36) NOT NULL,
    relation_type character varying(64) NOT NULL,
    tree_order integer
);


ALTER TABLE public.tree OWNER TO dotcms;

--
-- Name: user_; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.user_ (
    userid character varying(100) NOT NULL,
    companyid character varying(100) NOT NULL,
    createdate timestamp without time zone,
    mod_date timestamp without time zone,
    password_ text,
    passwordencrypted boolean,
    passwordexpirationdate timestamp without time zone,
    passwordreset boolean,
    firstname character varying(100),
    middlename character varying(100),
    lastname character varying(100),
    nickname character varying(100),
    male boolean,
    birthday timestamp without time zone,
    emailaddress character varying(100),
    smsid character varying(100),
    aimid character varying(100),
    icqid character varying(100),
    msnid character varying(100),
    ymid character varying(100),
    favoriteactivity character varying(100),
    favoritebibleverse character varying(100),
    favoritefood character varying(100),
    favoritemovie character varying(100),
    favoritemusic character varying(100),
    languageid character varying(100),
    timezoneid character varying(100),
    skinid character varying(100),
    dottedskins boolean,
    roundedskins boolean,
    greeting character varying(100),
    resolution character varying(100),
    refreshrate character varying(100),
    layoutids character varying(100),
    comments text,
    logindate timestamp without time zone,
    loginip character varying(100),
    lastlogindate timestamp without time zone,
    lastloginip character varying(100),
    failedloginattempts integer,
    agreedtotermsofuse boolean,
    active_ boolean,
    delete_in_progress boolean DEFAULT false,
    delete_date timestamp without time zone,
    additional_info jsonb
);


ALTER TABLE public.user_ OWNER TO dotcms;

--
-- Name: user_comments; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.user_comments (
    inode character varying(36) NOT NULL,
    user_id character varying(255),
    cdate timestamp without time zone,
    comment_user_id character varying(100),
    type character varying(255),
    method character varying(255),
    subject character varying(255),
    ucomment text,
    communication_id character varying(36)
);


ALTER TABLE public.user_comments OWNER TO dotcms;

--
-- Name: user_filter; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.user_filter (
    inode character varying(36) NOT NULL,
    title character varying(255),
    firstname character varying(100),
    middlename character varying(100),
    lastname character varying(100),
    emailaddress character varying(100),
    birthdaytypesearch character varying(100),
    birthday timestamp without time zone,
    birthdayfrom timestamp without time zone,
    birthdayto timestamp without time zone,
    lastlogintypesearch character varying(100),
    lastloginsince character varying(100),
    loginfrom timestamp without time zone,
    loginto timestamp without time zone,
    createdtypesearch character varying(100),
    createdsince character varying(100),
    createdfrom timestamp without time zone,
    createdto timestamp without time zone,
    lastvisittypesearch character varying(100),
    lastvisitsince character varying(100),
    lastvisitfrom timestamp without time zone,
    lastvisitto timestamp without time zone,
    city character varying(100),
    state character varying(100),
    country character varying(100),
    zip character varying(100),
    cell character varying(100),
    phone character varying(100),
    fax character varying(100),
    active_ character varying(255),
    tagname character varying(255),
    var1 character varying(255),
    var2 character varying(255),
    var3 character varying(255),
    var4 character varying(255),
    var5 character varying(255),
    var6 character varying(255),
    var7 character varying(255),
    var8 character varying(255),
    var9 character varying(255),
    var10 character varying(255),
    var11 character varying(255),
    var12 character varying(255),
    var13 character varying(255),
    var14 character varying(255),
    var15 character varying(255),
    var16 character varying(255),
    var17 character varying(255),
    var18 character varying(255),
    var19 character varying(255),
    var20 character varying(255),
    var21 character varying(255),
    var22 character varying(255),
    var23 character varying(255),
    var24 character varying(255),
    var25 character varying(255),
    categories character varying(255)
);


ALTER TABLE public.user_filter OWNER TO dotcms;

--
-- Name: user_preferences; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.user_preferences (
    id bigint NOT NULL,
    user_id character varying(100) NOT NULL,
    preference character varying(255),
    pref_value text
);


ALTER TABLE public.user_preferences OWNER TO dotcms;

--
-- Name: user_preferences_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.user_preferences_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.user_preferences_seq OWNER TO dotcms;

--
-- Name: user_to_delete_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.user_to_delete_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.user_to_delete_seq OWNER TO dotcms;

--
-- Name: users_cms_roles; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.users_cms_roles (
    id character varying(36) NOT NULL,
    user_id character varying(100) NOT NULL,
    role_id character varying(36) NOT NULL
);


ALTER TABLE public.users_cms_roles OWNER TO dotcms;

--
-- Name: users_to_delete; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.users_to_delete (
    id bigint NOT NULL,
    user_id character varying(255)
);


ALTER TABLE public.users_to_delete OWNER TO dotcms;

--
-- Name: usertracker; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.usertracker (
    usertrackerid character varying(100) NOT NULL,
    companyid character varying(100) NOT NULL,
    userid character varying(100) NOT NULL,
    modifieddate timestamp without time zone,
    remoteaddr character varying(100),
    remotehost character varying(100),
    useragent character varying(100)
);


ALTER TABLE public.usertracker OWNER TO dotcms;

--
-- Name: usertrackerpath; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.usertrackerpath (
    usertrackerpathid character varying(100) NOT NULL,
    usertrackerid character varying(100) NOT NULL,
    path text NOT NULL,
    pathdate timestamp without time zone NOT NULL
);


ALTER TABLE public.usertrackerpath OWNER TO dotcms;

--
-- Name: web_form; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.web_form (
    web_form_id character varying(36) NOT NULL,
    form_type character varying(255),
    submit_date timestamp without time zone,
    prefix character varying(255),
    first_name character varying(255),
    middle_initial character varying(255),
    middle_name character varying(255),
    full_name character varying(255),
    organization character varying(255),
    title character varying(255),
    last_name character varying(255),
    address character varying(255),
    address1 character varying(255),
    address2 character varying(255),
    city character varying(255),
    state character varying(255),
    zip character varying(255),
    country character varying(255),
    phone character varying(255),
    email character varying(255),
    custom_fields text,
    user_inode character varying(100),
    categories character varying(255)
);


ALTER TABLE public.web_form OWNER TO dotcms;

--
-- Name: workflow_action; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.workflow_action (
    id character varying(36) NOT NULL,
    step_id character varying(36),
    name character varying(255) NOT NULL,
    condition_to_progress text,
    next_step_id character varying(36),
    next_assign character varying(36) NOT NULL,
    my_order integer DEFAULT 0,
    assignable boolean DEFAULT false,
    commentable boolean DEFAULT false,
    requires_checkout boolean DEFAULT false,
    icon character varying(255) DEFAULT 'defaultWfIcon'::character varying,
    show_on character varying(255) DEFAULT 'LOCKED,UNLOCKED'::character varying,
    use_role_hierarchy_assign boolean DEFAULT false,
    scheme_id character varying(36) NOT NULL
);


ALTER TABLE public.workflow_action OWNER TO dotcms;

--
-- Name: workflow_action_class; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.workflow_action_class (
    id character varying(36) NOT NULL,
    action_id character varying(36),
    name character varying(255) NOT NULL,
    my_order integer DEFAULT 0,
    clazz text
);


ALTER TABLE public.workflow_action_class OWNER TO dotcms;

--
-- Name: workflow_action_class_pars; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.workflow_action_class_pars (
    id character varying(36) NOT NULL,
    workflow_action_class_id character varying(36),
    key character varying(255) NOT NULL,
    value text
);


ALTER TABLE public.workflow_action_class_pars OWNER TO dotcms;

--
-- Name: workflow_action_mappings; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.workflow_action_mappings (
    id character varying(36) NOT NULL,
    action character varying(36) NOT NULL,
    workflow_action character varying(255) NOT NULL,
    scheme_or_content_type character varying(255) NOT NULL
);


ALTER TABLE public.workflow_action_mappings OWNER TO dotcms;

--
-- Name: workflow_action_step; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.workflow_action_step (
    action_id character varying(36) NOT NULL,
    step_id character varying(36) NOT NULL,
    action_order integer DEFAULT 0
);


ALTER TABLE public.workflow_action_step OWNER TO dotcms;

--
-- Name: workflow_comment; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.workflow_comment (
    id character varying(36) NOT NULL,
    creation_date timestamp without time zone,
    posted_by character varying(255),
    wf_comment text,
    workflowtask_id character varying(36)
);


ALTER TABLE public.workflow_comment OWNER TO dotcms;

--
-- Name: workflow_history; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.workflow_history (
    id character varying(36) NOT NULL,
    creation_date timestamp without time zone,
    made_by character varying(255),
    change_desc text,
    workflowtask_id character varying(36),
    workflow_action_id character varying(36),
    workflow_step_id character varying(36)
);


ALTER TABLE public.workflow_history OWNER TO dotcms;

--
-- Name: workflow_scheme; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.workflow_scheme (
    id character varying(36) NOT NULL,
    name character varying(255) NOT NULL,
    description text,
    archived boolean DEFAULT false,
    mandatory boolean DEFAULT false,
    default_scheme boolean DEFAULT false,
    entry_action_id character varying(36),
    mod_date timestamp without time zone
);


ALTER TABLE public.workflow_scheme OWNER TO dotcms;

--
-- Name: workflow_scheme_x_structure; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.workflow_scheme_x_structure (
    id character varying(36) NOT NULL,
    scheme_id character varying(36),
    structure_id character varying(36)
);


ALTER TABLE public.workflow_scheme_x_structure OWNER TO dotcms;

--
-- Name: workflow_step; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.workflow_step (
    id character varying(36) NOT NULL,
    name character varying(255) NOT NULL,
    scheme_id character varying(36),
    my_order integer DEFAULT 0,
    resolved boolean DEFAULT false,
    escalation_enable boolean DEFAULT false,
    escalation_action character varying(36),
    escalation_time integer DEFAULT 0
);


ALTER TABLE public.workflow_step OWNER TO dotcms;

--
-- Name: workflow_task; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.workflow_task (
    id character varying(36) NOT NULL,
    creation_date timestamp without time zone,
    mod_date timestamp without time zone,
    due_date timestamp without time zone,
    created_by character varying(255),
    assigned_to character varying(255),
    belongs_to character varying(255),
    title character varying(255),
    description text,
    status character varying(255),
    webasset character varying(255),
    language_id bigint
);


ALTER TABLE public.workflow_task OWNER TO dotcms;

--
-- Name: workflowtask_files; Type: TABLE; Schema: public; Owner: dotcms
--

CREATE TABLE public.workflowtask_files (
    id character varying(36) NOT NULL,
    workflowtask_id character varying(36) NOT NULL,
    file_inode character varying(36) NOT NULL
);


ALTER TABLE public.workflowtask_files OWNER TO dotcms;

--
-- Name: workstream_seq; Type: SEQUENCE; Schema: public; Owner: dotcms
--

CREATE SEQUENCE public.workstream_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.workstream_seq OWNER TO dotcms;

--
-- Name: dist_journal id; Type: DEFAULT; Schema: public; Owner: dotcms
--

ALTER TABLE ONLY public.dist_journal ALTER COLUMN id SET DEFAULT nextval('public.dist_journal_id_seq'::regclass);


--
-- Name: dist_process id; Type: DEFAULT; Schema: public; Owner: dotcms
--

ALTER TABLE ONLY public.dist_process ALTER COLUMN id SET DEFAULT nextval('public.dist_process_id_seq'::regclass);


--
-- Name: dist_reindex_journal id; Type: DEFAULT; Schema: public; Owner: dotcms
--

ALTER TABLE ONLY public.dist_reindex_journal ALTER COLUMN id SET DEFAULT nextval('public.dist_reindex_journal_id_seq'::regclass);


--
-- Name: publishing_queue id; Type: DEFAULT; Schema: public; Owner: dotcms
--

ALTER TABLE ONLY public.publishing_queue ALTER COLUMN id SET DEFAULT nextval('public.publishing_queue_id_seq'::regclass);


--
-- Name: quartz_log id; Type: DEFAULT; Schema: public; Owner: dotcms
--

ALTER TABLE ONLY public.quartz_log ALTER COLUMN id SET DEFAULT nextval('public.quartz_log_id_seq'::regclass);


--
-- Name: addres_userid_index; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX addres_userid_index ON public.address USING btree (userid);


--
-- Name: containers_ident; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX containers_ident ON public.dot_containers USING btree (identifier);


--
-- Name: contentlet_ident; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX contentlet_ident ON public.contentlet USING btree (identifier);


--
-- Name: contentlet_lang; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX contentlet_lang ON public.contentlet USING btree (language_id);


--
-- Name: contentlet_moduser; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX contentlet_moduser ON public.contentlet USING btree (mod_user);


--
-- Name: dist_process_index; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX dist_process_index ON public.dist_process USING btree (object_to_index, serverid, journal_type);


--
-- Name: dist_reindex_index; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX dist_reindex_index ON public.dist_reindex_journal USING btree (serverid, dist_action);


--
-- Name: dist_reindex_index1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX dist_reindex_index1 ON public.dist_reindex_journal USING btree (inode_to_index);


--
-- Name: dist_reindex_index2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX dist_reindex_index2 ON public.dist_reindex_journal USING btree (dist_action);


--
-- Name: dist_reindex_index3; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX dist_reindex_index3 ON public.dist_reindex_journal USING btree (serverid);


--
-- Name: dist_reindex_index4; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX dist_reindex_index4 ON public.dist_reindex_journal USING btree (ident_to_index, serverid);


--
-- Name: dist_reindex_index5; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX dist_reindex_index5 ON public.dist_reindex_journal USING btree (priority, time_entered);


--
-- Name: dist_reindex_index6; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX dist_reindex_index6 ON public.dist_reindex_journal USING btree (priority);


--
-- Name: folder_ident; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX folder_ident ON public.folder USING btree (identifier);


--
-- Name: idx_analytic_summary_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_analytic_summary_1 ON public.analytic_summary USING btree (host_id);


--
-- Name: idx_analytic_summary_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_analytic_summary_2 ON public.analytic_summary USING btree (visits);


--
-- Name: idx_analytic_summary_3; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_analytic_summary_3 ON public.analytic_summary USING btree (page_views);


--
-- Name: idx_analytic_summary_404_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_analytic_summary_404_1 ON public.analytic_summary_404 USING btree (host_id);


--
-- Name: idx_analytic_summary_period_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_analytic_summary_period_2 ON public.analytic_summary_period USING btree (day);


--
-- Name: idx_analytic_summary_period_3; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_analytic_summary_period_3 ON public.analytic_summary_period USING btree (week);


--
-- Name: idx_analytic_summary_period_4; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_analytic_summary_period_4 ON public.analytic_summary_period USING btree (month);


--
-- Name: idx_analytic_summary_period_5; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_analytic_summary_period_5 ON public.analytic_summary_period USING btree (year);


--
-- Name: idx_analytic_summary_visits_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_analytic_summary_visits_1 ON public.analytic_summary_visits USING btree (host_id);


--
-- Name: idx_analytic_summary_visits_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_analytic_summary_visits_2 ON public.analytic_summary_visits USING btree (visit_time);


--
-- Name: idx_api_token_issued_user; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_api_token_issued_user ON public.api_token_issued USING btree (token_userid);


--
-- Name: idx_campaign_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_campaign_1 ON public.campaign USING btree (user_id);


--
-- Name: idx_campaign_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_campaign_2 ON public.campaign USING btree (start_date);


--
-- Name: idx_campaign_3; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_campaign_3 ON public.campaign USING btree (completed_date);


--
-- Name: idx_campaign_4; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_campaign_4 ON public.campaign USING btree (expiration_date);


--
-- Name: idx_category_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_category_1 ON public.category USING btree (category_name);


--
-- Name: idx_category_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_category_2 ON public.category USING btree (category_key);


--
-- Name: idx_chain_key_name; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_chain_key_name ON public.chain USING btree (key_name);


--
-- Name: idx_chain_link_code_classname; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_chain_link_code_classname ON public.chain_link_code USING btree (class_name);


--
-- Name: idx_click_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_click_1 ON public.click USING btree (link);


--
-- Name: idx_communication_user_id; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_communication_user_id ON public.recipient USING btree (user_id);


--
-- Name: idx_container_id; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_container_id ON public.container_structures USING btree (container_id);


--
-- Name: idx_container_vi_live; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_container_vi_live ON public.container_version_info USING btree (live_inode);


--
-- Name: idx_container_vi_version_ts; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_container_vi_version_ts ON public.container_version_info USING btree (version_ts);


--
-- Name: idx_container_vi_working; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_container_vi_working ON public.container_version_info USING btree (working_inode);


--
-- Name: idx_contentlet_3; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_contentlet_3 ON public.contentlet USING btree (inode);


--
-- Name: idx_contentlet_4; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_contentlet_4 ON public.contentlet USING btree (structure_inode);


--
-- Name: idx_contentlet_identifier; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_contentlet_identifier ON public.contentlet USING btree (identifier);


--
-- Name: idx_contentlet_vi_live; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_contentlet_vi_live ON public.contentlet_version_info USING btree (live_inode);


--
-- Name: idx_contentlet_vi_version_ts; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_contentlet_vi_version_ts ON public.contentlet_version_info USING btree (version_ts);


--
-- Name: idx_contentlet_vi_working; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_contentlet_vi_working ON public.contentlet_version_info USING btree (working_inode);


--
-- Name: idx_dashboard_prefs_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_dashboard_prefs_2 ON public.dashboard_user_preferences USING btree (user_id);


--
-- Name: idx_dashboard_workstream_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_dashboard_workstream_1 ON public.analytic_summary_workstream USING btree (mod_user_id);


--
-- Name: idx_dashboard_workstream_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_dashboard_workstream_2 ON public.analytic_summary_workstream USING btree (host_id);


--
-- Name: idx_dashboard_workstream_3; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_dashboard_workstream_3 ON public.analytic_summary_workstream USING btree (mod_date);


--
-- Name: idx_field_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_field_1 ON public.field USING btree (structure_inode);


--
-- Name: idx_field_velocity_structure; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE UNIQUE INDEX idx_field_velocity_structure ON public.field USING btree (velocity_var_name, structure_inode);


--
-- Name: idx_folder_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_folder_1 ON public.folder USING btree (name);


--
-- Name: idx_ident_uniq_asset_name; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE UNIQUE INDEX idx_ident_uniq_asset_name ON public.identifier USING btree (public.full_path_lc(identifier.*), host_inode);


--
-- Name: idx_identifier; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_identifier ON public.identifier USING btree (id);


--
-- Name: idx_identifier_asset_subtype; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_identifier_asset_subtype ON public.identifier USING btree (asset_subtype);


--
-- Name: idx_identifier_exp; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_identifier_exp ON public.identifier USING btree (sysexpire_date);


--
-- Name: idx_identifier_perm; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_identifier_perm ON public.identifier USING btree (asset_type, host_inode);


--
-- Name: idx_identifier_pub; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_identifier_pub ON public.identifier USING btree (syspublish_date);


--
-- Name: idx_index_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_index_1 ON public.inode USING btree (type);


--
-- Name: idx_link_vi_live; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_link_vi_live ON public.link_version_info USING btree (live_inode);


--
-- Name: idx_link_vi_version_ts; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_link_vi_version_ts ON public.link_version_info USING btree (version_ts);


--
-- Name: idx_link_vi_working; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_link_vi_working ON public.link_version_info USING btree (working_inode);


--
-- Name: idx_lower_structure_name; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_lower_structure_name ON public.structure USING btree (lower((velocity_var_name)::text));


--
-- Name: idx_mailinglist_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_mailinglist_1 ON public.mailing_list USING btree (user_id);


--
-- Name: idx_multitree_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_multitree_1 ON public.multi_tree USING btree (relation_type);


--
-- Name: idx_not_read; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_not_read ON public.notification USING btree (was_read);


--
-- Name: idx_permisision_4; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_permisision_4 ON public.permission USING btree (permission_type);


--
-- Name: idx_permission_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_permission_2 ON public.permission USING btree (permission_type, inode_id);


--
-- Name: idx_permission_3; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_permission_3 ON public.permission USING btree (roleid);


--
-- Name: idx_permission_reference_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_permission_reference_2 ON public.permission_reference USING btree (reference_id);


--
-- Name: idx_permission_reference_3; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_permission_reference_3 ON public.permission_reference USING btree (reference_id, permission_type);


--
-- Name: idx_permission_reference_4; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_permission_reference_4 ON public.permission_reference USING btree (asset_id, permission_type);


--
-- Name: idx_permission_reference_5; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_permission_reference_5 ON public.permission_reference USING btree (asset_id, reference_id, permission_type);


--
-- Name: idx_permission_reference_6; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_permission_reference_6 ON public.permission_reference USING btree (permission_type);


--
-- Name: idx_preference_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_preference_1 ON public.user_preferences USING btree (preference);


--
-- Name: idx_pub_qa_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_pub_qa_1 ON public.publishing_queue_audit USING btree (status);


--
-- Name: idx_pushed_assets_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_pushed_assets_1 ON public.publishing_pushed_assets USING btree (bundle_id);


--
-- Name: idx_pushed_assets_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_pushed_assets_2 ON public.publishing_pushed_assets USING btree (environment_id);


--
-- Name: idx_pushed_assets_3; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_pushed_assets_3 ON public.publishing_pushed_assets USING btree (asset_id, environment_id);


--
-- Name: idx_recipiets_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_recipiets_1 ON public.recipient USING btree (email);


--
-- Name: idx_recipiets_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_recipiets_2 ON public.recipient USING btree (sent);


--
-- Name: idx_relationship_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_relationship_1 ON public.relationship USING btree (parent_structure_inode);


--
-- Name: idx_relationship_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_relationship_2 ON public.relationship USING btree (child_structure_inode);


--
-- Name: idx_rules_fire_on; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_rules_fire_on ON public.dot_rule USING btree (fire_on);


--
-- Name: idx_storage_hash; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_storage_hash ON public.storage USING btree (hash);


--
-- Name: idx_structure_folder; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_structure_folder ON public.structure USING btree (folder);


--
-- Name: idx_structure_host; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_structure_host ON public.structure USING btree (host);


--
-- Name: idx_system_event; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_system_event ON public.system_event USING btree (created);


--
-- Name: idx_template3; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_template3 ON public.template USING btree (lower((title)::text));


--
-- Name: idx_template_id; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_template_id ON public.template_containers USING btree (template_id);


--
-- Name: idx_template_vi_live; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_template_vi_live ON public.template_version_info USING btree (live_inode);


--
-- Name: idx_template_vi_version_ts; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_template_vi_version_ts ON public.template_version_info USING btree (version_ts);


--
-- Name: idx_template_vi_working; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_template_vi_working ON public.template_version_info USING btree (working_inode);


--
-- Name: idx_trackback_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_trackback_1 ON public.trackback USING btree (asset_identifier);


--
-- Name: idx_trackback_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_trackback_2 ON public.trackback USING btree (url);


--
-- Name: idx_tree; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_tree ON public.tree USING btree (child, parent, relation_type);


--
-- Name: idx_tree_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_tree_1 ON public.tree USING btree (parent);


--
-- Name: idx_tree_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_tree_2 ON public.tree USING btree (child);


--
-- Name: idx_tree_3; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_tree_3 ON public.tree USING btree (relation_type);


--
-- Name: idx_tree_4; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_tree_4 ON public.tree USING btree (parent, child, relation_type);


--
-- Name: idx_tree_5; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_tree_5 ON public.tree USING btree (parent, relation_type);


--
-- Name: idx_tree_6; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_tree_6 ON public.tree USING btree (child, relation_type);


--
-- Name: idx_user_clickstream11; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_clickstream11 ON public.clickstream USING btree (host_id);


--
-- Name: idx_user_clickstream12; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_clickstream12 ON public.clickstream USING btree (last_page_id);


--
-- Name: idx_user_clickstream13; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_clickstream13 ON public.clickstream USING btree (first_page_id);


--
-- Name: idx_user_clickstream14; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_clickstream14 ON public.clickstream USING btree (operating_system);


--
-- Name: idx_user_clickstream15; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_clickstream15 ON public.clickstream USING btree (browser_name);


--
-- Name: idx_user_clickstream16; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_clickstream16 ON public.clickstream USING btree (browser_version);


--
-- Name: idx_user_clickstream17; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_clickstream17 ON public.clickstream USING btree (remote_address);


--
-- Name: idx_user_clickstream_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_clickstream_1 ON public.clickstream USING btree (cookie_id);


--
-- Name: idx_user_clickstream_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_clickstream_2 ON public.clickstream USING btree (user_id);


--
-- Name: idx_user_clickstream_404_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_clickstream_404_1 ON public.clickstream_404 USING btree (request_uri);


--
-- Name: idx_user_clickstream_404_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_clickstream_404_2 ON public.clickstream_404 USING btree (user_id);


--
-- Name: idx_user_clickstream_404_3; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_clickstream_404_3 ON public.clickstream_404 USING btree (host_id);


--
-- Name: idx_user_clickstream_request_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_clickstream_request_1 ON public.clickstream_request USING btree (clickstream_id);


--
-- Name: idx_user_clickstream_request_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_clickstream_request_2 ON public.clickstream_request USING btree (request_uri);


--
-- Name: idx_user_clickstream_request_3; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_clickstream_request_3 ON public.clickstream_request USING btree (associated_identifier);


--
-- Name: idx_user_clickstream_request_4; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_clickstream_request_4 ON public.clickstream_request USING btree (timestampper);


--
-- Name: idx_user_comments_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_comments_1 ON public.user_comments USING btree (user_id);


--
-- Name: idx_user_webform_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_user_webform_1 ON public.web_form USING btree (form_type);


--
-- Name: idx_workflow_1; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_workflow_1 ON public.workflow_task USING btree (assigned_to);


--
-- Name: idx_workflow_2; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_workflow_2 ON public.workflow_task USING btree (belongs_to);


--
-- Name: idx_workflow_3; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_workflow_3 ON public.workflow_task USING btree (status);


--
-- Name: idx_workflow_4; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_workflow_4 ON public.workflow_task USING btree (webasset);


--
-- Name: idx_workflow_5; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_workflow_5 ON public.workflow_task USING btree (created_by);


--
-- Name: idx_workflow_6; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX idx_workflow_6 ON public.workflow_task USING btree (language_id);


--
-- Name: idx_workflow_action_mappings; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE UNIQUE INDEX idx_workflow_action_mappings ON public.workflow_action_mappings USING btree (action, workflow_action, scheme_or_content_type);


--
-- Name: links_ident; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX links_ident ON public.links USING btree (identifier);


--
-- Name: tag_inode_inode; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX tag_inode_inode ON public.tag_inode USING btree (inode);


--
-- Name: tag_inode_tagid; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX tag_inode_tagid ON public.tag_inode USING btree (tag_id);


--
-- Name: tag_is_persona_index; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX tag_is_persona_index ON public.tag USING btree (persona);


--
-- Name: tag_user_id_index; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX tag_user_id_index ON public.tag USING btree (user_id);


--
-- Name: template_ident; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX template_ident ON public.template USING btree (identifier);


--
-- Name: workflow_idx_action_class_action; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX workflow_idx_action_class_action ON public.workflow_action_class USING btree (action_id);


--
-- Name: workflow_idx_action_class_param_action; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX workflow_idx_action_class_param_action ON public.workflow_action_class_pars USING btree (workflow_action_class_id);


--
-- Name: workflow_idx_step_scheme; Type: INDEX; Schema: public; Owner: dotcms
--

CREATE INDEX workflow_idx_step_scheme ON public.workflow_step USING btree (scheme_id);


--
-- Name: identifier check_child_assets_trigger; Type: TRIGGER; Schema: public; Owner: dotcms
--

CREATE TRIGGER check_child_assets_trigger BEFORE DELETE ON public.identifier FOR EACH ROW EXECUTE FUNCTION public.check_child_assets();


--
-- Name: dot_containers container_versions_check_trigger; Type: TRIGGER; Schema: public; Owner: dotcms
--

CREATE TRIGGER container_versions_check_trigger AFTER DELETE ON public.dot_containers FOR EACH ROW EXECUTE FUNCTION public.container_versions_check();


--
-- Name: contentlet content_versions_check_trigger; Type: TRIGGER; Schema: public; Owner: dotcms
--

CREATE TRIGGER content_versions_check_trigger AFTER DELETE ON public.contentlet FOR EACH ROW EXECUTE FUNCTION public.content_versions_check();


--
-- Name: folder folder_identifier_check_trigger; Type: TRIGGER; Schema: public; Owner: dotcms
--

CREATE TRIGGER folder_identifier_check_trigger AFTER DELETE ON public.folder FOR EACH ROW EXECUTE FUNCTION public.folder_identifier_check();


--
-- Name: links link_versions_check_trigger; Type: TRIGGER; Schema: public; Owner: dotcms
--

CREATE TRIGGER link_versions_check_trigger AFTER DELETE ON public.links FOR EACH ROW EXECUTE FUNCTION public.link_versions_check();


--
-- Name: folder rename_folder_assets_trigger; Type: TRIGGER; Schema: public; Owner: dotcms
--

CREATE TRIGGER rename_folder_assets_trigger AFTER UPDATE ON public.folder FOR EACH ROW EXECUTE FUNCTION public.rename_folder_and_assets();


--
-- Name: identifier required_identifier_host_inode_trigger; Type: TRIGGER; Schema: public; Owner: dotcms
--

CREATE TRIGGER required_identifier_host_inode_trigger BEFORE INSERT OR UPDATE ON public.identifier FOR EACH ROW EXECUTE FUNCTION public.identifier_host_inode_check();


--
-- Name: structure structure_host_folder_trigger; Type: TRIGGER; Schema: public; Owner: dotcms
--

CREATE TRIGGER structure_host_folder_trigger BEFORE INSERT OR UPDATE ON public.structure FOR EACH ROW EXECUTE FUNCTION public.structure_host_folder_check();


--
-- Name: template template_versions_check_trigger; Type: TRIGGER; Schema: public; Owner: dotcms
--

CREATE TRIGGER template_versions_check_trigger AFTER DELETE ON public.template FOR EACH ROW EXECUTE FUNCTION public.template_versions_check();


--
-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: dotcms
--

REVOKE USAGE ON SCHEMA public FROM PUBLIC;
GRANT ALL ON SCHEMA public TO PUBLIC;


--
--

