--
--


--
-- Name: oneunified; Type: DATABASE; Schema: -; Owner: oneunified
--

CREATE DATABASE oneunified WITH TEMPLATE = template0 ENCODING = 'UTF8';


ALTER DATABASE oneunified OWNER TO oneunified;

\connect oneunified


--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--

COMMENT ON SCHEMA public IS 'Standard public schema';





--
-- Name: address; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE address (
    addressid serial NOT NULL,
    parent integer,
    address inet NOT NULL,
    name character varying(50),
    organizationid integer NOT NULL,
    description character varying(250),
    url character varying(100)
);


ALTER TABLE public.address OWNER TO oneunified;

--
-- Name: address_addressid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('address', 'addressid'), 1, false);


--
-- Name: circuit; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE circuit (
    circuitid serial NOT NULL,
    parent integer,
    name character varying(50),
    addressid integer,
    description character varying(250) NOT NULL,
    url character varying(100)
);


ALTER TABLE public.circuit OWNER TO oneunified;

--
-- Name: circuit_circuitid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('circuit', 'circuitid'), 1, false);


--
-- Name: host; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE host (
    hostid serial NOT NULL,
    name character varying(50) NOT NULL,
    locationid integer NOT NULL,
    description character varying(250),
    url1 character varying(100),
    url2 character varying(100),
    hosttypeid integer NOT NULL
);


ALTER TABLE public.host OWNER TO oneunified;

--
-- Name: host_hostid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('host', 'hostid'), 1, false);


--
-- Name: hostimage; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE hostimage (
    hostimageid serial NOT NULL,
    hostid integer NOT NULL,
    imageid integer NOT NULL,
    description character varying(250)
);


ALTER TABLE public.hostimage OWNER TO oneunified;

--
-- Name: hostimage_hostimageid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('hostimage', 'hostimageid'), 1, false);


--
-- Name: hostonimage; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE hostonimage (
    hostonimageid serial NOT NULL,
    hostid integer NOT NULL,
    imageid integer NOT NULL,
    x integer NOT NULL,
    y integer NOT NULL
);


ALTER TABLE public.hostonimage OWNER TO oneunified;

--
-- Name: hostonimage_hostonimageid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('hostonimage', 'hostonimageid'), 1, false);


--
-- Name: hosttype; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE hosttype (
    hosttypeid serial NOT NULL,
    name character varying(50) NOT NULL,
    description character varying(250)
);


ALTER TABLE public.hosttype OWNER TO oneunified;

--
-- Name: hosttype_hosttypeid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('hosttype', 'hosttypeid'), 1, false);


--
-- Name: ianaiftype; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE ianaiftype (
    ianaiftypeid serial NOT NULL,
    name character varying(50) NOT NULL,
    description character varying(250),
    common boolean DEFAULT false NOT NULL
);


ALTER TABLE public.ianaiftype OWNER TO oneunified;

--
-- Name: ianaiftype_ianaiftypeid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('ianaiftype', 'ianaiftypeid'), 1, false);


--
-- Name: image; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE image (
    imageid serial NOT NULL,
    sourcepath character varying(250),
    filepath character varying(250) NOT NULL,
    width integer,
    height integer,
    thumbnailpath character varying(250),
    description character varying(100)
);


ALTER TABLE public.image OWNER TO oneunified;

--
-- Name: COLUMN image.filepath; Type: COMMENT; Schema: public; Owner: oneunified
--

COMMENT ON COLUMN image.filepath IS 'Path on local system';


--
-- Name: image_imageid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('image', 'imageid'), 1, false);


--
-- Name: interface; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE interface (
    interfaceid serial NOT NULL,
    hostid integer NOT NULL,
    parent integer,
    ianaiftypeid integer NOT NULL,
    circuitid integer,
    addressid integer,
    name character varying(50) NOT NULL,
    mac macaddr,
    description character varying(250),
    fqdn character varying(100),
    url character varying(100),
    vlanid integer,
    vrfid integer
);


ALTER TABLE public.interface OWNER TO oneunified;

--
-- Name: interface_interfaceid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('interface', 'interfaceid'), 1, false);


--
-- Name: location; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE "location" (
    locationid serial NOT NULL,
    parent integer,
    name character varying(50) NOT NULL,
    description character varying(250),
    url character varying(100)
);


ALTER TABLE public."location" OWNER TO oneunified;

--
-- Name: location_locationid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('"location"', 'locationid'), 1, false);


--
-- Name: locationimage; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE locationimage (
    locationimageid serial NOT NULL,
    locationid integer NOT NULL,
    imageid integer NOT NULL,
    description character varying(250)
);


ALTER TABLE public.locationimage OWNER TO oneunified;

--
-- Name: locationimage_locationimageid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('locationimage', 'locationimageid'), 1, false);


--
-- Name: locationonimage; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE locationonimage (
    locationonimageid serial NOT NULL,
    locationid integer NOT NULL,
    imageid integer NOT NULL,
    x integer NOT NULL,
    y integer NOT NULL
);


ALTER TABLE public.locationonimage OWNER TO oneunified;

--
-- Name: locationonimage_locationonimageid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('locationonimage', 'locationonimageid'), 1, false);


--
-- Name: organization; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE organization (
    organizationid serial NOT NULL,
    name character varying(50) NOT NULL,
    asn integer,
    whoisid character varying(50),
    description character varying(250),
    url character varying(100)
);


ALTER TABLE public.organization OWNER TO oneunified;

--
-- Name: organization_organizationid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('organization', 'organizationid'), 1, false);


--
-- Name: port; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE port (
    portid serial NOT NULL,
    addressid integer NOT NULL,
    port smallint NOT NULL,
    portend smallint DEFAULT 0,
    name character varying(50) NOT NULL,
    description character varying(250),
    url character varying(100)
);


ALTER TABLE public.port OWNER TO oneunified;

--
-- Name: port_portid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('port', 'portid'), 1, false);


--
-- Name: vlan; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE vlan (
    vlanid serial NOT NULL,
    vlannumber integer DEFAULT 1 NOT NULL,
    name character varying(50) NOT NULL,
    description character varying(250)
);


ALTER TABLE public.vlan OWNER TO oneunified;

--
-- Name: vlan_vlanid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('vlan', 'vlanid'), 1, false);


--
-- Name: vrf; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE vrf (
    vrfid serial NOT NULL,
    name character varying(50) NOT NULL,
    routedescriptor character varying(20) NOT NULL,
    description character varying(250)
);


ALTER TABLE public.vrf OWNER TO oneunified;

--
-- Name: vrf_vrfid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('vrf', 'vrfid'), 1, false);


--
-- Name: weathermap; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE weathermap (
    weathermapid serial NOT NULL,
    imageid integer NOT NULL,
    name character varying(50) NOT NULL,
    description character varying(250)
);


ALTER TABLE public.weathermap OWNER TO oneunified;

--
-- Name: weathermap_weathermapid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('weathermap', 'weathermapid'), 1, false);


--
-- Name: weathermapcircuit; Type: TABLE; Schema: public; Owner: oneunified; Tablespace: 
--

CREATE TABLE weathermapcircuit (
    weathermapcircuitid serial NOT NULL,
    weathermapid integer NOT NULL,
    circuitid integer NOT NULL,
    x1 integer NOT NULL,
    y1 integer NOT NULL,
    x2 integer NOT NULL,
    y2 integer NOT NULL
);


ALTER TABLE public.weathermapcircuit OWNER TO oneunified;

--
-- Name: weathermapcircuit_weathermapcircuitid_seq; Type: SEQUENCE SET; Schema: public; Owner: oneunified
--

SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('weathermapcircuit', 'weathermapcircuitid'), 1, false);


--
-- Data for Name: address; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY address (addressid, parent, address, name, organizationid, description, url) FROM stdin;
\.


--
-- Data for Name: circuit; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY circuit (circuitid, parent, name, addressid, description, url) FROM stdin;
\.


--
-- Data for Name: host; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY host (hostid, name, locationid, description, url1, url2, hosttypeid) FROM stdin;
\.


--
-- Data for Name: hostimage; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY hostimage (hostimageid, hostid, imageid, description) FROM stdin;
\.


--
-- Data for Name: hostonimage; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY hostonimage (hostonimageid, hostid, imageid, x, y) FROM stdin;
\.


--
-- Data for Name: hosttype; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY hosttype (hosttypeid, name, description) FROM stdin;
\.


--
-- Data for Name: ianaiftype; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY ianaiftype (ianaiftypeid, name, description, common) FROM stdin;
\.


--
-- Data for Name: image; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY image (imageid, sourcepath, filepath, width, height, thumbnailpath, description) FROM stdin;
\.


--
-- Data for Name: interface; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY interface (interfaceid, hostid, parent, ianaiftypeid, circuitid, addressid, name, mac, description, fqdn, url, vlanid, vrfid) FROM stdin;
\.


--
-- Data for Name: location; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY "location" (locationid, parent, name, description, url) FROM stdin;
\.


--
-- Data for Name: locationimage; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY locationimage (locationimageid, locationid, imageid, description) FROM stdin;
\.


--
-- Data for Name: locationonimage; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY locationonimage (locationonimageid, locationid, imageid, x, y) FROM stdin;
\.


--
-- Data for Name: organization; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY organization (organizationid, name, asn, whoisid, description, url) FROM stdin;
\.


--
-- Data for Name: port; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY port (portid, addressid, port, portend, name, description, url) FROM stdin;
\.


--
-- Data for Name: vlan; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY vlan (vlanid, vlannumber, name, description) FROM stdin;
\.


--
-- Data for Name: vrf; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY vrf (vrfid, name, routedescriptor, description) FROM stdin;
\.


--
-- Data for Name: weathermap; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY weathermap (weathermapid, imageid, name, description) FROM stdin;
\.


--
-- Data for Name: weathermapcircuit; Type: TABLE DATA; Schema: public; Owner: oneunified
--

COPY weathermapcircuit (weathermapcircuitid, weathermapid, circuitid, x1, y1, x2, y2) FROM stdin;
\.


--
-- Name: pkaddressid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY address
    ADD CONSTRAINT pkaddressid PRIMARY KEY (addressid);


--
-- Name: pkcircuitid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY circuit
    ADD CONSTRAINT pkcircuitid PRIMARY KEY (circuitid);


--
-- Name: pkhostid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY host
    ADD CONSTRAINT pkhostid PRIMARY KEY (hostid);


--
-- Name: pkhostimageid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY hostimage
    ADD CONSTRAINT pkhostimageid PRIMARY KEY (hostimageid);


--
-- Name: pkhostonimageid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY hostonimage
    ADD CONSTRAINT pkhostonimageid PRIMARY KEY (hostonimageid);


--
-- Name: pkhosttypeid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY hosttype
    ADD CONSTRAINT pkhosttypeid PRIMARY KEY (hosttypeid);


--
-- Name: pkianaiftypeid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY ianaiftype
    ADD CONSTRAINT pkianaiftypeid PRIMARY KEY (ianaiftypeid);


--
-- Name: pkimageid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY image
    ADD CONSTRAINT pkimageid PRIMARY KEY (imageid);


--
-- Name: pkinterfaceid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY interface
    ADD CONSTRAINT pkinterfaceid PRIMARY KEY (interfaceid);


--
-- Name: pklocationid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY "location"
    ADD CONSTRAINT pklocationid PRIMARY KEY (locationid);


--
-- Name: pklocationimageid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY locationimage
    ADD CONSTRAINT pklocationimageid PRIMARY KEY (locationimageid);


--
-- Name: pklocationonimageid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY locationonimage
    ADD CONSTRAINT pklocationonimageid PRIMARY KEY (locationonimageid);


--
-- Name: pkorganizationid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY organization
    ADD CONSTRAINT pkorganizationid PRIMARY KEY (organizationid);


--
-- Name: pkportid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY port
    ADD CONSTRAINT pkportid PRIMARY KEY (portid);


--
-- Name: pkvlanid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY vlan
    ADD CONSTRAINT pkvlanid PRIMARY KEY (vlanid);


--
-- Name: pkvrfid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY vrf
    ADD CONSTRAINT pkvrfid PRIMARY KEY (vrfid);


--
-- Name: pkweathermapcircuitid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY weathermapcircuit
    ADD CONSTRAINT pkweathermapcircuitid PRIMARY KEY (weathermapcircuitid);


--
-- Name: pkweathermapid; Type: CONSTRAINT; Schema: public; Owner: oneunified; Tablespace: 
--

ALTER TABLE ONLY weathermap
    ADD CONSTRAINT pkweathermapid PRIMARY KEY (weathermapid);


--
-- Name: fk_address_addressid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY port
    ADD CONSTRAINT fk_address_addressid FOREIGN KEY (addressid) REFERENCES address(addressid);


--
-- Name: fk_address_addressid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY circuit
    ADD CONSTRAINT fk_address_addressid FOREIGN KEY (addressid) REFERENCES address(addressid);


--
-- Name: fk_address_addressid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY interface
    ADD CONSTRAINT fk_address_addressid FOREIGN KEY (addressid) REFERENCES address(addressid);


--
-- Name: fk_circuit_circuitid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY interface
    ADD CONSTRAINT fk_circuit_circuitid FOREIGN KEY (circuitid) REFERENCES circuit(circuitid);


--
-- Name: fk_circuit_circuitid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY weathermapcircuit
    ADD CONSTRAINT fk_circuit_circuitid FOREIGN KEY (circuitid) REFERENCES circuit(circuitid);


--
-- Name: fk_host_hostid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY interface
    ADD CONSTRAINT fk_host_hostid FOREIGN KEY (hostid) REFERENCES host(hostid);


--
-- Name: fk_host_hostid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY hostimage
    ADD CONSTRAINT fk_host_hostid FOREIGN KEY (hostid) REFERENCES host(hostid);


--
-- Name: fk_host_hostid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY hostonimage
    ADD CONSTRAINT fk_host_hostid FOREIGN KEY (hostid) REFERENCES host(hostid);


--
-- Name: fk_hosttype_hosttypeid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY host
    ADD CONSTRAINT fk_hosttype_hosttypeid FOREIGN KEY (hosttypeid) REFERENCES hosttype(hosttypeid);


--
-- Name: fk_ianaiftype_ianaiftypeid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY interface
    ADD CONSTRAINT fk_ianaiftype_ianaiftypeid FOREIGN KEY (ianaiftypeid) REFERENCES ianaiftype(ianaiftypeid);


--
-- Name: fk_image_imageid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY hostimage
    ADD CONSTRAINT fk_image_imageid FOREIGN KEY (imageid) REFERENCES image(imageid);


--
-- Name: fk_image_imageid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY locationimage
    ADD CONSTRAINT fk_image_imageid FOREIGN KEY (imageid) REFERENCES image(imageid);


--
-- Name: fk_image_imageid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY hostonimage
    ADD CONSTRAINT fk_image_imageid FOREIGN KEY (imageid) REFERENCES image(imageid);


--
-- Name: fk_image_imageid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY locationonimage
    ADD CONSTRAINT fk_image_imageid FOREIGN KEY (imageid) REFERENCES image(imageid);


--
-- Name: fk_image_imageid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY weathermap
    ADD CONSTRAINT fk_image_imageid FOREIGN KEY (imageid) REFERENCES image(imageid);


--
-- Name: fk_location_locationid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY host
    ADD CONSTRAINT fk_location_locationid FOREIGN KEY (locationid) REFERENCES "location"(locationid);


--
-- Name: fk_location_locationid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY locationimage
    ADD CONSTRAINT fk_location_locationid FOREIGN KEY (locationid) REFERENCES "location"(locationid);


--
-- Name: fk_location_locationid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY locationonimage
    ADD CONSTRAINT fk_location_locationid FOREIGN KEY (locationid) REFERENCES "location"(locationid);


--
-- Name: fk_organization_organizationid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY address
    ADD CONSTRAINT fk_organization_organizationid FOREIGN KEY (organizationid) REFERENCES organization(organizationid);


--
-- Name: fk_vlan_vlanid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY interface
    ADD CONSTRAINT fk_vlan_vlanid FOREIGN KEY (vlanid) REFERENCES vlan(vlanid);


--
-- Name: fk_vrf_vrfid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY interface
    ADD CONSTRAINT fk_vrf_vrfid FOREIGN KEY (vrfid) REFERENCES vrf(vrfid);


--
-- Name: fk_weathermap_weathermapid; Type: FK CONSTRAINT; Schema: public; Owner: oneunified
--

ALTER TABLE ONLY weathermapcircuit
    ADD CONSTRAINT fk_weathermap_weathermapid FOREIGN KEY (weathermapid) REFERENCES weathermap(weathermapid);


--
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

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


--
--

