-- Table: public.detections_plates_allowed_historical

-- DROP TABLE public.detections_plates_allowed_historical;

CREATE TABLE public.detections_plates_allowed_historical
(
    insertiontimestamp bigint NOT NULL,
    detectiontimestamp bigint NOT NULL,
    tickettimetoleave bigint,
    timetoleavereal bigint,
    parking text COLLATE pg_catalog."default",
    manual boolean,
    location text COLLATE pg_catalog."default" NOT NULL,
    detectionplate text COLLATE pg_catalog."default" NOT NULL,
    detectionlane integer NOT NULL,
    detectioncountry text COLLATE pg_catalog."default",
    ticketabsolutenumber bigint,
    ticketrelativenumber bigint,
    tickettimestamp bigint,
    length double precision,
    priority boolean,
    value jsonb,
    CONSTRAINT detections_plates_allowed_historical_pkey1 PRIMARY KEY (detectiontimestamp, location, detectionplate)
        USING INDEX TABLESPACE artichistorical
)
WITH (
    OIDS = FALSE
)
TABLESPACE artichistorical;

ALTER TABLE public.detections_plates_allowed_historical
    OWNER to aluvisa;

-- Index: detectiontimestampallowhistn

-- DROP INDEX public.detectiontimestampallowhistn;

CREATE INDEX detectiontimestampallowhistn
    ON public.detections_plates_allowed_historical USING btree
    (detectiontimestamp)
    TABLESPACE artichistorical;

-- Index: insertiontimestampallowhistn

-- DROP INDEX public.insertiontimestampallowhistn;

CREATE INDEX insertiontimestampallowhistn
    ON public.detections_plates_allowed_historical USING btree
    (insertiontimestamp)
    TABLESPACE artichistorical;

-- Index: manualallowedhistn

-- DROP INDEX public.manualallowedhistn;

CREATE INDEX manualallowedhistn
    ON public.detections_plates_allowed_historical USING btree
    (manual)
    TABLESPACE artichistorical;

-- Index: parkingallowedhistn

-- DROP INDEX public.parkingallowedhistn;

CREATE INDEX parkingallowedhistn
    ON public.detections_plates_allowed_historical USING btree
    (parking COLLATE pg_catalog."default")
    TABLESPACE artichistorical;

-- Index: tickettimetoleaveallowhistn

-- DROP INDEX public.tickettimetoleaveallowhistn;

CREATE INDEX tickettimetoleaveallowhistn
    ON public.detections_plates_allowed_historical USING btree
    (tickettimetoleave)
    TABLESPACE artichistorical;

-- Index: timetoleaverealallowhistn

-- DROP INDEX public.timetoleaverealallowhistn;

CREATE INDEX timetoleaverealallowhistn
    ON public.detections_plates_allowed_historical USING btree
    (timetoleavereal)
    TABLESPACE artichistorical;
	
	
	
	-- Table: public.detections_plates_border_historical

-- DROP TABLE public.detections_plates_border_historical;

CREATE TABLE public.detections_plates_border_historical
(
    insertiontimestamp bigint NOT NULL,
    detectiontimestamp bigint NOT NULL,
    tickettimetoleave bigint,
    timetoleavereal bigint,
    timestampexit bigint,
    timestampbarrier1 bigint,
    timestampbarrier2 bigint,
    parking text COLLATE pg_catalog."default",
    manual boolean,
    accessmethodbarrier2 integer,
    location text COLLATE pg_catalog."default" NOT NULL,
    detectionplate text COLLATE pg_catalog."default" NOT NULL,
    detectionlane integer NOT NULL,
    detectioncountry text COLLATE pg_catalog."default",
    ticketabsolutenumber bigint,
    ticketrelativenumber bigint,
    tickettimestamp bigint,
    length double precision,
    priority boolean,
    value jsonb,
    CONSTRAINT detections_plates_border_historical_pkey1 PRIMARY KEY (detectiontimestamp, location, detectionplate)
        USING INDEX TABLESPACE artichistorical
)
WITH (
    OIDS = FALSE
)
TABLESPACE artichistorical;

ALTER TABLE public.detections_plates_border_historical
    OWNER to aluvisa;

-- Index: accessbarrier2bordhistn

-- DROP INDEX public.accessbarrier2bordhistn;

CREATE INDEX accessbarrier2bordhistn
    ON public.detections_plates_border_historical USING btree
    (accessmethodbarrier2)
    TABLESPACE artichistorical;

-- Index: detectiontimestampbordhistn

-- DROP INDEX public.detectiontimestampbordhistn;

CREATE INDEX detectiontimestampbordhistn
    ON public.detections_plates_border_historical USING btree
    (detectiontimestamp)
    TABLESPACE artichistorical;

-- Index: insertiontimestampbordhistn

-- DROP INDEX public.insertiontimestampbordhistn;

CREATE INDEX insertiontimestampbordhistn
    ON public.detections_plates_border_historical USING btree
    (insertiontimestamp)
    TABLESPACE artichistorical;

-- Index: manualbordhistn

-- DROP INDEX public.manualbordhistn;

CREATE INDEX manualbordhistn
    ON public.detections_plates_border_historical USING btree
    (manual)
    TABLESPACE artichistorical;

-- Index: parkingbordhistn

-- DROP INDEX public.parkingbordhistn;

CREATE INDEX parkingbordhistn
    ON public.detections_plates_border_historical USING btree
    (parking COLLATE pg_catalog."default")
    TABLESPACE artichistorical;

-- Index: tickettimetoleavebordhistn

-- DROP INDEX public.tickettimetoleavebordhistn;

CREATE INDEX tickettimetoleavebordhistn
    ON public.detections_plates_border_historical USING btree
    (tickettimetoleave)
    TABLESPACE artichistorical;

-- Index: timestampbarrier1bordhistn

-- DROP INDEX public.timestampbarrier1bordhistn;

CREATE INDEX timestampbarrier1bordhistn
    ON public.detections_plates_border_historical USING btree
    (timestampbarrier1)
    TABLESPACE artichistorical;

-- Index: timestampbarrier2bordhistn

-- DROP INDEX public.timestampbarrier2bordhistn;

CREATE INDEX timestampbarrier2bordhistn
    ON public.detections_plates_border_historical USING btree
    (timestampbarrier2)
    TABLESPACE artichistorical;

-- Index: timestampexitbordhistn

-- DROP INDEX public.timestampexitbordhistn;

CREATE INDEX timestampexitbordhistn
    ON public.detections_plates_border_historical USING btree
    (timestampexit)
    TABLESPACE artichistorical;

-- Index: timetoleaverealbordhistn

-- DROP INDEX public.timetoleaverealbordhistn;

CREATE INDEX timetoleaverealbordhistn
    ON public.detections_plates_border_historical USING btree
    (timetoleavereal)
    TABLESPACE artichistorical;
	
	
	
	
	-- Table: public.detections_plates_ended

-- DROP TABLE public.detections_plates_ended;

CREATE TABLE public.detections_plates_ended
(
    insertiontimestamp bigint NOT NULL,
    detectiontimestamp bigint NOT NULL,
    lost boolean,
    tickettimetoleave bigint,
    timetoleavereal bigint,
    timestampexit bigint,
    timestampbarrier1 bigint,
    timestampbarrier2 bigint,
    parking text COLLATE pg_catalog."default",
    manual boolean,
    accessmethodbarrier2 integer,
    location text COLLATE pg_catalog."default" NOT NULL,
    detectionplate text COLLATE pg_catalog."default" NOT NULL,
    detectionlane integer NOT NULL,
    detectioncountry text COLLATE pg_catalog."default",
    ticketabsolutenumber bigint,
    ticketrelativenumber bigint,
    tickettimestamp bigint,
    length double precision,
    priority boolean,
    value jsonb,
    CONSTRAINT detections_plates_ended_pkey1 PRIMARY KEY (detectiontimestamp, location, detectionplate)
        USING INDEX TABLESPACE artichistorical
)
WITH (
    OIDS = FALSE
)
TABLESPACE artichistorical;

ALTER TABLE public.detections_plates_ended
    OWNER to aluvisa;

-- Index: accessbarrier2endedn

-- DROP INDEX public.accessbarrier2endedn;

CREATE INDEX accessbarrier2endedn
    ON public.detections_plates_ended USING btree
    (accessmethodbarrier2)
    TABLESPACE artichistorical;

-- Index: detectiontimestampendedn

-- DROP INDEX public.detectiontimestampendedn;

CREATE INDEX detectiontimestampendedn
    ON public.detections_plates_ended USING btree
    (detectiontimestamp)
    TABLESPACE artichistorical;

-- Index: insertiontimestampendedn

-- DROP INDEX public.insertiontimestampendedn;

CREATE INDEX insertiontimestampendedn
    ON public.detections_plates_ended USING btree
    (insertiontimestamp)
    TABLESPACE artichistorical;

-- Index: lostendedn

-- DROP INDEX public.lostendedn;

CREATE INDEX lostendedn
    ON public.detections_plates_ended USING btree
    (lost)
    TABLESPACE artichistorical;

-- Index: manualendedn

-- DROP INDEX public.manualendedn;

CREATE INDEX manualendedn
    ON public.detections_plates_ended USING btree
    (manual)
    TABLESPACE artichistorical;

-- Index: parkingendedn

-- DROP INDEX public.parkingendedn;

CREATE INDEX parkingendedn
    ON public.detections_plates_ended USING btree
    (parking COLLATE pg_catalog."default")
    TABLESPACE artichistorical;

-- Index: tickettimetoleaveendedn

-- DROP INDEX public.tickettimetoleaveendedn;

CREATE INDEX tickettimetoleaveendedn
    ON public.detections_plates_ended USING btree
    (tickettimetoleave)
    TABLESPACE artichistorical;

-- Index: timestampbarrier1endedn

-- DROP INDEX public.timestampbarrier1endedn;

CREATE INDEX timestampbarrier1endedn
    ON public.detections_plates_ended USING btree
    (timestampbarrier1)
    TABLESPACE artichistorical;

-- Index: timestampbarrier2endedn

-- DROP INDEX public.timestampbarrier2endedn;

CREATE INDEX timestampbarrier2endedn
    ON public.detections_plates_ended USING btree
    (timestampbarrier2)
    TABLESPACE artichistorical;

-- Index: timestampexitendedn

-- DROP INDEX public.timestampexitendedn;

CREATE INDEX timestampexitendedn
    ON public.detections_plates_ended USING btree
    (timestampexit)
    TABLESPACE artichistorical;

-- Index: timetoleaverealendedn

-- DROP INDEX public.timetoleaverealendedn;

CREATE INDEX timetoleaverealendedn
    ON public.detections_plates_ended USING btree
    (timetoleavereal)
    TABLESPACE artichistorical;
	
	
	
	-- Table: public.detections_plates_parking_historical

-- DROP TABLE public.detections_plates_parking_historical;

CREATE TABLE public.detections_plates_parking_historical
(
    insertiontimestamp bigint NOT NULL,
    detectiontimestamp bigint NOT NULL,
    tickettimetoleave bigint,
    timetoleavereal bigint,
    parking text COLLATE pg_catalog."default",
    manual boolean,
    location text COLLATE pg_catalog."default" NOT NULL,
    detectionplate text COLLATE pg_catalog."default" NOT NULL,
    detectionlane integer NOT NULL,
    detectioncountry text COLLATE pg_catalog."default",
    ticketabsolutenumber bigint,
    ticketrelativenumber bigint,
    tickettimestamp bigint,
    length double precision,
    priority boolean,
    value jsonb,
    CONSTRAINT detections_plates_parking_historical_pkey1 PRIMARY KEY (detectiontimestamp, location, detectionplate)
        USING INDEX TABLESPACE artichistorical
)
WITH (
    OIDS = FALSE
)
TABLESPACE artichistorical;

ALTER TABLE public.detections_plates_parking_historical
    OWNER to aluvisa;

-- Index: detectiontimestampparkhistn

-- DROP INDEX public.detectiontimestampparkhistn;

CREATE INDEX detectiontimestampparkhistn
    ON public.detections_plates_parking_historical USING btree
    (detectiontimestamp)
    TABLESPACE artichistorical;

-- Index: insertiontimestampparkhistn

-- DROP INDEX public.insertiontimestampparkhistn;

CREATE INDEX insertiontimestampparkhistn
    ON public.detections_plates_parking_historical USING btree
    (insertiontimestamp)
    TABLESPACE artichistorical;

-- Index: manualparkhistn

-- DROP INDEX public.manualparkhistn;

CREATE INDEX manualparkhistn
    ON public.detections_plates_parking_historical USING btree
    (manual)
    TABLESPACE artichistorical;

-- Index: parkingparkhistn

-- DROP INDEX public.parkingparkhistn;

CREATE INDEX parkingparkhistn
    ON public.detections_plates_parking_historical USING btree
    (parking COLLATE pg_catalog."default")
    TABLESPACE artichistorical;

-- Index: tickettimetoleaveparkhistn

-- DROP INDEX public.tickettimetoleaveparkhistn;

CREATE INDEX tickettimetoleaveparkhistn
    ON public.detections_plates_parking_historical USING btree
    (tickettimetoleave)
    TABLESPACE artichistorical;

-- Index: timetoleaverealparkhistn

-- DROP INDEX public.timetoleaverealparkhistn;

CREATE INDEX timetoleaverealparkhistn
    ON public.detections_plates_parking_historical USING btree
    (timetoleavereal)
    TABLESPACE artichistorical;
	
	
	
	
	-- Table: public.detections_plates_transit_historical

-- DROP TABLE public.detections_plates_transit_historical;

CREATE TABLE public.detections_plates_transit_historical
(
    insertiontimestamp bigint NOT NULL,
    detectiontimestamp bigint NOT NULL,
    tickettimetoleave bigint,
    timetoleavereal bigint,
    timestampexit bigint,
    timestampbarrier1 bigint,
    timestampbarrier2 bigint,
    parking text COLLATE pg_catalog."default",
    manual boolean,
    accessmethodbarrier2 integer,
    location text COLLATE pg_catalog."default" NOT NULL,
    detectionplate text COLLATE pg_catalog."default" NOT NULL,
    detectionlane integer NOT NULL,
    detectioncountry text COLLATE pg_catalog."default",
    ticketabsolutenumber bigint,
    ticketrelativenumber bigint,
    tickettimestamp bigint,
    length double precision,
    priority boolean,
    value jsonb,
    CONSTRAINT detections_plates_transit_historical_pkey1 PRIMARY KEY (detectiontimestamp, location, detectionplate)
        USING INDEX TABLESPACE artichistorical
)
WITH (
    OIDS = FALSE
)
TABLESPACE artichistorical;

ALTER TABLE public.detections_plates_transit_historical
    OWNER to aluvisa;

-- Index: accessbarrier2tranhistn

-- DROP INDEX public.accessbarrier2tranhistn;

CREATE INDEX accessbarrier2tranhistn
    ON public.detections_plates_transit_historical USING btree
    (accessmethodbarrier2)
    TABLESPACE artichistorical;

-- Index: detectiontimestamptranhistn

-- DROP INDEX public.detectiontimestamptranhistn;

CREATE INDEX detectiontimestamptranhistn
    ON public.detections_plates_transit_historical USING btree
    (detectiontimestamp)
    TABLESPACE artichistorical;

-- Index: insertiontimestamptranhistn

-- DROP INDEX public.insertiontimestamptranhistn;

CREATE INDEX insertiontimestamptranhistn
    ON public.detections_plates_transit_historical USING btree
    (insertiontimestamp)
    TABLESPACE artichistorical;

-- Index: manualtranhistn

-- DROP INDEX public.manualtranhistn;

CREATE INDEX manualtranhistn
    ON public.detections_plates_transit_historical USING btree
    (manual)
    TABLESPACE artichistorical;

-- Index: parkingtranhistn

-- DROP INDEX public.parkingtranhistn;

CREATE INDEX parkingtranhistn
    ON public.detections_plates_transit_historical USING btree
    (parking COLLATE pg_catalog."default")
    TABLESPACE artichistorical;

-- Index: tickettimetoleavetranhistn

-- DROP INDEX public.tickettimetoleavetranhistn;

CREATE INDEX tickettimetoleavetranhistn
    ON public.detections_plates_transit_historical USING btree
    (tickettimetoleave)
    TABLESPACE artichistorical;

-- Index: timestampbarrier1tranhistn

-- DROP INDEX public.timestampbarrier1tranhistn;

CREATE INDEX timestampbarrier1tranhistn
    ON public.detections_plates_transit_historical USING btree
    (timestampbarrier1)
    TABLESPACE artichistorical;

-- Index: timestampbarrier2tranhistn

-- DROP INDEX public.timestampbarrier2tranhistn;

CREATE INDEX timestampbarrier2tranhistn
    ON public.detections_plates_transit_historical USING btree
    (timestampbarrier2)
    TABLESPACE artichistorical;

-- Index: timestampexittranhistn

-- DROP INDEX public.timestampexittranhistn;

CREATE INDEX timestampexittranhistn
    ON public.detections_plates_transit_historical USING btree
    (timestampexit)
    TABLESPACE artichistorical;

-- Index: timetoleaverealtranhistn

-- DROP INDEX public.timetoleaverealtranhistn;

CREATE INDEX timetoleaverealtranhistn
    ON public.detections_plates_transit_historical USING btree
    (timetoleavereal)
    TABLESPACE artichistorical;
	
	
	
