]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#90] dhcp6_subnet_server table and indexes added
authorTomek Mrugalski <tomasz@isc.org>
Mon, 31 May 2021 13:33:34 +0000 (15:33 +0200)
committerTomek Mrugalski <tomek@isc.org>
Thu, 28 Oct 2021 10:31:40 +0000 (12:31 +0200)
src/share/database/scripts/pgsql/upgrade_6.2_to_7.0.sh.in

index b2f2952d77744c113e7f16e52e9bddcf3cec8d9b..3b99bfbfd9c14a6ec62b3717b8f99e6f29f83360 100644 (file)
@@ -261,6 +261,28 @@ CREATE INDEX key_dhcp6_server_modification_ts on dhcp6_server (modification_ts);
 CREATE TRIGGER dhcp6_server_modification_ts_update
   AFTER UPDATE ON dhcp6_server
   FOR EACH ROW EXECUTE PROCEDURE modification_ts_update();
+
+
+
+
+
+CREATE TABLE dhcp6_subnet_server (
+  subnet_id BIGINT NOT NULL,
+  server_id BIGINT NOT NULL,
+  modification_ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  PRIMARY KEY (subnet_id, server_id),
+  CONSTRAINT fk_dhcp6_subnet_server_server_id FOREIGN KEY (server_id) REFERENCES dhcp6_server (id),
+  CONSTRAINT fk_dhcp6_subnet_server_subnet_id FOREIGN KEY (subnet_id) REFERENCES dhcp6_subnet (subnet_id),
+  UNIQUE (subnet_id, server_id)
+);
+
+CREATE INDEX fk_dhcp6_subnet_server_server_id on dhcp6_subnet_server(server_id);
+CREATE INDEX key_dhcp6_subnet_server_modification_ts on dhcp6_subnet_server(modification_ts);
+CREATE TRIGGER dhcp6_subnet_server_modification_ts_update
+  AFTER UPDATE ON dhcp6_subnet_server
+  FOR EACH ROW EXECUTE PROCEDURE modification_ts_update();
+
+
 -- Update the schema version number
 UPDATE schema_version
     SET version = '7', minor = '0';