 
 COMMENT ON COLUMN "MeterData".created IS 'timestamp for when data is inserted';
 
-
---
--- Name: Reading; Type: TABLE; Schema: public; Owner: sepgroup; Tablespace: 
---
-
-CREATE TABLE "Reading" (
-    interval_id bigint NOT NULL,
-    reading_id bigint NOT NULL,
-    block_end_value real,
-    channel smallint NOT NULL,
-    raw_value smallint NOT NULL,
-    uom character varying,
-    value real
-);
-
-
-ALTER TABLE public."Reading" OWNER TO sepgroup;
-
---
--- Name: Distinct_Voltage_and_Location; Type: VIEW; Schema: public; Owner: eileen
---
-
-CREATE VIEW "Distinct_Voltage_and_Location" AS
-    SELECT DISTINCT "Interval".end_time, "Reading".channel, "MeterData".meter_name, "Reading".value, "Reading".uom, "LocationRecords".service_pt_latitude, "LocationRecords".service_pt_longitude FROM (((("MeterData" JOIN "IntervalReadData" ON (("MeterData".meter_data_id = "IntervalReadData".meter_data_id))) JOIN "Interval" ON (("IntervalReadData".interval_read_data_id = "Interval".interval_read_data_id))) JOIN "Reading" ON (("Interval".interval_id = "Reading".interval_id))) JOIN "LocationRecords" ON (("MeterData".util_device_id = ("LocationRecords".device_util_id)::bpchar))) WHERE ("Reading".channel = 4) ORDER BY "Interval".end_time, "MeterData".meter_name, "Reading".channel;
-
-
-ALTER TABLE public."Distinct_Voltage_and_Location" OWNER TO eileen;
-
---
--- Name: Distinct_kWh_3channels_and_location; Type: VIEW; Schema: public; Owner: eileen
---
-
-CREATE VIEW "Distinct_kWh_3channels_and_location" AS
-    SELECT DISTINCT "Interval".end_time, "Reading".channel, "MeterData".meter_name, "Reading".value, "Reading".uom, "LocationRecords".service_pt_latitude, "LocationRecords".service_pt_longitude FROM (((("MeterData" JOIN "IntervalReadData" ON (("MeterData".meter_data_id = "IntervalReadData".meter_data_id))) JOIN "Interval" ON (("IntervalReadData".interval_read_data_id = "Interval".interval_read_data_id))) JOIN "Reading" ON (("Interval".interval_id = "Reading".interval_id))) JOIN "LocationRecords" ON (("MeterData".util_device_id = ("LocationRecords".device_util_id)::bpchar))) WHERE ("Reading".channel < 4) ORDER BY "Interval".end_time, "MeterData".meter_name, "Reading".channel;
-
-
-ALTER TABLE public."Distinct_kWh_3channels_and_location" OWNER TO eileen;
-
---
--- Name: Event; Type: TABLE; Schema: public; Owner: sepgroup; Tablespace: 
---
-
-CREATE TABLE "Event" (
-    event_name character varying,
-    event_time timestamp without time zone,
-    event_text character varying,
-    event_data_id bigint,
-    event_id bigint NOT NULL
-);
-
-
-ALTER TABLE public."Event" OWNER TO sepgroup;
-
---
--- Name: EventData; Type: TABLE; Schema: public; Owner: sepgroup; Tablespace: 
---
-
-CREATE TABLE "EventData" (
-    end_time timestamp without time zone,
-    number_events smallint,
-    start_time timestamp without time zone,
-    meter_data_id bigint,
-    event_data_id bigint NOT NULL
-);
-
-
-ALTER TABLE public."EventData" OWNER TO sepgroup;
 
 --
 -- Name: MeterRecords; Type: TABLE; Schema: public; Owner: sepgroup; Tablespace: 



--
-- Name: meter_V_readings_and_locations; Type: ACL; Schema: public; Owner: eileen
--

REVOKE ALL ON TABLE "meter_V_readings_and_locations" FROM PUBLIC;
REVOKE ALL ON TABLE "meter_V_readings_and_locations" FROM eileen;
GRANT ALL ON TABLE "meter_V_readings_and_locations" TO eileen;
GRANT ALL ON TABLE "meter_V_readings_and_locations" TO sepgroup;


--
-- Name: meter_locations; Type: ACL; Schema: public; Owner: eileen
--

REVOKE ALL ON TABLE meter_locations FROM PUBLIC;
REVOKE ALL ON TABLE meter_locations FROM eileen;
GRANT ALL ON TABLE meter_locations TO eileen;
GRANT ALL ON TABLE meter_locations TO sepgroup;


--
-- Name: meterdata_id_seq; Type: ACL; Schema: public; Owner: sepgroup
--




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

REVOKE ALL ON TABLE new_energy_readings_with_location_address FROM PUBLIC;
REVOKE ALL ON TABLE new_energy_readings_with_location_address FROM postgres;
GRANT ALL ON TABLE new_energy_readings_with_location_address TO postgres;
GRANT ALL ON TABLE new_energy_readings_with_location_address TO sepgroup;


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

REVOKE ALL ON TABLE raw_meter_readings FROM PUBLIC;
REVOKE ALL ON TABLE raw_meter_readings FROM postgres;
GRANT ALL ON TABLE raw_meter_readings TO postgres;
GRANT ALL ON TABLE raw_meter_readings TO sepgroup;


--
-- Name: reading_id_seq; Type: ACL; Schema: public; Owner: sepgroup
--

