From 09d7578c25a6552fa6dc72ad2cd6f2e380890de1 Mon Sep 17 00:00:00 2001 From: Tomek Mrugalski Date: Tue, 8 Jun 2021 19:07:06 +0200 Subject: [PATCH] [#90] Added dhcp4_option_def_server --- .../database/scripts/pgsql/upgrade_6.2_to_7.0.sh.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 8d366daa4e..4589a2b464 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 @@ -602,6 +602,19 @@ CREATE TRIGGER dhcp4_option_def_modification_ts_update AFTER UPDATE ON dhcp4_option_def FOR EACH ROW EXECUTE PROCEDURE modification_ts_update(); + +-- and another table for storing relationship between option definitions and servers. +CREATE TABLE dhcp4_option_def_server ( + option_def_id BIGINT NOT NULL REFERENCES dhcp6_option_def (id) ON DELETE CASCADE ON UPDATE NO ACTION, + server_id BIGINT NOT NULL REFERENCES dhcp4_server (id) ON DELETE CASCADE ON UPDATE NO ACTION, + modification_ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (option_def_id, server_id) +); +CREATE TRIGGER dhcp4_option_def_server_modification_ts_update + AFTER UPDATE ON dhcp4_option_def_server + FOR EACH ROW EXECUTE PROCEDURE modification_ts_update(); + + -- Update the schema version number UPDATE schema_version SET version = '7', minor = '0';