]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[295-min-max-lease-time-configuration-options] Updated schema
authorFrancis Dupont <fdupont@isc.org>
Tue, 21 May 2019 09:16:22 +0000 (11:16 +0200)
committerFrancis Dupont <fdupont@isc.org>
Sat, 22 Jun 2019 14:05:23 +0000 (10:05 -0400)
src/bin/admin/tests/mysql_tests.sh.in
src/share/database/scripts/mysql/dhcpdb_create.mysql
src/share/database/scripts/mysql/upgrade_7.0_to_8.0.sh.in

index 48f14363a7be36764fc6e93c6cf916db95e7753d..da9cd85880bafff736abd1c332f9fcf490d2a873 100644 (file)
@@ -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"
index f39e4be2c2a3d0c424dde74f8e59255420a22045..7efb7f9213a5b8da74f2694d5d9ee0661f46b034 100644 (file)
@@ -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
index ec4f45acc0cd778c34d61c198226e96c122dd6ae..5049a85f5bf68d9ebe0300244df45293bcc65139 100644 (file)
@@ -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