From 40e66830d40ddd38f32c750d5341e9bec0b3c1d8 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 2 Aug 2017 14:54:19 +0200 Subject: [PATCH] Nacharbeiten --- db/create-pdns-db-postgresql.sql | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/db/create-pdns-db-postgresql.sql b/db/create-pdns-db-postgresql.sql index 9aa626a..1aa40b6 100644 --- a/db/create-pdns-db-postgresql.sql +++ b/db/create-pdns-db-postgresql.sql @@ -169,3 +169,25 @@ ALTER SEQUENCE IF EXISTS tsigkeys_id_seq OWNER TO pdns; COMMIT; + +-- Enabling automatic SOA serial update after importing all data + +BEGIN; + +INSERT INTO domainmetadata (domain_id, kind, content) + SELECT id, 'SOA-EDIT', 'INCEPTION-INCREMENT' + FROM domains + WHERE id NOT IN ( + SELECT domain_id + FROM domainmetadata + WHERE kind = 'SOA-EDIT'); + +INSERT INTO domainmetadata (domain_id, kind, content) + SELECT id, 'SOA-EDIT-API', 'INCEPTION-INCREMENT' + FROM domains + WHERE id NOT IN ( + SELECT domain_id + FROM domainmetadata + WHERE kind = 'SOA-EDIT-API'); + +COMMIT; -- 2.39.5