     latitude numeric,
     longitude numeric,
     parent_cachegroup text,
-    type text NOT NULL,
+    type text NOT NULL REFERENCES cachegroups_types (name),
     created_at timestamp without time zone DEFAULT now() NOT NULL
 );
 


ALTER TABLE ONLY deliveryservices
    ADD CONSTRAINT deliveryservices_profile_profiles_name_fkey FOREIGN KEY (profile) REFERENCES profiles(name);


--
-- Name: deliveryservices_type_types_name_fkey; Type: FK CONSTRAINT; Schema: public; Owner: touser
--

ALTER TABLE ONLY deliveryservices
    ADD CONSTRAINT deliveryservices_type_types_name_fkey FOREIGN KEY (type) REFERENCES types(name);


--
-- Name: domains_cdn_fkey; Type: FK CONSTRAINT; Schema: public; Owner: touser


ALTER TABLE content_servers OWNER TO touser;


CREATE TABLE deliveryservices_types (
    name text PRIMARY KEY,
    description text NOT NULL,
    created_at timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE deliveryservices_types OWNER TO touser;

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