mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 08:57:08 +00:00
Add timed event labels to events view
This commit is contained in:
@@ -330,6 +330,25 @@ Events that occur within a sequence can be associated with dynamically, via a vi
|
||||
';
|
||||
|
||||
|
||||
--
|
||||
-- Name: events_timed_labels; Type: TABLE; Schema: _SURVEY__TEMPLATE_; Owner: postgres
|
||||
--
|
||||
|
||||
CREATE TABLE _SURVEY__TEMPLATE_.events_timed_labels (
|
||||
id integer NOT NULL,
|
||||
label text NOT NULL
|
||||
);
|
||||
|
||||
|
||||
ALTER TABLE _SURVEY__TEMPLATE_.events_timed_labels OWNER TO postgres;
|
||||
|
||||
--
|
||||
-- Name: TABLE events_timed_labels; Type: COMMENT; Schema: _SURVEY__TEMPLATE_; Owner: postgres
|
||||
--
|
||||
|
||||
COMMENT ON TABLE _SURVEY__TEMPLATE_.events_timed_labels IS 'Associates labels with events in events_timed.';
|
||||
|
||||
|
||||
--
|
||||
-- Name: final_shots; Type: TABLE; Schema: _SURVEY__TEMPLATE_; Owner: postgres
|
||||
--
|
||||
@@ -474,6 +493,17 @@ CREATE VIEW _SURVEY__TEMPLATE_.events AS
|
||||
NULL::text AS label,
|
||||
events_timed_sequences.remarks
|
||||
FROM events_timed_sequences
|
||||
UNION
|
||||
SELECT 'timed_labels'::text AS source,
|
||||
etl.id,
|
||||
ets.sequence,
|
||||
ets.point AS shot_number,
|
||||
ets.ts0,
|
||||
ets.ts1,
|
||||
etl.label,
|
||||
NULL::text AS remarks
|
||||
FROM (_SURVEY__TEMPLATE_.events_timed_labels etl
|
||||
JOIN events_timed_sequences ets USING (id))
|
||||
UNION
|
||||
SELECT 'shot_labels'::text AS source,
|
||||
NULL::integer AS id,
|
||||
@@ -567,25 +597,6 @@ ALTER TABLE _SURVEY__TEMPLATE_.events_timed_id_seq OWNER TO postgres;
|
||||
ALTER SEQUENCE _SURVEY__TEMPLATE_.events_timed_id_seq OWNED BY _SURVEY__TEMPLATE_.events_timed.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: events_timed_labels; Type: TABLE; Schema: _SURVEY__TEMPLATE_; Owner: postgres
|
||||
--
|
||||
|
||||
CREATE TABLE _SURVEY__TEMPLATE_.events_timed_labels (
|
||||
id integer NOT NULL,
|
||||
label text NOT NULL
|
||||
);
|
||||
|
||||
|
||||
ALTER TABLE _SURVEY__TEMPLATE_.events_timed_labels OWNER TO postgres;
|
||||
|
||||
--
|
||||
-- Name: TABLE events_timed_labels; Type: COMMENT; Schema: _SURVEY__TEMPLATE_; Owner: postgres
|
||||
--
|
||||
|
||||
COMMENT ON TABLE _SURVEY__TEMPLATE_.events_timed_labels IS 'Associates labels with events in events_timed.';
|
||||
|
||||
|
||||
--
|
||||
-- Name: file_data; Type: TABLE; Schema: _SURVEY__TEMPLATE_; Owner: postgres
|
||||
--
|
||||
@@ -1122,7 +1133,7 @@ CREATE INDEX events_timed_ts0_idx ON _SURVEY__TEMPLATE_.events_timed USING btree
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY _SURVEY__TEMPLATE_.events_seq_labels
|
||||
ADD CONSTRAINT events_seq_labels_id_fkey FOREIGN KEY (id) REFERENCES _SURVEY__TEMPLATE_.events_seq(id);
|
||||
ADD CONSTRAINT events_seq_labels_id_fkey FOREIGN KEY (id) REFERENCES _SURVEY__TEMPLATE_.events_seq(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user