Commit fbe7a9e6 authored by dietricf's avatar dietricf
Browse files

SI-161 Count in DB hinzugefügt

parent 6c42c004
......@@ -304,7 +304,25 @@ CREATE TABLE public.TBL_FAILURE_INFORMATION
CREATE_USER character varying(100) NOT NULL,
MOD_DATE timestamp without time zone NOT NULL,
MOD_USER character varying(100),
CONSTRAINT TBL_FAILURE_INFORMATION_PKEY PRIMARY KEY (id)
CONSTRAINT TBL_FAILURE_INFORMATION_PKEY PRIMARY KEY (id),
CONSTRAINT TBL_FAIL_INF__FCLASS_FKEY FOREIGN KEY (FK_REF_FAILURE_CLASSIFICATION)
REFERENCES public.REF_FAILURE_CLASSIFICATION (ID) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT TBL_FAIL_INF_FTYPE_FKEY FOREIGN KEY (FK_REF_FAILURE_TYPE)
REFERENCES public.REF_FAILURE_TYPE (ID) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT TBL_FAIL_INF_STATUSINT_FKEY FOREIGN KEY (FK_REF_STATUS_INTERN)
REFERENCES public.REF_STATUS (ID) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT TBL_FAIL_INF__STATUSEXT_FKEY FOREIGN KEY (FK_REF_STATUS_EXTERN)
REFERENCES public.REF_STATUS (ID) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT TBL_FAIL_INF__BRANCH_ID_FKEY FOREIGN KEY (FK_REF_BRANCH)
REFERENCES public.REF_BRANCH (ID) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT TBL_FAIL_INF__EXPREASON_FKEY FOREIGN KEY (FK_REF_EXPECTED_REASON)
REFERENCES public.REF_EXPECTED_REASON (ID) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
);
ALTER TABLE public.TBL_FAILURE_INFORMATION
......@@ -440,90 +458,107 @@ VALUES (1, '2020-03-13 00:00:00', 'SCRIPT', 1, '6432a9c9-0384-44af-9bb8-34f2878d
INSERT INTO public.htbl_failure_information(HACTION, HDATE, HUSER, ID, UUID, VERSION_NUMBER, FK_REF_FAILURE_CLASSIFICATION, FK_REF_FAILURE_TYPE, TITLE, DESCRIPTION, RESPONSIBILITY, INTERN_EXTERN, FK_REF_STATUS_INTERN, FK_REF_STATUS_EXTERN, FK_REF_BRANCH, VOLTAGE_LEVEL, PRESSURE_LEVEL, FAILURE_BEGIN, FAILURE_END_PLANNED, FAILURE_END_RESUPPLIED, INTERNAL_REMARK, POSTCODE, CITY, DISTRICT, STREET, HOUSENUMBER, STATION_ID, STATION_DESCRIPTION, STATION_COORDS, FK_REF_RADIUS, LONGITUDE, LATITUDE, OBJECT_REFERENCE_EXTERNAL_SYSTEM, PUBLICATION_STATUS, PUBLICATION_FREETEXT, FK_REF_EXPECTED_REASON, FK_TBL_FAILURE_INFORMATION_CONDENSED, CONDENSED, CONDENSED_COUNT, CREATE_DATE, CREATE_USER, MOD_DATE, MOD_USER)
VALUES (2, '2020-03-13 00:00:00', 'SCRIPT', 2, '37aef635-d0d4-4c47-ac25-c0d16c29e35c', 1, 2, 2, 'Gasleck Oldenburg', 'Es gibt ein Gasleck in Oldenburg', 'Bernd Britzel', 'E', 2, 2, 3, 'NS', 'HD', '2021-05-19 00:00:00', '2021-05-22 00:00:00', '2021-05-22 12:00:00', 'HD betroffen', '26133', 'Oldenburg', null, 'Cloppenburger Str.', '302', '1234863-b234', 'ertf', '124,2323', 4, 8.210150, 53.111820, 'Link - extenes System', 'nicht veröffentlicht', 'Freitext: Eine Gasleitung wurde beschädigt', 4, null, false, 0, '2020-02-03 15:15:15', 'SCRIPT', '2020-02-24 20:08:41', 'SCRIPT');
-- ----------------------------------------------------------------------------
-- ----------------------------------------------------------------------------
-- TRIGGER
-- Tables ADDRESSIMPORT
-- ----------------------------------------------------------------------------
-- ----------------------------------------------------------------------------
DROP TABLE IF EXISTS public.TBL_ADDRESS CASCADE;
DROP SEQUENCE IF EXISTS public.TBL_ADDRESS_ID_SEQ;
-- PUBLIC.HTBL_FAILURE_INFORMATION Automatic generanted History Table DDL --
-- <GENERATED CODE!>
DROP TABLE IF EXISTS PUBLIC.HTBL_FAILURE_INFORMATION;
DROP SEQUENCE IF EXISTS PUBLIC.HTBL_FAILURE_INFORMATION_ID_SEQ;
CREATE SEQUENCE PUBLIC.HTBL_FAILURE_INFORMATION_ID_SEQ
-- ---------------------------------------------
-- TABLE TBL_ADDRESS
-- ---------------------------------------------
CREATE SEQUENCE public.TBL_ADDRESS_ID_SEQ
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER TABLE public.TBL_ADDRESS_ID_SEQ
OWNER TO GFI_SERVICE;
ALTER TABLE PUBLIC.HTBL_FAILURE_INFORMATION_ID_SEQ
OWNER TO gfi_service;
CREATE TABLE PUBLIC.HTBL_FAILURE_INFORMATION
CREATE TABLE public.TBL_ADDRESS
(
HID integer NOT NULL DEFAULT nextval('HTBL_FAILURE_INFORMATION_ID_SEQ'::regclass),
HACTION integer NOT NULL,
HDATE timestamp without time zone NOT NULL,
HUSER character varying(100),
ID integer NOT NULL DEFAULT nextval('TBL_ADDRESS_ID_SEQ'::regclass),
UUID uuid NOT NULL,
SDOX1 numeric(9,2) NOT NULL,
SDOY1 numeric(10,2) NOT NULL,
G3EFID numeric,
POSTCODE character varying(30),
COMMUNITY character varying(255),
DISTRICT character varying(255),
STREET character varying(255),
HOUSENUMBER character varying(30),
WATER_CONNECTION boolean,
WATER_GROUP character varying(255),
GAS_CONNECTION boolean,
GAS_GROUP character varying(255),
POWER_CONNECTION boolean,
STATION_ID character varying(30),
LONGITUDE numeric(9,6),
LATITUDE numeric(9,6),
CONSTRAINT TBL_ADDRESS_PKEY PRIMARY KEY (id)
);
ID integer,
UUID uuid,
VERSION_NUMBER integer,
FK_REF_FAILURE_CLASSIFICATION integer,
FK_REF_FAILURE_TYPE integer,
TITLE character varying (255),
DESCRIPTION character varying (255),
RESPONSIBILITY character varying (255),
INTERN_EXTERN character varying (1),
FK_REF_STATUS_INTERN integer,
FK_REF_STATUS_EXTERN integer,
FK_REF_BRANCH integer,
VOLTAGE_LEVEL character varying (2),
PRESSURE_LEVEL character varying (2),
FAILURE_BEGIN timestamp without time zone,
FAILURE_END_PLANNED timestamp without time zone,
FAILURE_END_RESUPPLIED timestamp without time zone,
INTERNAL_REMARK character varying (1024),
POSTCODE character varying (30),
CITY character varying (255),
DISTRICT character varying (255),
STREET character varying (255),
HOUSENUMBER character varying (30),
STATION_ID character varying (30),
STATION_DESCRIPTION character varying (255),
STATION_COORDS character varying (255),
FK_REF_RADIUS integer,
LONGITUDE numeric,
LATITUDE numeric,
FK_TBL_FAILURE_INFORMATION_CONDENSED integer,
CONDENSED boolean,
OBJECT_REFERENCE_EXTERNAL_SYSTEM character varying (255),
PUBLICATION_STATUS character varying (40),
PUBLICATION_FREETEXT character varying (1024),
FK_REF_EXPECTED_REASON integer,
ALTER TABLE public.TBL_ADDRESS
OWNER TO GFI_SERVICE;
GRANT ALL ON TABLE public.TBL_ADDRESS TO GFI_SERVICE;
CREATE_USER character varying(100),
CREATE_DATE timestamp without time zone,
MOD_USER character varying(100),
MOD_DATE timestamp without time zone,
CONSTRAINT HTBL_FAILURE_INFORMATION_PKEY PRIMARY KEY (HID)
)
WITH (
OIDS=FALSE
);
CREATE INDEX idx_tbl_address_g3efid ON public.TBL_ADDRESS ( G3EFID );
CREATE INDEX idx_tbl_address_postcode ON public.TBL_ADDRESS ( POSTCODE );
CREATE INDEX idx_tbl_address_community ON public.TBL_ADDRESS ( COMMUNITY );
CREATE INDEX idx_tbl_address_district ON public.TBL_ADDRESS ( DISTRICT );
CREATE INDEX idx_tbl_address_street ON public.TBL_ADDRESS ( STREET );
ALTER TABLE PUBLIC.HTBL_FAILURE_INFORMATION
OWNER TO gfi_service;
GRANT ALL ON TABLE PUBLIC.HTBL_FAILURE_INFORMATION TO gfi_service;
-- ---------------------------------------------
-- TABLE TBL_STATION
-- ---------------------------------------------
DROP TABLE IF EXISTS public.TBL_STATION CASCADE;
DROP SEQUENCE IF EXISTS public.TBL_STATION_ID_SEQ;
CREATE SEQUENCE public.TBL_STATION_ID_SEQ
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER TABLE public.TBL_STATION_ID_SEQ
OWNER TO GFI_SERVICE;
CREATE TABLE public.TBL_STATION
(
ID integer NOT NULL DEFAULT nextval('TBL_STATION_ID_SEQ'::regclass),
UUID uuid NOT NULL,
SDOX1 numeric(9,2) NOT NULL,
SDOY1 numeric(10,2) NOT NULL,
G3EFID numeric,
STATION_ID character varying(30),
STATION_NAME character varying(255),
LONGITUDE numeric(9,6),
LATITUDE numeric(9,6),
CONSTRAINT TBL_STATION_PKEY PRIMARY KEY (id)
);
ALTER TABLE public.TBL_STATION
OWNER TO GFI_SERVICE;
GRANT ALL ON TABLE public.TBL_STATION TO GFI_SERVICE;
CREATE INDEX idx_tbl_station_g3efid ON public.TBL_STATION ( G3EFID );
CREATE INDEX idx_tbl_station_postcode ON public.TBL_ADDRESS ( POSTCODE );
CREATE INDEX idx_tbl_station_community ON public.TBL_ADDRESS ( COMMUNITY );
CREATE INDEX idx_tbl_station_district ON public.TBL_ADDRESS ( DISTRICT );
CREATE INDEX idx_tbl_station_street ON public.TBL_ADDRESS ( STREET );
-- ----------------------------------------------------------------------------
-- ----------------------------------------------------------------------------
-- TRIGGER
-- ----------------------------------------------------------------------------
-- ----------------------------------------------------------------------------
-- PUBLIC.TBL_FAILURE_INFORMATION INSERT TRIGGER --
......@@ -645,5 +680,3 @@ CREATE TRIGGER TBL_FAILURE_INFORMATION_DELETE_TRG
FOR EACH ROW
EXECUTE PROCEDURE PUBLIC.TBL_FAILURE_INFORMATION_DELETE_TRG();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment