2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-29 13:07:50 +00:00

[#90] added dhcp4_options_server

This commit is contained in:
Tomek Mrugalski 2021-06-08 19:07:22 +02:00
parent 09d7578c25
commit 58625eeb85

View File

@ -615,6 +615,22 @@ CREATE TRIGGER dhcp4_option_def_server_modification_ts_update
FOR EACH ROW EXECUTE PROCEDURE modification_ts_update();
-- Now create a table for associating defined options with servers.
CREATE TABLE dhcp4_options_server (
option_id BIGINT NOT NULL,
server_id BIGINT NOT NULL,
modification_ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (option_id, server_id),
CONSTRAINT fk_dhcp6_options_server_option_id FOREIGN KEY (option_id) REFERENCES dhcp4_options (option_id) ON DELETE CASCADE ON UPDATE NO ACTION,
CONSTRAINT fk_dhcp6_options_server_server_id FOREIGN KEY (server_id) REFERENCES dhcp4_server (id) ON DELETE CASCADE ON UPDATE NO ACTION
);
CREATE INDEX dhcp4_options_server_idx1 on dhcp4_options_server(server_id);
CREATE INDEX dhcp4_options_server_idx2 on dhcp4_options_server(modification_ts);
CREATE TRIGGER dhcp4_options_server_modification_ts_update
AFTER UPDATE ON dhcp4_options_server
FOR EACH ROW EXECUTE PROCEDURE modification_ts_update();
-- Update the schema version number
UPDATE schema_version
SET version = '7', minor = '0';