From cd989f9c3aff968e19a3aeabc4eb9085787a6673 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel.baumann@progress-linux.org>
Date: Sun, 28 Apr 2024 14:43:12 +0200
Subject: Adding upstream version 1.10.2.

Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
---
 schema/pgsql-legacy-changes/upgrade-9.sql | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 schema/pgsql-legacy-changes/upgrade-9.sql

(limited to 'schema/pgsql-legacy-changes/upgrade-9.sql')

diff --git a/schema/pgsql-legacy-changes/upgrade-9.sql b/schema/pgsql-legacy-changes/upgrade-9.sql
new file mode 100644
index 0000000..401a864
--- /dev/null
+++ b/schema/pgsql-legacy-changes/upgrade-9.sql
@@ -0,0 +1,20 @@
+CREATE TABLE icinga_zone_inheritance (
+  zone_id integer NOT NULL,
+  parent_zone_id integer NOT NULL,
+  weight integer DEFAULT NULL,
+  PRIMARY KEY (zone_id, parent_zone_id),
+  CONSTRAINT icinga_zone_inheritance_zone
+  FOREIGN KEY (zone_id)
+  REFERENCES icinga_zone (id)
+  ON DELETE CASCADE
+  ON UPDATE CASCADE,
+  CONSTRAINT icinga_zone_inheritance_parent_zone
+  FOREIGN KEY (parent_zone_id)
+  REFERENCES icinga_zone (id)
+  ON DELETE RESTRICT
+  ON UPDATE CASCADE
+);
+
+CREATE UNIQUE INDEX zone_inheritance_unique_order ON icinga_zone_inheritance (zone_id, weight);
+CREATE INDEX zone_inheritance_zone ON icinga_zone_inheritance (zone_id);
+CREATE INDEX zone_inheritance_zone_parent ON icinga_zone_inheritance (parent_zone_id);
-- 
cgit v1.2.3

