Commit f7f545ae authored by Francis Dupont's avatar Francis Dupont
Browse files

[295-min-max-lease-time-configuration-options] Updated schema

parent 8d0f10e6
......@@ -689,6 +689,24 @@ EOF
qry="SELECT COUNT(*) FROM parameter_data_type";
run_statement "parameter_data_type count" "$qry" 4;
# New lifetime bounds.
# table: dhcp4_shared_network
qry="select id, name, client_class, interface, match_client_id, modification_ts, rebind_timer, relay, renew_timer, require_client_classes, reservation_mode, user_context, valid_lifetime, min_valid_lifetime, max_valid_lifetime, authoritative, calculate_tee_times, t1_percent, t2_percent, boot_file_name, next_server, server_hostname from dhcp4_shared_network"
run_statement "dhcp4_shared_network" "$qry"
# table: dhcp4_subnet
qry="select subnet_prefix, 4o6_interface, 4o6_interface_id, 4o6_subnet, boot_file_name, client_class, interface, match_client_id, modification_ts, next_server, rebind_timer, relay, renew_timer, require_client_classes, reservation_mode, server_hostname, shared_network_name, subnet_id, user_context, valid_lifetime, min_valid_lifetime, max_valid_lifetime, authoritative, calculate_tee_times, t1_percent, t2_percent from dhcp4_subnet"
run_statement "dhcp4_subnet" "$qry"
# table: dhcp6_shared_network
qry="select id, name, client_class, interface, modification_ts, preferred_lifetime, min_preferred_lifetime, max_preferred_lifetime,rapid_commit, rebind_timer, relay, renew_timer, require_client_classes, reservation_mode, user_context, valid_lifetime, min_valid_lifetime, max_valid_lifetime, calculate_tee_times, t1_percent, t2_percent from dhcp6_shared_network"
run_statement "dhcp6_shared_network" "$qry"
# table: dhcp6_subnet
qry="select subnet_prefix, client_class, interface, modification_ts, preferred_lifetime, min_preferred_lifetime, max_preferred_lifetime, rapid_commit, rebind_timer, relay, renew_timer, require_client_classes, reservation_mode, shared_network_name, subnet_id, user_context, valid_lifetime, min_valid_lifetime, max_valid_lifetime, calculate_tee_times, t1_percent, t2_percent from dhcp6_subnet"
run_statement "dhcp6_subnet" "$qry"
# Verify upgraded schema reports version 8.0
version=$(${keaadmin} lease-version mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir)
assert_str_eq "8.0" ${version} "Expected kea-admin to return %s, returned value was %s"
......
......@@ -2286,6 +2286,26 @@ CREATE TRIGGER dhcp6_options_ADEL AFTER DELETE ON dhcp6_options
END $$
DELIMITER ;
# Add lifetime bounds
ALTER TABLE dhcp4_shared_network
ADD COLUMN min_valid_lifetime INT(10) DEFAULT NULL,
ADD COLUMN max_valid_lifetime INT(10) DEFAULT NULL;
ALTER TABLE dhcp4_subnet
ADD COLUMN min_valid_lifetime INT(10) DEFAULT NULL,
ADD COLUMN max_valid_lifetime INT(10) DEFAULT NULL;
ALTER TABLE dhcp6_shared_network
ADD COLUMN min_preferred_lifetime INT(10) DEFAULT NULL,
ADD COLUMN max_preferred_lifetime INT(10) DEFAULT NULL,
ADD COLUMN min_valid_lifetime INT(10) DEFAULT NULL,
ADD COLUMN max_valid_lifetime INT(10) DEFAULT NULL;
ALTER TABLE dhcp6_subnet
ADD COLUMN min_preferred_lifetime INT(10) DEFAULT NULL,
ADD COLUMN max_preferred_lifetime INT(10) DEFAULT NULL,
ADD COLUMN min_valid_lifetime INT(10) DEFAULT NULL,
ADD COLUMN max_valid_lifetime INT(10) DEFAULT NULL;
# Update the schema version number
UPDATE schema_version
......
......@@ -969,6 +969,26 @@ CREATE TRIGGER dhcp6_options_ADEL AFTER DELETE ON dhcp6_options
END $$
DELIMITER ;
# Add lifetime bounds
ALTER TABLE dhcp4_shared_network
ADD COLUMN min_valid_lifetime INT(10) DEFAULT NULL,
ADD COLUMN max_valid_lifetime INT(10) DEFAULT NULL;
ALTER TABLE dhcp4_subnet
ADD COLUMN min_valid_lifetime INT(10) DEFAULT NULL,
ADD COLUMN max_valid_lifetime INT(10) DEFAULT NULL;
ALTER TABLE dhcp6_shared_network
ADD COLUMN min_preferred_lifetime INT(10) DEFAULT NULL,
ADD COLUMN max_preferred_lifetime INT(10) DEFAULT NULL,
ADD COLUMN min_valid_lifetime INT(10) DEFAULT NULL,
ADD COLUMN max_valid_lifetime INT(10) DEFAULT NULL;
ALTER TABLE dhcp6_subnet
ADD COLUMN min_preferred_lifetime INT(10) DEFAULT NULL,
ADD COLUMN max_preferred_lifetime INT(10) DEFAULT NULL,
ADD COLUMN min_valid_lifetime INT(10) DEFAULT NULL,
ADD COLUMN max_valid_lifetime INT(10) DEFAULT NULL;
# Update the schema version number
UPDATE schema_version
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment