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 3374ecca52..3c5afb18cf 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 @@ -586,6 +586,23 @@ CREATE TRIGGER dhcp4_options_modification_ts_update +-- Now create a table for associating defined v4 options with servers. +CREATE TABLE dhcp4_options_server ( + option_id BIGINT NOT NULL, + server_id BIGINT NOT NULL, + modification_ts timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (option_id, server_id), + CONSTRAINT fk_dhcp4_options_server_option_id FOREIGN KEY (option_id) REFERENCES dhcp4_options (option_id) ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT fk_dhcp4_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(); + + + -- This table is for storing IPv4 option definitions CREATE TABLE dhcp4_option_def ( id SERIAL PRIMARY KEY UNIQUE NOT NULL,