2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 05:27:55 +00:00

[#90] dhcp6_subnet_server table and indexes added

This commit is contained in:
Tomek Mrugalski 2021-05-31 15:33:34 +02:00 committed by Tomek Mrugalski
parent d8bfca33c7
commit 036b1acaf0

View File

@ -261,6 +261,28 @@ CREATE INDEX key_dhcp6_server_modification_ts on dhcp6_server (modification_ts);
CREATE TRIGGER dhcp6_server_modification_ts_update CREATE TRIGGER dhcp6_server_modification_ts_update
AFTER UPDATE ON dhcp6_server AFTER UPDATE ON dhcp6_server
FOR EACH ROW EXECUTE PROCEDURE modification_ts_update(); 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 the schema version number
UPDATE schema_version UPDATE schema_version
SET version = '7', minor = '0'; SET version = '7', minor = '0';