2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-03 23:45:27 +00:00

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

This commit is contained in:
Francis Dupont
2019-05-21 11:16:22 +02:00
parent 8d0f10e6fd
commit f7f545aedb
3 changed files with 58 additions and 0 deletions

View File

@@ -689,6 +689,24 @@ EOF
qry="SELECT COUNT(*) FROM parameter_data_type"; qry="SELECT COUNT(*) FROM parameter_data_type";
run_statement "parameter_data_type count" "$qry" 4; 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 # 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) 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" assert_str_eq "8.0" ${version} "Expected kea-admin to return %s, returned value was %s"

View File

@@ -2286,6 +2286,26 @@ CREATE TRIGGER dhcp6_options_ADEL AFTER DELETE ON dhcp6_options
END $$ END $$
DELIMITER ; 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 the schema version number
UPDATE schema_version UPDATE schema_version

View File

@@ -969,6 +969,26 @@ CREATE TRIGGER dhcp6_options_ADEL AFTER DELETE ON dhcp6_options
END $$ END $$
DELIMITER ; 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 the schema version number
UPDATE schema_version UPDATE schema_version