comparison schema/gemma.sql @ 4096:b65837b65479 historization_ng

Merged default
author Sascha Wilde <wilde@intevation.de>
date Thu, 25 Jul 2019 18:19:24 +0200
parents c1c6a375305f 15ab4e474f11
children 7711486efaba
comparison
equal deleted inserted replaced
4093:c1c6a375305f 4096:b65837b65479
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 with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP, 837 enqueued timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
838 due timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP, 838 due timestamp 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 with time zone NOT NULL DEFAULT now(), 861 time timestamp 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)