From bc58a552b1be29d0f11d6856da60282034339e96 Mon Sep 17 00:00:00 2001
From: Guilhem Moulin <guilhem@fripost.org>
Date: Wed, 19 Jun 2024 01:55:08 +0200
Subject: Add logic to replace field value literals.

And set them to NULL.
---
 schema.sql | 50 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 49 insertions(+), 1 deletion(-)

(limited to 'schema.sql')

diff --git a/schema.sql b/schema.sql
index b1ab6ad..07bda74 100644
--- a/schema.sql
+++ b/schema.sql
@@ -591,7 +591,7 @@ ALTER SEQUENCE postgis."sks:AvverkAnm_ogc_fid_seq" OWNED BY postgis."sks:AvverkA
 CREATE TABLE postgis."sks:UtfordAvverk" (
     ogc_fid bigint NOT NULL,
     "OBJECTID" integer NOT NULL,
-    "Beteckn" character(12) NOT NULL,
+    "Beteckn" character(12),
     "ArendeAr" smallint NOT NULL,
     "Avverktyp" character varying(254) NOT NULL,
     "Skogstyp" character varying(254) NOT NULL,
@@ -794,6 +794,14 @@ ALTER TABLE ONLY postgis."mrr:bearbetningskoncessioner_applied"
     ADD CONSTRAINT "mrr:bearbetningskoncessioner_applied_pkey" PRIMARY KEY (ogc_fid);
 
 
+--
+-- Name: mrr:bearbetningskoncessioner_approved mrr:bearbetningskoncessioner_approved_DiaryNr_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."mrr:bearbetningskoncessioner_approved"
+    ADD CONSTRAINT "mrr:bearbetningskoncessioner_approved_DiaryNr_key" UNIQUE ("DiaryNr");
+
+
 --
 -- Name: mrr:bearbetningskoncessioner_approved mrr:bearbetningskoncessioner_approved_Name_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
 --
@@ -810,6 +818,14 @@ ALTER TABLE ONLY postgis."mrr:bearbetningskoncessioner_approved"
     ADD CONSTRAINT "mrr:bearbetningskoncessioner_approved_pkey" PRIMARY KEY (ogc_fid);
 
 
+--
+-- Name: mrr:markanvisningar mrr:markanvisningar_DiaryNr_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."mrr:markanvisningar"
+    ADD CONSTRAINT "mrr:markanvisningar_DiaryNr_key" UNIQUE ("DiaryNr");
+
+
 --
 -- Name: mrr:markanvisningar mrr:markanvisningar_pkey; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
 --
@@ -842,6 +858,14 @@ ALTER TABLE ONLY postgis."mrr:mineral_applied"
     ADD CONSTRAINT "mrr:mineral_applied_pkey" PRIMARY KEY (ogc_fid);
 
 
+--
+-- Name: mrr:mineral_approved mrr:mineral_approved_DiaryNr_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."mrr:mineral_approved"
+    ADD CONSTRAINT "mrr:mineral_approved_DiaryNr_key" UNIQUE ("DiaryNr");
+
+
 --
 -- Name: mrr:mineral_approved mrr:mineral_approved_LicenceID_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
 --
@@ -890,6 +914,14 @@ ALTER TABLE ONLY postgis."mrr:olja_gas_diamant_applied"
     ADD CONSTRAINT "mrr:olja_gas_diamant_applied_pkey" PRIMARY KEY (ogc_fid);
 
 
+--
+-- Name: mrr:olja_gas_diamant_approved mrr:olja_gas_diamant_approved_DiaryNr_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."mrr:olja_gas_diamant_approved"
+    ADD CONSTRAINT "mrr:olja_gas_diamant_approved_DiaryNr_key" UNIQUE ("DiaryNr");
+
+
 --
 -- Name: mrr:olja_gas_diamant_approved mrr:olja_gas_diamant_approved_LicenceID_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
 --
@@ -914,6 +946,14 @@ ALTER TABLE ONLY postgis."mrr:olja_gas_diamant_approved"
     ADD CONSTRAINT "mrr:olja_gas_diamant_approved_pkey" PRIMARY KEY (ogc_fid);
 
 
+--
+-- Name: mrr:torvkoncessioner mrr:torvkoncessioner_DiaryNr_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."mrr:torvkoncessioner"
+    ADD CONSTRAINT "mrr:torvkoncessioner_DiaryNr_key" UNIQUE ("DiaryNr");
+
+
 --
 -- Name: mrr:torvkoncessioner mrr:torvkoncessioner_Name_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
 --
@@ -954,6 +994,14 @@ ALTER TABLE ONLY postgis."sks:AvverkAnm"
     ADD CONSTRAINT "sks:AvverkAnm_pkey" PRIMARY KEY (ogc_fid);
 
 
+--
+-- Name: sks:UtfordAvverk sks:UtfordAvverk_Beteckn_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
+--
+
+ALTER TABLE ONLY postgis."sks:UtfordAvverk"
+    ADD CONSTRAINT "sks:UtfordAvverk_Beteckn_key" UNIQUE ("Beteckn");
+
+
 --
 -- Name: sks:UtfordAvverk sks:UtfordAvverk_OBJECTID_key; Type: CONSTRAINT; Schema: postgis; Owner: webmap_import
 --
-- 
cgit v1.2.3

