comparison schema/gemma.sql @ 4093:c1c6a375305f historization_ng

Merged default
author Sascha Wilde <wilde@intevation.de>
date Thu, 25 Jul 2019 17:39:40 +0200
parents 4332b9e26e2f 419f28898db0
children b65837b65479
comparison
equal deleted inserted replaced
4092:30a567b1cc2e 4093:c1c6a375305f
832 832
833 CREATE TABLE imports ( 833 CREATE TABLE imports (
834 id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, 834 id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
835 state import_state NOT NULL DEFAULT 'queued', 835 state import_state NOT NULL DEFAULT 'queued',
836 kind varchar NOT NULL, 836 kind varchar NOT NULL,
837 enqueued timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 837 enqueued timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
838 due timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 838 due timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
839 retry_wait interval 839 retry_wait interval
840 CHECK(retry_wait IS NULL 840 CHECK(retry_wait IS NULL
841 OR retry_wait >= interval '0 microseconds'), 841 OR retry_wait >= interval '0 microseconds'),
842 trys_left int, -- if NULL and retry_wait NOT NULL, endless 842 trys_left int, -- if NULL and retry_wait NOT NULL, endless
843 username varchar NOT NULL 843 username varchar NOT NULL
856 CREATE INDEX enqueued_idx ON imports(enqueued, state) 856 CREATE INDEX enqueued_idx ON imports(enqueued, state)
857 857
858 CREATE TABLE import_logs ( 858 CREATE TABLE import_logs (
859 import_id int NOT NULL REFERENCES imports(id) 859 import_id int NOT NULL REFERENCES imports(id)
860 ON DELETE CASCADE, 860 ON DELETE CASCADE,
861 time timestamp NOT NULL DEFAULT now(), 861 time timestamp with time zone NOT NULL DEFAULT now(),
862 kind log_type NOT NULL DEFAULT 'info', 862 kind log_type NOT NULL DEFAULT 'info',
863 msg TEXT NOT NULL 863 msg TEXT NOT NULL
864 ) 864 )
865 865
866 CREATE INDEX kind_idx ON import_logs(kind) 866 CREATE INDEX kind_idx ON import_logs(kind)