From: Michael Tremer Date: Mon, 8 Dec 2025 14:14:40 +0000 (+0000) Subject: db: Don't export deleted lists/sources to DNS X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d3191007460417880fb4746e3a3151f4355a7cca;p=dbl.git db: Don't export deleted lists/sources to DNS Signed-off-by: Michael Tremer --- diff --git a/src/database.sql b/src/database.sql index 35b5ec0..172f563 100644 --- a/src/database.sql +++ b/src/database.sql @@ -2,7 +2,7 @@ -- PostgreSQL database dump -- -\restrict EcVPjzzaAxJjnzRDIpbc5yv5dhcWfScauYVZ8LFOgEDGgDejiH1MIE95SYJrtnU +\restrict ebDe037JaAShmh4Wj0bqo8KtmN1x40U4LDPgEduqxMDJPp7ElBRvkok5c3Cwr5B -- Dumped from database version 17.6 (Debian 17.6-0+deb13u1) -- Dumped by pg_dump version 17.6 (Debian 17.6-0+deb13u1) @@ -81,7 +81,8 @@ CREATE VIEW public.domains AS ''::text AS account, ''::text AS options, ''::text AS catalog - FROM public.lists; + FROM public.lists + WHERE (deleted_at IS NULL); -- @@ -185,18 +186,20 @@ CREATE VIEW public.records AS ''::text AS ordername, true AS auth FROM public.lists + WHERE (lists.deleted_at IS NULL) UNION ALL SELECT lists.id, (lists.slug || '.dnsbl.ipfire.org'::text), - 'NS'::text, + 'NS'::text AS text, (nameservers.name || '.'::text), nameservers.ttl, 0, false, - ''::text, + ''::text AS text, true FROM public.lists, public.nameservers + WHERE (lists.deleted_at IS NULL) UNION ALL SELECT lists.id AS domain_id, (((source_domains.name || '.'::text) || lists.slug) || '.dnsbl.ipfire.org'::text) AS name, @@ -210,7 +213,7 @@ CREATE VIEW public.records AS FROM ((public.source_domains LEFT JOIN public.sources ON ((source_domains.source_id = sources.id))) LEFT JOIN public.lists ON ((sources.list_id = lists.id))) - WHERE (source_domains.removed_at IS NULL) + WHERE ((lists.deleted_at IS NULL) AND (sources.deleted_at IS NULL) AND (source_domains.removed_at IS NULL)) ) SELECT row_number() OVER (ORDER BY name) AS id, domain_id, @@ -373,5 +376,5 @@ ALTER TABLE ONLY public.sources -- PostgreSQL database dump complete -- -\unrestrict EcVPjzzaAxJjnzRDIpbc5yv5dhcWfScauYVZ8LFOgEDGgDejiH1MIE95SYJrtnU +\unrestrict ebDe037JaAShmh4Wj0bqo8KtmN1x40U4LDPgEduqxMDJPp7ElBRvkok5c3Cwr5B