 
 
 --
+-- Name: Event; Type: ACL; Schema: public; Owner: sepgroup
+--
+
+REVOKE ALL ON TABLE "Event" FROM PUBLIC;
+REVOKE ALL ON TABLE "Event" FROM sepgroup;
+GRANT ALL ON TABLE "Event" TO sepgroup;
+
+
+--
+-- Name: EventData; Type: ACL; Schema: public; Owner: sepgroup
+--
+
+REVOKE ALL ON TABLE "EventData" FROM PUBLIC;
+REVOKE ALL ON TABLE "EventData" FROM sepgroup;
+GRANT ALL ON TABLE "EventData" TO sepgroup;
+
+
+--
 -- Name: Interval; Type: ACL; Schema: public; Owner: sepgroup
 --
 



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




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

CREATE VIEW new_energy_readings_with_location_address AS
    SELECT "LocationRecords".service_pt_latitude, "LocationRecords".service_pt_longitude, "LocationRecords".service_pt_height, "LocationRecords".device_util_id, "LocationRecords".device_serial_no, "LocationRecords".device_status, "MeterData".util_device_id, "MeterData".meter_name, "IntervalReadData".end_time, "Reading".channel, "Reading".uom, "Reading".value, "LocationRecords".address1 FROM (((("LocationRecords" JOIN "MeterData" ON (((("LocationRecords".device_util_id)::bpchar = "MeterData".util_device_id) AND (("LocationRecords".device_util_id)::bpchar = "MeterData".util_device_id)))) 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))) WHERE ("Reading".channel < 4);


ALTER TABLE public.new_energy_readings_with_location_address OWNER TO postgres;

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

CREATE VIEW raw_meter_readings AS
    SELECT "Interval".end_time, "MeterData".meter_name, "Reading".channel, "Reading".raw_value, "Reading".value, "Reading".uom, "MeterData".util_device_id 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))) ORDER BY "Interval".end_time, "MeterData".meter_name, "Reading".channel;


ALTER TABLE public.raw_meter_readings OWNER TO postgres;

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

