 
 
 ALTER TABLE cachegroups OWNER TO touser;
-
---
--- Name: api_asns; Type: VIEW; Schema: public; Owner: touser
---
-
-CREATE VIEW api_asns AS
- SELECT pg_xact_commit_timestamp(a.xmin) AS last_updated,
-    a.asn,
-    c.name AS cachegroup
-   FROM asns a,
-    cachegroups c
-  WHERE (a.cachegroup = c.name);
-
-
-ALTER TABLE api_asns OWNER TO touser;
-
---
--- Name: profiles; Type: TABLE; Schema: public; Owner: touser
---
-
-CREATE TABLE profiles (
-    name text NOT NULL,
-    description text,
-    created_at timestamp without time zone DEFAULT now() NOT NULL
-);
-
-
-ALTER TABLE profiles OWNER TO touser;
-
---
--- Name: api_profiles; Type: VIEW; Schema: public; Owner: touser
---
-
-CREATE VIEW api_profiles AS
- SELECT pg_xact_commit_timestamp(profiles.xmin) AS last_updated,
-    profiles.name,
-    profiles.description
-   FROM profiles;
-
-
-ALTER TABLE api_profiles OWNER TO touser;
-
---
--- Name: regions; Type: TABLE; Schema: public; Owner: touser
---
-
-CREATE TABLE regions (
-    name text NOT NULL,
-    division text NOT NULL,
-    created_at timestamp without time zone DEFAULT now() NOT NULL
-);
-
-
-ALTER TABLE regions OWNER TO touser;
-
---
--- Name: api_regions; Type: VIEW; Schema: public; Owner: touser
---
-
-CREATE VIEW api_regions AS
- SELECT regions.name,
-    regions.division
-   FROM regions;
-
-
-ALTER TABLE api_regions OWNER TO touser;
 
 --
 -- Name: cachegroups_parameters; Type: TABLE; Schema: public; Owner: touser

    staticdnsentries.rdata AS sdns_address,
    staticdnsentries.ttl AS sdns_ttl,
    sdnstypes.name AS sdns_type
   FROM (((((((deliveryservices
     JOIN cdns ON ((cdns.name = deliveryservices.cdn)))
     LEFT JOIN staticdnsentries ON ((deliveryservices.name = staticdnsentries.deliveryservice)))
     JOIN deliveryservices_regexes ON ((deliveryservices_regexes.deliveryservice = deliveryservices.name)))
     JOIN regexes ON ((regexes.id = deliveryservices_regexes.regex_id)))
     JOIN types protocoltypes ON ((protocoltypes.name = deliveryservices.type)))
     JOIN types regextypes ON ((regextypes.name = regexes.type)))
     LEFT JOIN types sdnstypes ON ((sdnstypes.name = (staticdnsentries.type)::text)));


ALTER TABLE crconfig_ds_data OWNER TO touser;

--
-- Name: crconfig_params; Type: VIEW; Schema: public; Owner: touser
--

CREATE VIEW crconfig_params AS
 SELECT DISTINCT cdns.name AS cdn_name,
    servers.profile,
    servers.type AS stype,
    parameters.name AS pname,
    parameters.config_file AS cfile,
    parameters.value AS pvalue
   FROM ((((servers
     JOIN cdns ON ((cdns.name = servers.cdn)))
     JOIN profiles ON ((profiles.name = servers.profile)))
     JOIN profiles_parameters ON ((profiles_parameters.profile = servers.profile)))
     JOIN parameters ON ((parameters.id = profiles_parameters.parameter_id)))
  WHERE ((servers.type = ANY (ARRAY['EDGE'::text, 'MID'::text, 'CCR'::text])) AND (parameters.config_file = 'CRConfig.json'::text));


ALTER TABLE crconfig_params OWNER TO touser;

--
-- Name: deliveryservices_users; Type: TABLE; Schema: public; Owner: touser

ALTER TABLE staticdnsentries OWNER TO touser;

--
-- Name: types; Type: TABLE; Schema: public; Owner: touser
--

CREATE TABLE types (
    name text NOT NULL,
    description text,
    use_in_table text,
    created_at timestamp without time zone DEFAULT now() NOT NULL
);


ALTER TABLE types OWNER TO touser;

--
-- Name: crconfig_ds_data_v; Type: VIEW; Schema: public; Owner: touser
--

CREATE VIEW crconfig_ds_data_v AS
 SELECT deliveryservices.name,
    deliveryservices.profile,
    deliveryservices.ccr_dns_ttl,
