]> git.ipfire.org Git - dbl.git/commitdiff
db: Drop the PowerDNS views
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Dec 2025 17:01:23 +0000 (17:01 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Dec 2025 17:05:00 +0000 (17:05 +0000)
Although this worked really well, we cannot create ZONEMD records and
catalog zones and anything else that needs to store data is becoming
very difficult to manage.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/database.sql

index 172f5632b742035f2560ee987a6b580486a52aff..9c39018fd6c7cd5beed4059fd0a28b290a6b79dd 100644 (file)
@@ -2,7 +2,7 @@
 -- PostgreSQL database dump
 --
 
-\restrict ebDe037JaAShmh4Wj0bqo8KtmN1x40U4LDPgEduqxMDJPp7ElBRvkok5c3Cwr5B
+\restrict uoDsydSaI5FPlrxacSe4GcAWBxa12RWCgmwmzOXlefNHtJ99eaarw0pTVxjYoSs
 
 -- Dumped from database version 17.6 (Debian 17.6-0+deb13u1)
 -- Dumped by pg_dump version 17.6 (Debian 17.6-0+deb13u1)
@@ -19,32 +19,6 @@ SET xmloption = content;
 SET client_min_messages = warning;
 SET row_security = off;
 
---
--- Name: cryptokeys; Type: VIEW; Schema: public; Owner: -
---
-
-CREATE VIEW public.cryptokeys AS
- SELECT NULL::integer AS id,
-    NULL::integer AS domain_id,
-    NULL::integer AS flags,
-    NULL::boolean AS active,
-    NULL::boolean AS published,
-    NULL::text AS content
-  WHERE false;
-
-
---
--- Name: domainmetadata; Type: VIEW; Schema: public; Owner: -
---
-
-CREATE VIEW public.domainmetadata AS
- SELECT NULL::integer AS id,
-    NULL::integer AS domain_id,
-    NULL::text AS kind,
-    NULL::text AS content
-  WHERE false;
-
-
 SET default_tablespace = '';
 
 SET default_table_access_method = heap;
@@ -62,29 +36,10 @@ CREATE TABLE public.lists (
     deleted_at timestamp with time zone,
     deleted_by text,
     license text NOT NULL,
-    updated_at timestamp with time zone,
-    notified_serial integer
+    updated_at timestamp with time zone
 );
 
 
---
--- Name: domains; Type: VIEW; Schema: public; Owner: -
---
-
-CREATE VIEW public.domains AS
- SELECT id,
-    (slug || '.dnsbl.ipfire.org'::text) AS name,
-    ''::text AS master,
-    0 AS last_check,
-    'MASTER'::text AS type,
-    notified_serial,
-    ''::text AS account,
-    ''::text AS options,
-    ''::text AS catalog
-   FROM public.lists
-  WHERE (deleted_at IS NULL);
-
-
 --
 -- Name: lists_id_seq; Type: SEQUENCE; Schema: public; Owner: -
 --
@@ -150,84 +105,6 @@ CREATE TABLE public.source_domains (
 );
 
 
---
--- Name: sources; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.sources (
-    id integer NOT NULL,
-    name text NOT NULL,
-    url text NOT NULL,
-    created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
-    created_by text NOT NULL,
-    deleted_at timestamp with time zone,
-    deleted_by text,
-    license text NOT NULL,
-    list_id integer,
-    last_modified_at timestamp with time zone,
-    etag text,
-    updated_at timestamp with time zone
-);
-
-
---
--- Name: records; Type: VIEW; Schema: public; Owner: -
---
-
-CREATE VIEW public.records AS
- WITH records AS (
-         SELECT lists.id AS domain_id,
-            (lists.slug || '.dnsbl.ipfire.org'::text) AS name,
-            'SOA'::text AS type,
-            concat('master.lwldns.net. hostmaster.ipfire.org. ', (EXTRACT(epoch FROM COALESCE(lists.updated_at, CURRENT_TIMESTAMP)))::integer, ' 3600 600 3600000 60') AS content,
-            60 AS ttl,
-            0 AS prio,
-            false AS disabled,
-            ''::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 AS text,
-            (nameservers.name || '.'::text),
-            nameservers.ttl,
-            0,
-            false,
-            ''::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,
-            'CNAME'::text AS type,
-            '.'::text AS content,
-            60 AS ttl,
-            0 AS prio,
-            false AS disabled,
-            ''::text AS ordername,
-            true AS auth
-           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 ((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,
-    name,
-    type,
-    content,
-    ttl,
-    prio,
-    disabled,
-    ordername,
-    auth
-   FROM records;
-
-
 --
 -- Name: source_domains_id_seq; Type: SEQUENCE; Schema: public; Owner: -
 --
@@ -248,6 +125,26 @@ CREATE SEQUENCE public.source_domains_id_seq
 ALTER SEQUENCE public.source_domains_id_seq OWNED BY public.source_domains.id;
 
 
+--
+-- Name: sources; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.sources (
+    id integer NOT NULL,
+    name text NOT NULL,
+    url text NOT NULL,
+    created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
+    created_by text NOT NULL,
+    deleted_at timestamp with time zone,
+    deleted_by text,
+    license text NOT NULL,
+    list_id integer,
+    last_modified_at timestamp with time zone,
+    etag text,
+    updated_at timestamp with time zone
+);
+
+
 --
 -- Name: sources_id_seq; Type: SEQUENCE; Schema: public; Owner: -
 --
@@ -376,5 +273,5 @@ ALTER TABLE ONLY public.sources
 -- PostgreSQL database dump complete
 --
 
-\unrestrict ebDe037JaAShmh4Wj0bqo8KtmN1x40U4LDPgEduqxMDJPp7ElBRvkok5c3Cwr5B
+\unrestrict uoDsydSaI5FPlrxacSe4GcAWBxa12RWCgmwmzOXlefNHtJ99eaarw0pTVxjYoSs