Last active
October 16, 2023 10:38
-
-
Save thebapi/9c7b4c74b187140e1686551c166ad65d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Table: public.alarmlog | |
| -- DROP TABLE IF EXISTS public.alarmlog; | |
| CREATE TABLE IF NOT EXISTS public.alarmlog | |
| ( | |
| id_alarm_log bigserial NOT NULL, | |
| id_control_device bigint NOT NULL, | |
| asset_name character varying(50) COLLATE pg_catalog."default" NOT NULL, | |
| property_group_name character varying(50) COLLATE pg_catalog."default" NOT NULL, | |
| value double precision NOT NULL, | |
| unit character varying(5) COLLATE pg_catalog."default" NOT NULL, | |
| is_acknowledged boolean NOT NULL DEFAULT 'false', | |
| acknowledged_at double precision, | |
| alarm_activation_time double precision NOT NULL, | |
| incident_id bigint NOT NULL, | |
| type smallint NOT NULL, | |
| property character varying(50) COLLATE pg_catalog."default" NOT NULL, | |
| acknowledgement_link text COLLATE pg_catalog."default" NOT NULL, | |
| CONSTRAINT alarmlog_pkey PRIMARY KEY (id_alarm_log), | |
| CONSTRAINT alarm_log_control_device_fn FOREIGN KEY (id_control_device) | |
| REFERENCES public.controldevice (id_control_device) MATCH SIMPLE | |
| ON UPDATE NO ACTION | |
| ON DELETE NO ACTION | |
| ) | |
| TABLESPACE pg_default; | |
| ALTER TABLE IF EXISTS public.alarmlog | |
| OWNER to postgres; | |
| -- Index: alarm-log-uniq-index | |
| -- DROP INDEX IF EXISTS public."alarm-log-uniq-index"; | |
| CREATE UNIQUE INDEX IF NOT EXISTS "alarm-log-uniq-index" | |
| ON public.alarmlog USING btree | |
| (incident_id ASC NULLS LAST) | |
| TABLESPACE pg_default; | |
| -- Index: alarm_ack_time_index | |
| -- DROP INDEX IF EXISTS public.alarm_ack_time_index; | |
| CREATE INDEX IF NOT EXISTS alarm_ack_time_index | |
| ON public.alarmlog USING btree | |
| (is_acknowledged ASC NULLS LAST, alarm_activation_time ASC NULLS LAST) | |
| TABLESPACE pg_default; | |
| -- Index: fki_alarm_log_control_device_fn | |
| -- DROP INDEX IF EXISTS public.fki_alarm_log_control_device_fn; | |
| CREATE INDEX IF NOT EXISTS fki_alarm_log_control_device_fn | |
| ON public.alarmlog USING btree | |
| (id_control_device ASC NULLS LAST) | |
| TABLESPACE pg_default; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment