 SET default_tablespace = '';
 
 SET default_with_oids = false;
+
+--
+-- 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: Interval; Type: TABLE; Schema: public; Owner: sepgroup; Tablespace: 

ALTER TABLE public."MeterRecords" OWNER TO sepgroup;

--
-- Name: Register; Type: TABLE; Schema: public; Owner: sepgroup; Tablespace: 
--


--

CREATE VIEW count_of_readings_and_meters_by_day AS
    SELECT date_trunc('day'::text, view_readings.end_time) AS "Day", count(view_readings.value) AS "Reading Count", count(DISTINCT view_readings.meter_name) AS "Meter Count" FROM view_readings WHERE (view_readings.channel = 1) GROUP BY date_trunc('day'::text, view_readings.end_time) ORDER BY date_trunc('day'::text, view_readings.end_time);


ALTER TABLE public.count_of_readings_and_meters_by_day OWNER TO postgres;
