Skip to content
Snippets Groups Projects
Commit 65234ee3 authored by Aleš Friedl's avatar Aleš Friedl
Browse files

Merge branch '23-domain-blacklist-create-block-valid-from-default' into release/2.58

parents 29245a3d 63b1080d
No related branches found
Tags 2.59.2-rc1
No related merge requests found
......@@ -2,7 +2,7 @@ CREATE TABLE domain_blacklist
(
id serial NOT NULL, -- primary key
fqdn varchar(255) NOT NULL CONSTRAINT domain_blacklist_fqdn_lower_check CHECK(is_regex OR LOWER(fqdn) = fqdn), -- domain name or regular expression which is blocked
valid_from timestamp NOT NULL, -- from when bloc is valid
valid_from timestamp NOT NULL default CURRENT_TIMESTAMP, -- from when bloc is valid
valid_to timestamp, -- till when bloc is valid, if it is NULL, it isn't restricted
reason varchar(255) NOT NULL, -- reason why is domain blocked
is_regex boolean NOT NULL,
......
......@@ -20,6 +20,9 @@ ALTER TABLE domain_blacklist
ALTER TABLE domain_blacklist
ADD CONSTRAINT domain_blacklist_fqdn_lower_check CHECK(is_regex OR LOWER(fqdn) = fqdn);
ALTER TABLE domain_blacklist
ALTER COLUMN valid_from SET DEFAULT CURRENT_TIMESTAMP;
CREATE INDEX domain_blacklist_fqdn_idx ON domain_blacklist (fqdn) WHERE NOT is_regex;
COMMENT ON COLUMN domain_blacklist.fqdn IS 'domain name or regular expression which is blocked';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment