 
 
 --
+-- 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
 --
 



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

CREATE VIEW "meter_V_readings_and_locations" 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".start_time, "IntervalReadData".end_time, "Reading".channel, "Reading".uom, "Reading".value 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."meter_V_readings_and_locations" OWNER TO eileen;

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

CREATE VIEW meter_locations AS
    SELECT "LocationRecords".service_pt_longitude, "LocationRecords".service_pt_latitude, "LocationRecords".device_util_id, "LocationRecords".device_serial_no, "LocationRecords".device_status, "LocationRecords".load_device_type FROM "LocationRecords";


ALTER TABLE public.meter_locations OWNER TO eileen;

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




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

REVOKE ALL ON TABLE "testCastChannel" FROM PUBLIC;
REVOKE ALL ON TABLE "testCastChannel" FROM postgres;
GRANT ALL ON TABLE "testCastChannel" TO postgres;
GRANT ALL ON TABLE "testCastChannel" TO sepgroup;


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

