From: Tomek Mrugalski Date: Mon, 31 May 2021 12:23:02 +0000 (+0200) Subject: [#90] Created dhcp6_pd_pool table, indexes, triggers, contraints X-Git-Tag: eng-drop-2021-11-10~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6183457734b67b93c85fd1e1cb0442707cf84bf2;p=thirdparty%2Fkea.git [#90] Created dhcp6_pd_pool table, indexes, triggers, contraints --- diff --git a/src/share/database/scripts/pgsql/upgrade_6.2_to_7.0.sh.in b/src/share/database/scripts/pgsql/upgrade_6.2_to_7.0.sh.in index 74eebad7e7..75dc9d2c97 100644 --- a/src/share/database/scripts/pgsql/upgrade_6.2_to_7.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_6.2_to_7.0.sh.in @@ -223,6 +223,29 @@ CREATE TRIGGER dhcp6_pool_modification_ts_update FOR EACH ROW EXECUTE PROCEDURE modification_ts_update(); +-- And now the same, but for PD pools. +CREATE TABLE dhcp6_pd_pool ( + id SERIAL PRIMARY KEY NOT NULL, + prefix varchar(45) NOT NULL, + prefix_length SMALLINT NOT NULL, + delegated_prefix_length SMALLINT NOT NULL, + subnet_id BIGINT NOT NULL, + modification_ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + excluded_prefix varchar(45) DEFAULT NULL, + excluded_prefix_length SMALLINT NOT NULL, + client_class varchar(128) DEFAULT NULL, + require_client_classes TEXT DEFAULT NULL, + user_context TEXT DEFAULT NULL, + CONSTRAINT fk_dhcp6_pd_pool_subnet_id FOREIGN KEY (subnet_id) REFERENCES dhcp6_subnet(subnet_id) +); + +CREATE INDEX key_dhcp6_pd_pool_modification_ts on dhcp6_pd_pool (modification_ts); +CREATE INDEX fk_dhcp6_pd_pool_subnet_id on dhcp6_pd_pool (subnet_id); +CREATE TRIGGER dhcp6_pd_pool_modification_ts_update + AFTER UPDATE ON dhcp6_pd_pool + FOR EACH ROW EXECUTE PROCEDURE modification_ts_update(); + + -- Update the schema version number UPDATE schema_version SET version = '7', minor = '0';