comparison schema/gemma.sql @ 4082:419f28898db0

Added time zones to import queue tables.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 25 Jul 2019 16:45:07 +0200
parents b79b60c0cc5a
children c1c6a375305f 15ab4e474f11
comparison
equal deleted inserted replaced
4079:7fb75deff16b 4082:419f28898db0
824 824
825 CREATE TABLE imports ( 825 CREATE TABLE imports (
826 id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, 826 id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
827 state import_state NOT NULL DEFAULT 'queued', 827 state import_state NOT NULL DEFAULT 'queued',
828 kind varchar NOT NULL, 828 kind varchar NOT NULL,
829 enqueued timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 829 enqueued timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
830 due timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 830 due timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
831 retry_wait interval 831 retry_wait interval
832 CHECK(retry_wait IS NULL 832 CHECK(retry_wait IS NULL
833 OR retry_wait >= interval '0 microseconds'), 833 OR retry_wait >= interval '0 microseconds'),
834 trys_left int, -- if NULL and retry_wait NOT NULL, endless 834 trys_left int, -- if NULL and retry_wait NOT NULL, endless
835 username varchar NOT NULL 835 username varchar NOT NULL
848 CREATE INDEX enqueued_idx ON imports(enqueued, state) 848 CREATE INDEX enqueued_idx ON imports(enqueued, state)
849 849
850 CREATE TABLE import_logs ( 850 CREATE TABLE import_logs (
851 import_id int NOT NULL REFERENCES imports(id) 851 import_id int NOT NULL REFERENCES imports(id)
852 ON DELETE CASCADE, 852 ON DELETE CASCADE,
853 time timestamp NOT NULL DEFAULT now(), 853 time timestamp with time zone NOT NULL DEFAULT now(),
854 kind log_type NOT NULL DEFAULT 'info', 854 kind log_type NOT NULL DEFAULT 'info',
855 msg TEXT NOT NULL 855 msg TEXT NOT NULL
856 ) 856 )
857 857
858 CREATE INDEX kind_idx ON import_logs(kind) 858 CREATE INDEX kind_idx ON import_logs(kind)