count=$(echo "${OUTPUT}" | grep -Fci reservation) || true
assert_eq 0 "${count}" "dhcp6_subnet has still reservation_mode column. (returned count %d, expected %d)"
+ # Schema upgrade from 9.5 to 9.6.
+
# table: dhcp4_shared_network new cache_threshold and cache_max_age columns
qry="select cache_threshold, cache_max_age from dhcp4_shared_network"
run_statement "dhcp4_shared_network" "$qry"
qry="select cache_threshold, cache_max_age from dhcp6_subnet"
run_statement "dhcp6_shared_network" "$qry"
- # Schema upgrade from 9.5 to 9.6.
-
qry='SELECT id FROM logs';
run_command \
mysql_execute "${qry}"
mysql_SCRIPTS += upgrade_9.2_to_9.3.sh
mysql_SCRIPTS += upgrade_9.3_to_9.4.sh
mysql_SCRIPTS += upgrade_9.4_to_9.5.sh
+mysql_SCRIPTS += upgrade_9.5_to_9.6.sh
mysql_SCRIPTS += wipe_data.sh
DISTCLEANFILES = ${mysql_SCRIPTS}
ALTER TABLE dhcp6_subnet DROP COLUMN reservation_mode;
ALTER TABLE dhcp6_shared_network DROP COLUMN reservation_mode;
+# Update the schema version number
+UPDATE schema_version
+SET version = '9', minor = '5';
+
+# This line concludes database upgrade to version 9.5.
+
# Add new lease cache parameters.
ALTER TABLE dhcp4_subnet
ADD COLUMN cache_threshold FLOAT DEFAULT NULL,
ADD COLUMN cache_threshold FLOAT DEFAULT NULL,
ADD COLUMN cache_max_age INT(10) DEFAULT NULL;
-# Update the schema version number
+# Update the schema version number.
UPDATE schema_version
-SET version = '9', minor = '5';
+ SET version = '9', minor = '6';
-# This line concludes database upgrade to version 9.5.
+# This line concludes database upgrade to version 9.6.
# Add an auto-increment ID as primary key to support Percona.
ALTER TABLE logs
# Enable audit in this session
SET @disable_audit = 0;
-# Add new lease cache parameters.
-ALTER TABLE dhcp4_subnet
- ADD COLUMN cache_threshold FLOAT DEFAULT NULL,
- ADD COLUMN cache_max_age INT(10) DEFAULT NULL;
-
-ALTER TABLE dhcp4_shared_network
- ADD COLUMN cache_threshold FLOAT DEFAULT NULL,
- ADD COLUMN cache_max_age INT(10) DEFAULT NULL;
-
-ALTER TABLE dhcp6_subnet
- ADD COLUMN cache_threshold FLOAT DEFAULT NULL,
- ADD COLUMN cache_max_age INT(10) DEFAULT NULL;
-
-ALTER TABLE dhcp6_shared_network
- ADD COLUMN cache_threshold FLOAT DEFAULT NULL,
- ADD COLUMN cache_max_age INT(10) DEFAULT NULL;
-
# Update the schema version number
UPDATE schema_version
SET version = '9', minor = '5';
#!/bin/sh
-# Copyright (C) 2020-2021 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2021 Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
fi
mysql "$@" <<EOF
+# Add new lease cache parameters.
+ALTER TABLE dhcp4_subnet
+ ADD COLUMN cache_threshold FLOAT DEFAULT NULL,
+ ADD COLUMN cache_max_age INT(10) DEFAULT NULL;
+
+ALTER TABLE dhcp4_shared_network
+ ADD COLUMN cache_threshold FLOAT DEFAULT NULL,
+ ADD COLUMN cache_max_age INT(10) DEFAULT NULL;
+
+ALTER TABLE dhcp6_subnet
+ ADD COLUMN cache_threshold FLOAT DEFAULT NULL,
+ ADD COLUMN cache_max_age INT(10) DEFAULT NULL;
+
+ALTER TABLE dhcp6_shared_network
+ ADD COLUMN cache_threshold FLOAT DEFAULT NULL,
+ ADD COLUMN cache_max_age INT(10) DEFAULT NULL;
+
# Add an auto-increment ID as primary key to support Percona.
ALTER TABLE logs
ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY;