 
 
 --
+-- Name: deprecated_dz_pv_readings; Type: ACL; Schema: public; Owner: postgres
+--
+
+REVOKE ALL ON TABLE deprecated_dz_pv_readings FROM PUBLIC;
+REVOKE ALL ON TABLE deprecated_dz_pv_readings FROM postgres;
+GRANT ALL ON TABLE deprecated_dz_pv_readings TO postgres;
+GRANT ALL ON TABLE deprecated_dz_pv_readings TO sepgroup;
+
+
+--
+-- Name: nonpv_mlh; Type: ACL; Schema: public; Owner: postgres
+--
+
+REVOKE ALL ON TABLE nonpv_mlh FROM PUBLIC;
+REVOKE ALL ON TABLE nonpv_mlh FROM postgres;
+GRANT ALL ON TABLE nonpv_mlh TO postgres;
+GRANT ALL ON TABLE nonpv_mlh TO sepgroup;
+
+
+--
+-- Name: deprecated_dz_pv_readings_without_pv_service_point_ids; Type: ACL; Schema: public; Owner: postgres
+--
+
+REVOKE ALL ON TABLE deprecated_dz_pv_readings_without_pv_service_point_ids FROM PUBLIC;
+REVOKE ALL ON TABLE deprecated_dz_pv_readings_without_pv_service_point_ids FROM postgres;
+GRANT ALL ON TABLE deprecated_dz_pv_readings_without_pv_service_point_ids TO postgres;
+GRANT ALL ON TABLE deprecated_dz_pv_readings_without_pv_service_point_ids TO sepgroup;
+
+
+--
 -- Name: deprecated_meter_ids_for_houses_without_pv; Type: ACL; Schema: public; Owner: postgres
 --
 

ALTER TABLE public.locations_with_pv_service_points_ids OWNER TO postgres;

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

CREATE VIEW nonpv_mlh AS
    SELECT "MeterLocationHistory".service_point_id, "MeterLocationHistory".service_point_height, "MeterLocationHistory".service_point_latitude, "MeterLocationHistory".service_point_longitude, "MeterLocationHistory".notes, "MeterLocationHistory".longitude, "MeterLocationHistory".latitude, "MeterLocationHistory".city, "MeterLocationHistory".address, "MeterLocationHistory".location, "MeterLocationHistory".uninstalled, "MeterLocationHistory".installed, "MeterLocationHistory".mac_address, "MeterLocationHistory".meter_name FROM "MeterLocationHistory" WHERE (NOT (EXISTS (SELECT "PVServicePointIDs".pv_service_point_id FROM "PVServicePointIDs" WHERE (("PVServicePointIDs".pv_service_point_id)::text = ("MeterLocationHistory".service_point_id)::text))));


ALTER TABLE public.nonpv_mlh OWNER TO postgres;

--
-- Name: VIEW nonpv_mlh; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON VIEW nonpv_mlh IS 'This is the Meter Location History for nonPV service points. @author Daniel Zhang (張道博)';


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


--

CREATE VIEW nonpv_service_point_ids AS
    SELECT "MeterLocationHistory".service_point_id, "MeterLocationHistory".meter_name, "MeterLocationHistory".installed, "MeterLocationHistory".uninstalled FROM "MeterLocationHistory" WHERE (NOT (EXISTS (SELECT "PVServicePointIDs".pv_service_point_id FROM "PVServicePointIDs" WHERE (("PVServicePointIDs".pv_service_point_id)::text = ("MeterLocationHistory".service_point_id)::text))));


ALTER TABLE public.nonpv_service_point_ids OWNER TO postgres;
