]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2786] addressed comments
authorRazvan Becheriu <razvan@isc.org>
Tue, 9 May 2023 08:53:31 +0000 (11:53 +0300)
committerRazvan Becheriu <razvan@isc.org>
Tue, 9 May 2023 11:26:04 +0000 (14:26 +0300)
62 files changed:
src/bin/admin/tests/mysql_tests.sh.in
src/bin/admin/tests/pgsql_tests.sh.in
src/bin/dhcp4/client_handler.cc
src/bin/dhcp4/tests/decline_unittest.cc
src/bin/dhcp6/tests/decline_unittest.cc
src/lib/dhcp/duid.h
src/lib/dhcp/pkt4.cc
src/lib/dhcp_ddns/tests/ncr_unittests.cc
src/lib/mysql/mysql_constants.h
src/lib/pgsql/pgsql_connection.h
src/share/database/scripts/mysql/dhcpdb_create.mysql
src/share/database/scripts/mysql/upgrade_001.0_to_002.0.sh.in
src/share/database/scripts/mysql/upgrade_002.0_to_003.0.sh.in
src/share/database/scripts/mysql/upgrade_003.0_to_004.0.sh.in
src/share/database/scripts/mysql/upgrade_004.0_to_004.1.sh.in
src/share/database/scripts/mysql/upgrade_004.1_to_005.0.sh.in
src/share/database/scripts/mysql/upgrade_005.0_to_005.1.sh.in
src/share/database/scripts/mysql/upgrade_005.1_to_005.2.sh.in
src/share/database/scripts/mysql/upgrade_005.2_to_006.0.sh.in
src/share/database/scripts/mysql/upgrade_006.0_to_007.0.sh.in
src/share/database/scripts/mysql/upgrade_007.0_to_008.0.sh.in
src/share/database/scripts/mysql/upgrade_008.0_to_008.1.sh.in
src/share/database/scripts/mysql/upgrade_008.1_to_008.2.sh.in
src/share/database/scripts/mysql/upgrade_008.2_to_009.0.sh.in
src/share/database/scripts/mysql/upgrade_009.0_to_009.1.sh.in
src/share/database/scripts/mysql/upgrade_009.1_to_009.2.sh.in
src/share/database/scripts/mysql/upgrade_009.2_to_009.3.sh.in
src/share/database/scripts/mysql/upgrade_009.3_to_009.4.sh.in
src/share/database/scripts/mysql/upgrade_009.4_to_009.5.sh.in
src/share/database/scripts/mysql/upgrade_009.5_to_009.6.sh.in
src/share/database/scripts/mysql/upgrade_009.6_to_010.0.sh.in
src/share/database/scripts/mysql/upgrade_010_to_011.sh.in
src/share/database/scripts/mysql/upgrade_011_to_012.sh.in
src/share/database/scripts/mysql/upgrade_012_to_013.sh.in
src/share/database/scripts/mysql/upgrade_013_to_014.sh.in
src/share/database/scripts/mysql/upgrade_014_to_015.sh.in
src/share/database/scripts/mysql/upgrade_015_to_016.sh.in
src/share/database/scripts/mysql/upgrade_016_to_017.sh.in
src/share/database/scripts/mysql/upgrade_017_to_018.sh.in
src/share/database/scripts/pgsql/dhcpdb_create.pgsql
src/share/database/scripts/pgsql/upgrade_001.0_to_002.0.sh.in
src/share/database/scripts/pgsql/upgrade_002.0_to_003.0.sh.in
src/share/database/scripts/pgsql/upgrade_003.0_to_003.1.sh.in
src/share/database/scripts/pgsql/upgrade_003.1_to_003.2.sh.in
src/share/database/scripts/pgsql/upgrade_003.2_to_003.3.sh.in
src/share/database/scripts/pgsql/upgrade_003.3_to_004.0.sh.in
src/share/database/scripts/pgsql/upgrade_004.0_to_005.0.sh.in
src/share/database/scripts/pgsql/upgrade_005.0_to_005.1.sh.in
src/share/database/scripts/pgsql/upgrade_005.1_to_006.0.sh.in
src/share/database/scripts/pgsql/upgrade_006.0_to_006.1.sh.in
src/share/database/scripts/pgsql/upgrade_006.1_to_006.2.sh.in
src/share/database/scripts/pgsql/upgrade_006.2_to_007.0.sh.in
src/share/database/scripts/pgsql/upgrade_007_to_008.sh.in
src/share/database/scripts/pgsql/upgrade_008_to_009.sh.in
src/share/database/scripts/pgsql/upgrade_009_to_010.sh.in
src/share/database/scripts/pgsql/upgrade_010_to_011.sh.in
src/share/database/scripts/pgsql/upgrade_011_to_012.sh.in
src/share/database/scripts/pgsql/upgrade_012_to_013.sh.in
src/share/database/scripts/pgsql/upgrade_013_to_014.sh.in
src/share/database/scripts/pgsql/upgrade_014_to_015.sh.in
src/share/database/scripts/pgsql/upgrade_015_to_016.sh.in
src/share/database/scripts/pgsql/upgrade_016_to_017.sh.in

index 6a74cab3ce682649e897aefcdfa086e131d6d64c..ba20fdb340bfde4d30f17b910d8467ab5c201fe8 100644 (file)
@@ -767,14 +767,14 @@ mysql_upgrade_test() {
     version=$("${kea_admin}" db-version mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}")
     assert_str_eq "1.0" "${version}" "Expected kea-admin to return %s, returned value was %s"
 
-    # Ok, we have a 1.0 database. Let's upgrade it to the latest version.
+    # Let's upgrade it to the latest version.
     run_command \
         "${kea_admin}" db-upgrade mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}"
     assert_eq 0 "${EXIT_CODE}" "kea-admin db-upgrade mysql failed, expected %d, returned non-zero status code %d\n"
 
     # Verify that the upgraded schema reports the latest version.
     version=$("${kea_admin}" db-version mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}")
-    assert_str_eq "17.0" "${version}" "Expected kea-admin to return %s, returned value was %s"
+    assert_str_eq "18.0" "${version}" "Expected kea-admin to return %s, returned value was %s"
 
     # Let's check that the new tables are indeed there.
 
@@ -1886,7 +1886,7 @@ mysql_lease_stat_upgrade_test() {
  insert into lease6 (address, lease_type, subnet_id, state) values (666,1,40,2);"
     run_statement "insert v6 leases" "$qry"
 
-    # Ok, we have a 4.0 database with leases. Let's upgrade it to the latest version.
+    # Let's upgrade it to the latest version.
     run_command \
         "${kea_admin}" db-upgrade mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}"
 
@@ -2187,7 +2187,7 @@ mysql_reservation_mode_upgrade_test() {
     mysql_wipe
 
     # We need to create an older database with lease data so we can
-    # verify the upgrade mechanisms which convert reservations values
+    # verify the upgrade mechanisms which convert reservation values
     #
     # Initialize database to schema 1.0.
     mysql -u"${db_user}" -p"${db_password}" "${db_name}" < "@abs_top_srcdir@/src/bin/admin/tests/dhcpdb_create_1.0.mysql"
@@ -2525,7 +2525,7 @@ mysql_update_empty_duid_test() {
 
     run_statement "insert v6 leases" "$sql"
 
-    # Ok, we have a 14.0 database with leases. Let's upgrade it to latest version.
+    # Let's upgrade it to the latest version.
     run_command \
         "${kea_admin}" db-upgrade mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}"
 
index d7c616bad75a941a2ff90f168131c8736f30c62a..27a0a0d6390ff50b3f2dae97b0e384a0370548b7 100644 (file)
@@ -143,7 +143,7 @@ pgsql_db_version_test() {
     run_command \
         "${kea_admin}" db-version pgsql -u "${db_user}" -p "${db_password}" -n "${db_name}"
     version="${OUTPUT}"
-    assert_str_eq "16.0" "${version}" "Expected kea-admin to return %s, returned value was %s"
+    assert_str_eq "17.0" "${version}" "Expected kea-admin to return %s, returned value was %s"
 
     # Let's wipe the whole database
     pgsql_wipe
@@ -847,14 +847,14 @@ pgsql_upgrade_test() {
         pgsql_execute_script "@abs_top_srcdir@/src/bin/admin/tests/dhcpdb_create_1.0.pgsql"
     assert_eq 0 "${EXIT_CODE}" "cannot initialize the database, expected exit code: %d, actual: %d"
 
-    # Ok, we have a 1.0 database. Let's upgrade it to the latest version.
+    # Let's upgrade it to the latest version.
     run_command \
         "${kea_admin}" db-upgrade pgsql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}"
     assert_eq 0 "${EXIT_CODE}" "db-upgrade failed, expected exit code: %d, actual: %d"
 
     # Verify upgraded schema reports the latest version.
     version=$("${kea_admin}" db-version pgsql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}")
-    assert_str_eq "16.0" "${version}" 'Expected kea-admin to return %s, returned value was %s'
+    assert_str_eq "17.0" "${version}" 'Expected kea-admin to return %s, returned value was %s'
 
     # Check 1.0 to 2.0 upgrade
     pgsql_upgrade_1_0_to_2_0_test
@@ -1403,7 +1403,7 @@ pgsql_lease_stat_upgrade_test() {
  insert into lease6 (address, lease_type, subnet_id, state) values (666,1,40,2);"
     run_statement "insert v6 leases" "$qry"
 
-    # Ok, we have a 2.0 database with leases. Let's upgrade it to latest version.
+    # Let's upgrade it to the latest version.
     run_command \
         "${kea_admin}" db-upgrade pgsql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}"
 
@@ -1648,7 +1648,7 @@ pgsql_unused_subnet_id_test() {
 
     run_statement "insert options" "$qry"
 
-    # Ok, we have a 4.0 database with hosts and options. Let's upgrade it to latest version.
+    # Let's upgrade it to the latest version.
     run_command \
         "${kea_admin}" db-upgrade pgsql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}"
 
@@ -1718,7 +1718,7 @@ pgsql_update_empty_duid_test() {
 
     run_statement "insert v6 leases" "$qry"
 
-    # Ok, we have a 14.0 database with leases. Let's upgrade it to latest version.
+    # Let's upgrade it to the latest version.
     run_command \
         "${kea_admin}" db-upgrade pgsql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}"
 
index b45e9a8cc1eea73f9749ac80ecbeda3072fa3b6f..6190cd5de9c76dd13e03ba0f1313f29e72992fa0 100644 (file)
@@ -50,7 +50,7 @@ ClientHandler::ClientPtr
 ClientHandler::lookup(const ClientIdPtr& client_id) {
     // Sanity check.
     if (!client_id) {
-        isc_throw(InvalidParameter, "null duid in ClientHandler::lookup");
+        isc_throw(InvalidParameter, "null client-id in ClientHandler::lookup");
     }
 
     auto it = clients_client_id_.find(client_id->getClientId());
index b34d6e007b5872f4eeabe1e49dfe1420a198c43f..458458d7cae8c49e9de9b8c7e3af1b0a551c0ed9 100644 (file)
@@ -190,7 +190,7 @@ Dhcpv4SrvTest::acquireAndDecline(Dhcp4Client& client,
     // We check if the decline process was successful by checking if the
     // lease is in the database and what is its state.
     if (expected_result == SHOULD_PASS) {
-        EXPECT_EQ(Lease::STATE_DECLINED, lease->state_);
+        ASSERT_EQ(Lease::STATE_DECLINED, lease->state_);
 
         ASSERT_TRUE(lease->hwaddr_);
         ASSERT_TRUE(lease->hwaddr_->hwaddr_.empty());
@@ -201,12 +201,11 @@ Dhcpv4SrvTest::acquireAndDecline(Dhcp4Client& client,
 
         // The decline succeeded, so the declined-addresses statistic should
         // be increased by one
-        EXPECT_EQ(after, before + 1);
-
-        EXPECT_EQ(after_global, before_global + 1);
+        ASSERT_EQ(after, before + 1);
+        ASSERT_EQ(after_global, before_global + 1);
     } else {
         // the decline was supposed, to be rejected.
-        EXPECT_EQ(Lease::STATE_DEFAULT, lease->state_);
+        ASSERT_EQ(Lease::STATE_DEFAULT, lease->state_);
 
         ASSERT_TRUE(lease->hwaddr_);
         ASSERT_FALSE(lease->hwaddr_->hwaddr_.empty());
@@ -216,8 +215,8 @@ Dhcpv4SrvTest::acquireAndDecline(Dhcp4Client& client,
 
         // The decline failed, so the declined-addresses should be the same
         // as before
-        EXPECT_EQ(before, after);
-        EXPECT_EQ(before_global, after_global);
+        ASSERT_EQ(before, after);
+        ASSERT_EQ(before_global, after_global);
     }
 }
 
index 375053eab89d2b633b75e2c9c669586964b354c7..509c5e8d2279d8806b120420c552d8bee9a618a5 100644 (file)
@@ -209,7 +209,7 @@ Dhcpv6SrvTest::acquireAndDecline(Dhcp6Client& client,
     // We check if the decline process was successful by checking if the
     // lease is in the database and what is its state.
     if (expected_result == SHOULD_PASS) {
-        EXPECT_EQ(Lease::STATE_DECLINED, lease->state_);
+        ASSERT_EQ(Lease::STATE_DECLINED, lease->state_);
 
         ASSERT_FALSE(lease->hwaddr_);
         ASSERT_TRUE(lease->duid_);
@@ -221,11 +221,11 @@ Dhcpv6SrvTest::acquireAndDecline(Dhcp6Client& client,
 
         // The decline succeeded, so the declined-addresses statistic should
         // be increased by one
-        EXPECT_EQ(after, before + 1);
-        EXPECT_EQ(after_global, before_global + 1);
+        ASSERT_EQ(after, before + 1);
+        ASSERT_EQ(after_global, before_global + 1);
     } else {
         // the decline was supposed, to be rejected.
-        EXPECT_EQ(Lease::STATE_DEFAULT, lease->state_);
+        ASSERT_EQ(Lease::STATE_DEFAULT, lease->state_);
 
         ASSERT_TRUE(lease->hwaddr_);
         ASSERT_TRUE(lease->duid_);
@@ -236,8 +236,8 @@ Dhcpv6SrvTest::acquireAndDecline(Dhcp6Client& client,
 
         // The decline failed, so the declined-addresses should be the same
         // as before
-        EXPECT_EQ(before, after);
-        EXPECT_EQ(before_global, after_global);
+        ASSERT_EQ(before, after);
+        ASSERT_EQ(before_global, after_global);
     }
 }
 
index b61b22aae1d47d9f276125e2fecb9cfb5a73eb91..9c3be8a279fa065ca949e7962cd6eb165533b204 100644 (file)
@@ -139,11 +139,13 @@ class DUID : public IdentifierType<3, 130> {
 public:
 
     /// @brief minimum duid size
-    /// The minimal DUID size specified in RFC 8415 is 1.
+    /// The minimal DUID size specified in RFC 8415, section 11.1 is 3:
+    /// 2 fixed octets for the type + 1 minimum octet for the value.
     static constexpr size_t MIN_DUID_LEN = IdentifierType::getMinSize();
 
     /// @brief maximum duid size
-    /// As defined in RFC 8415, section 11.1
+    /// The maximum DUID size specified in RFC 8415, section 11.1 is 130:
+    /// 2 fixed octets for the type + 128 maximum octets for the value.
     static constexpr size_t MAX_DUID_LEN = IdentifierType::getMaxSize();
 
     /// @brief specifies DUID type
index 7f630f2a2992827fb4a7cf48e1182ba7acea774a..f6947da40dfa8a60d5893a77a6bcf41653e3fd94 100644 (file)
@@ -477,8 +477,8 @@ Pkt4::setHWAddrMember(const uint8_t htype, const uint8_t hlen,
     /// @todo Rewrite this once support for client-identifier option
     /// is implemented (ticket 1228?)
     if (hlen > MAX_CHADDR_LEN) {
-        isc_throw(OutOfRange, "Hardware address (len=" << hlen
-                  << " too long. Max " << MAX_CHADDR_LEN << " supported.");
+        isc_throw(OutOfRange, "Hardware address (len=" << static_cast<uint32_t>(hlen)
+                  << ") too long. Max " << MAX_CHADDR_LEN << " supported.");
 
     } else if (mac_addr.empty() && (hlen > 0) ) {
         isc_throw(OutOfRange, "Invalid HW Address specified");
index 08aacbfb777b83b8253f62e444509539ec168baa..5f6dcfb10ac9713c23f4c4450d7042616ba0456f 100644 (file)
@@ -388,7 +388,7 @@ TEST_F(DhcidTest, fromMinDUID) {
 
     // Create DUID.
     std::vector<uint8_t> duid_data(DUID::MIN_DUID_LEN, 1);
-    DUID duid(&duid_data[0], duid_data.size());
+    DUID duid(duid_data.data(), duid_data.size());
 
     // Create DHCID.
     ASSERT_NO_THROW(dhcid.fromDUID(duid, wire_fqdn_));
index 58160bdbdd8fafa73e927b4e79c0654fe6b34524..26a3557bce20d44de3b2b15323646096bf9bd5b2 100644 (file)
@@ -52,7 +52,7 @@ const int MLM_MYSQL_FETCH_FAILURE = 0;
 
 /// @name Current database schema version values.
 //@{
-const uint32_t MYSQL_SCHEMA_VERSION_MAJOR = 17;
+const uint32_t MYSQL_SCHEMA_VERSION_MAJOR = 18;
 const uint32_t MYSQL_SCHEMA_VERSION_MINOR = 0;
 
 //@}
index 51fa34c2820973001fed5297d47c9c44f2aaeedb..7d1e5c4505a19bfa38e0fbe159771c977bcad006 100644 (file)
@@ -18,7 +18,7 @@ namespace isc {
 namespace db {
 
 /// @brief Define the PostgreSQL backend version.
-const uint32_t PGSQL_SCHEMA_VERSION_MAJOR = 16;
+const uint32_t PGSQL_SCHEMA_VERSION_MAJOR = 17;
 const uint32_t PGSQL_SCHEMA_VERSION_MINOR = 0;
 
 // Maximum number of parameters that can be used a statement
index 442c4a8fd8bf59381f94e8cfa824323fde8714a7..09876c443c6929c416d06389688d7f3a28193930 100644 (file)
@@ -145,7 +145,7 @@ INSERT INTO lease_hwaddr_source VALUES (32, 'HWADDR_SOURCE_SUBSCRIBER_ID');
 # Hardware address extracted from docsis options
 INSERT INTO lease_hwaddr_source VALUES (64, 'HWADDR_SOURCE_DOCSIS');
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '2', minor = '0';
 
@@ -235,7 +235,7 @@ END
 $$
 DELIMITER ;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '3', minor = '0';
 
@@ -379,7 +379,7 @@ ORDER BY l.address;
 END $$
 DELIMITER ;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '4', minor = '0';
 
@@ -391,13 +391,13 @@ UPDATE schema_version
 # foreign key constraint between lease6 and lease_hardware_source
 INSERT INTO lease_hwaddr_source VALUES (0, 'HWADDR_SOURCE_UNKNOWN');
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '4', minor = '1';
 
 # This line concludes the schema upgrade to version 4.1.
 
-# This line starts the schema upgrade to version 5.
+# This line starts the schema upgrade to version 5.0.
 
 # Update index used for searching DHCPv4 reservations by identifier and subnet id.
 # This index is now unique (to prevent duplicates) and includes DHCPv4 subnet
@@ -484,7 +484,7 @@ ALTER TABLE hosts ADD COLUMN dhcp4_next_server INT UNSIGNED NULL;
 ALTER TABLE hosts ADD COLUMN dhcp4_server_hostname VARCHAR(64) NULL;
 ALTER TABLE hosts ADD COLUMN dhcp4_boot_file_name VARCHAR(128) NULL;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '5', minor = '0';
 
@@ -510,7 +510,7 @@ END
 $$
 DELIMITER ;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '5', minor = '1';
 
@@ -522,7 +522,7 @@ UPDATE schema_version
 ALTER TABLE dhcp4_options MODIFY dhcp4_subnet_id INT UNSIGNED;
 ALTER TABLE dhcp6_options MODIFY dhcp6_subnet_id INT UNSIGNED;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '5', minor = '2';
 
@@ -688,7 +688,7 @@ CREATE TRIGGER stat_lease6_delete AFTER DELETE ON lease6
     END $$
 DELIMITER ;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '6', minor = '0';
 
@@ -1342,7 +1342,7 @@ END
 $$
 DELIMITER ;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '7', minor = '0';
 
@@ -2301,7 +2301,7 @@ CREATE TRIGGER dhcp6_options_ADEL AFTER DELETE ON dhcp6_options
     END $$
 DELIMITER ;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '8', minor = '0';
 
@@ -2388,7 +2388,7 @@ DELIMITER ;
 ALTER TABLE hosts
     MODIFY COLUMN auth_key VARCHAR(32) NULL;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '8', minor = '1';
 
@@ -2793,7 +2793,7 @@ CREATE TRIGGER dhcp6_options_ADEL AFTER DELETE ON dhcp6_options
     END $$
 DELIMITER ;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '8', minor = '2';
 
@@ -2810,7 +2810,7 @@ CREATE INDEX lease4_by_hostname ON lease4 (hostname);
 # Create hostname index for lease6
 CREATE INDEX lease6_by_hostname ON lease6 (hostname);
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '9', minor = '0';
 
@@ -2851,7 +2851,7 @@ ALTER TABLE dhcp6_subnet
     ADD COLUMN ddns_generated_prefix VARCHAR(255) DEFAULT NULL,
     ADD COLUMN ddns_qualifying_suffix VARCHAR(255) DEFAULT NULL;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '9', minor = '1';
 
@@ -2896,7 +2896,7 @@ ALTER TABLE dhcp6_options ADD CONSTRAINT fk_dhcp6_options_pd_pool
         REFERENCES dhcp6_pd_pool(id)
         ON DELETE CASCADE ON UPDATE CASCADE;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '9', minor = '2';
 
@@ -3000,7 +3000,7 @@ CREATE TRIGGER stat_lease6_delete AFTER DELETE ON lease6
     END $$
 DELIMITER ;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '9', minor = '3';
 
@@ -3048,7 +3048,7 @@ ALTER TABLE dhcp6_options ADD CONSTRAINT fk_dhcp6_options_Host
         REFERENCES hosts(host_id)
         ON DELETE CASCADE ON UPDATE CASCADE;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '9', minor = '4';
 
@@ -3083,7 +3083,7 @@ ALTER TABLE dhcp4_shared_network DROP COLUMN reservation_mode;
 ALTER TABLE dhcp6_subnet DROP COLUMN reservation_mode;
 ALTER TABLE dhcp6_shared_network DROP COLUMN reservation_mode;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '9', minor = '5';
 
@@ -3112,13 +3112,13 @@ ALTER TABLE dhcp6_shared_network
 ALTER TABLE logs
     ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '9', minor = '6';
 
 # This line concludes the schema upgrade to version 9.6.
 
-# This line starts the schema upgrade to version 10.
+# This line starts the schema upgrade to version 10.0.
 
 -- -----------------------------------------------------------------------
 -- Create a table holding the DHCPv4 client classes. Most table
@@ -4043,13 +4043,13 @@ ALTER TABLE dhcp6_option_def
     ON DELETE CASCADE
     ON UPDATE CASCADE;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '10', minor = '0';
 
-# This line concludes the schema upgrade to version 10.
+# This line concludes the schema upgrade to version 10.0.
 
-# This line starts the schema upgrade to version 11.
+# This line starts the schema upgrade to version 11.0.
 
 # Reverse index order to improve reclamation query performance
 # Add a constraint that any state value added to the lease4 must
@@ -4075,13 +4075,13 @@ ALTER TABLE dhcp6_client_class
     ADD COLUMN min_preferred_lifetime INT(10) DEFAULT NULL,
     ADD COLUMN max_preferred_lifetime INT(10) DEFAULT NULL;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '11', minor = '0';
 
-# This line concludes the schema upgrade to version 11.
+# This line concludes the schema upgrade to version 11.0.
 
-# This line starts the schema upgrade to version 12.
+# This line starts the schema upgrade to version 12.0.
 
 # Ensure that dhcp_client_class is NULL when an option does not
 # belong to any client class. Later, we will add foreign keys for
@@ -4109,13 +4109,13 @@ ALTER TABLE dhcp6_options
     REFERENCES dhcp6_client_class (name)
     ON DELETE CASCADE ON UPDATE CASCADE;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '12', minor = '0';
 
--- This line concludes the schema upgrade to version 12.
+-- This line concludes the schema upgrade to version 12.0.
 
--- This line starts the schema upgrade to version 13.
+-- This line starts the schema upgrade to version 13.0.
 
 -- Create a function that separates a contiguous hexadecimal string
 -- into groups of two hexadecimals separated by colons.
@@ -4325,9 +4325,9 @@ DELIMITER ;
 UPDATE schema_version
     SET version = '13', minor = '0';
 
--- This line concludes the schema upgrade to version 13.
+-- This line concludes the schema upgrade to version 13.0.
 
--- This line starts the schema upgrade to version 14.
+-- This line starts the schema upgrade to version 14.0.
 
 -- Modify shared-network-name foreign key constraint on dhcp4_subnet to not perform
 -- the update when the network is deleted the cascaded update will not execute
@@ -5097,9 +5097,9 @@ DELIMITER ;
 UPDATE schema_version
     SET version = '14', minor = '0';
 
--- This line concludes the schema upgrade to version 14.
+-- This line concludes the schema upgrade to version 14.0.
 
--- This line starts the schema upgrade to version 15.
+-- This line starts the schema upgrade to version 15.0.
 
 -- Add cancelled (aka never-send) column to option tables.
 ALTER TABLE dhcp4_options
@@ -5122,9 +5122,9 @@ ALTER TABLE dhcp4_client_class
 UPDATE schema_version
     SET version = '15', minor = '0';
 
--- This line concludes the schema upgrade to version 15.
+-- This line concludes the schema upgrade to version 15.0.
 
--- This line starts the schema upgrade to version 16.
+-- This line starts the schema upgrade to version 16.0.
 
 -- Add relay and remote id columns to DHCPv4 leases.
 --
@@ -5142,9 +5142,9 @@ CREATE INDEX lease4_by_remote_id ON lease4 (remote_id);
 UPDATE schema_version
     SET version = '16', minor = '0';
 
--- This line concludes the schema upgrade to version 16.
+-- This line concludes the schema upgrade to version 16.0.
 
--- This line starts the schema upgrade to version 17.
+-- This line starts the schema upgrade to version 17.0.
 
 -- Add the allocator column to the DHCPv4 tables.
 ALTER TABLE dhcp4_subnet ADD COLUMN allocator TEXT NULL;
@@ -5162,9 +5162,9 @@ ALTER TABLE dhcp6_shared_network ADD COLUMN pd_allocator TEXT NULL;
 UPDATE schema_version
     SET version = '17', minor = '0';
 
--- This line concludes the schema upgrade to version 17.
+-- This line concludes the schema upgrade to version 17.0.
 
--- This line starts the schema upgrade to version 18.
+-- This line starts the schema upgrade to version 18.0.
 
 -- Extend lease4 client_id to 255 bytes.
 ALTER TABLE lease4
@@ -5304,7 +5304,7 @@ DELIMITER ;
 UPDATE schema_version
     SET version = '18', minor = '0';
 
--- This line concludes the schema upgrade to version 18.
+-- This line concludes the schema upgrade to version 18.0.
 
 # Notes:
 #
index a8d36ea6140ff646667dbb3c418a9add3c42688b..208afbce12f64f35e5035706e870ddde7c732849 100644 (file)
@@ -34,6 +34,8 @@ if [ "$VERSION" != "1.0" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 2.0.
+
 ALTER TABLE lease6
     ADD COLUMN hwaddr varbinary(20),
     ADD COLUMN hwtype smallint unsigned,
@@ -53,7 +55,7 @@ INSERT INTO lease_hwaddr_source VALUES (16, 'HWADDR_SOURCE_REMOTE_ID');
 INSERT INTO lease_hwaddr_source VALUES (32, 'HWADDR_SOURCE_SUBSCRIBER_ID');
 INSERT INTO lease_hwaddr_source VALUES (64, 'HWADDR_SOURCE_DOCSIS');
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '2', minor = '0';
 
index 0fcb1eb4fad7df7681313a75163345b0e9b32052..11b92a3ed7cfdbbcdc2422b8cc2b3c6af4415671 100644 (file)
@@ -34,6 +34,8 @@ if [ "$VERSION" != "2.0" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 3.0.
+
 CREATE TABLE IF NOT EXISTS hosts (
     host_id INT UNSIGNED NOT NULL AUTO_INCREMENT ,
     dhcp_identifier VARBINARY(128) NOT NULL ,
@@ -114,7 +116,7 @@ END
 $$
 DELIMITER ;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '3', minor = '0';
 
index d7895389b01d2b50cf6e8bc5e1b96988d615ce5b..e7181c2bf161f405b0098632ea82d2f03b69dd28 100644 (file)
@@ -34,6 +34,8 @@ if [ "$VERSION" != "3.0" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 4.0.
+
 # Add state column to the lease4 table.
 ALTER TABLE lease4
     ADD COLUMN state INT UNSIGNED DEFAULT 0;
@@ -166,7 +168,7 @@ FROM lease6 l
 END $$
 DELIMITER ;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '4', minor = '0';
 
index e654bddf196797c862a8785c957dab0593eab786..745809b86ab4928c4daff1f7b065abe1a6cfad4d 100644 (file)
@@ -34,6 +34,7 @@ if [ "$VERSION" != "4.0" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 4.1.
 
 # In the event hardware address cannot be determined, we need to satisfy
 # foreign key constraint between lease6 and lease_hardware_source
@@ -96,7 +97,7 @@ ORDER BY l.address;
 END $$
 DELIMITER ;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '4', minor = '1';
 
index b2ae2b42818c5d7af9fd19b92042eb5a78e01db9..3860513d752ae92b4b221bff60a79f4e17640820 100644 (file)
@@ -34,6 +34,7 @@ if [ "$VERSION" != "4.1" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 5.0.
 
 # Update index used for searching DHCPv4 reservations by identifier and subnet id.
 # This index is now unique (to prevent duplicates) and includes DHCPv4 subnet
@@ -120,7 +121,7 @@ ALTER TABLE hosts ADD COLUMN dhcp4_next_server INT UNSIGNED NULL;
 ALTER TABLE hosts ADD COLUMN dhcp4_server_hostname VARCHAR(64) NULL;
 ALTER TABLE hosts ADD COLUMN dhcp4_boot_file_name VARCHAR(128) NULL;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '5', minor = '0';
 
index 018d9e047766a77a6726e6804b5be901850da115..6d32abc3b499bea34a34a9a407bfe4bdd6356bc5 100644 (file)
@@ -34,6 +34,7 @@ if [ "$VERSION" != "5.0" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 5.1.
 
 # Add missing 'client-id' and new 'flex-id' host identifier types.
 INSERT INTO host_identifier_type VALUES (3, 'client-id');
@@ -53,7 +54,7 @@ END
 $$
 DELIMITER ;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '5', minor = '1';
 
index 2d6b0b032f7b95145ffbbd2e3e57fa903d9985c0..386462050d841d36d56130334944d10291e13ea9 100644 (file)
@@ -34,12 +34,13 @@ if [ "$VERSION" != "5.1" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 5.2.
 
 # Make subnet_id column types consistent with lease table columns
 ALTER TABLE dhcp4_options MODIFY dhcp4_subnet_id INT UNSIGNED;
 ALTER TABLE dhcp6_options MODIFY dhcp6_subnet_id INT UNSIGNED;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '5', minor = '2';
 
index 1b685c1b92d9d60a0848fbbd2f1ac86e885e5030..ed78892dacaae84db2abe7c2b67acf03fb748895 100644 (file)
@@ -34,6 +34,7 @@ if [ "$VERSION" != "5.2" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 6.0.
 
 # Add user context into table holding hosts
 ALTER TABLE hosts ADD COLUMN user_context TEXT NULL;
@@ -208,7 +209,7 @@ INSERT INTO lease6_stat (subnet_id, lease_type, state, leases)
     GROUP BY subnet_id, lease_type, state
     ORDER BY subnet_id;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '6', minor = '0';
 
index 7710b49d9eb6e1abc0deecb144f0c784cf19e547..e3c695c2ba7921b821a9eb8cc23498b04aa7cb7a 100644 (file)
@@ -34,6 +34,7 @@ if [ "$VERSION" != "6.0" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 7.0.
 
 # Add user context into tables holding leases
 ALTER TABLE lease4 ADD COLUMN user_context TEXT NULL;
@@ -654,7 +655,7 @@ END
 $$
 DELIMITER ;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '7', minor = '0';
 
index 8608dafb96f06bc4b2d5f77a20bdf5b4c1f722fc..3a5a77deed59bf09bb5b791a09a66e150120acb1 100644 (file)
@@ -34,6 +34,7 @@ if [ "$VERSION" != "7.0" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 8.0.
 
 ALTER TABLE dhcp4_options
     MODIFY COLUMN modification_ts TIMESTAMP NOT NULL
@@ -985,7 +986,7 @@ CREATE TRIGGER dhcp6_options_ADEL AFTER DELETE ON dhcp6_options
     END $$
 DELIMITER ;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '8', minor = '0';
 
index 14d4f46a3acca271c0f4cf0f81dde4241a0f2b4d..d51b75f64f7f11b7344f262f77faac63128f785b 100644 (file)
@@ -34,6 +34,7 @@ if [ "$VERSION" != "8.0" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 8.1.
 
 # Add lifetime bounds
 ALTER TABLE dhcp4_shared_network
@@ -114,7 +115,7 @@ DELIMITER ;
 ALTER TABLE hosts
     MODIFY COLUMN auth_key VARCHAR(32) NULL;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '8', minor = '1';
 
index e4e3cdbbb746600fc2a318c0552f7a1595bd9b31..f980eef824b72fc469a79b0d16d1af094c70ae73 100644 (file)
@@ -86,6 +86,7 @@ change_column() {
 }
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 8.2.
 
 # Drop existing trigger on the dhcp4_shared_network table.
 DROP TRIGGER dhcp4_shared_network_ADEL;
@@ -485,7 +486,7 @@ CREATE TRIGGER dhcp6_options_ADEL AFTER DELETE ON dhcp6_options
     END $$
 DELIMITER ;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '8', minor = '2';
 
index bdf2e4e2c5adfa39451f48ed53ed7a3203a66ac0..af518146652b4aa681ec14ff034aec1e7421f716 100644 (file)
@@ -34,6 +34,7 @@ if [ "$VERSION" != "8.2" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 9.0.
 
 # Create hostname index for host reservations
 CREATE INDEX hosts_by_hostname ON hosts (hostname);
@@ -52,7 +53,7 @@ CREATE INDEX lease4_by_hostname ON lease4 (hostname);
 # Create hostname index for lease6
 CREATE INDEX lease6_by_hostname ON lease6 (hostname);
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '9', minor = '0';
 
index 139893b100a164a5042cf110e4131d81e669dcce..eb0dde58de34bff7183d837d3ee8b27977f5640c 100644 (file)
@@ -34,6 +34,7 @@ if [ "$VERSION" != "9.0" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 9.1.
 
 # Add new DDNS related columns to shared networks and subnets
 ALTER TABLE dhcp4_shared_network
@@ -68,7 +69,7 @@ ALTER TABLE dhcp6_subnet
     ADD COLUMN ddns_generated_prefix VARCHAR(255) DEFAULT NULL,
     ADD COLUMN ddns_qualifying_suffix VARCHAR(255) DEFAULT NULL;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '9', minor = '1';
 
index 3fff88c76edb316d2b3a934afca31379059b0956..4757e6aaecf180f276606d196d83d721d02aca22 100644 (file)
@@ -34,6 +34,7 @@ if [ "$VERSION" != "9.1" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 9.2.
 
 # Add missing indexes (foreign keys) to the dhcp4_options table.
 ALTER TABLE dhcp4_options ADD CONSTRAINT fk_dhcp4_options_shared_network
@@ -72,7 +73,7 @@ ALTER TABLE dhcp6_options ADD CONSTRAINT fk_dhcp6_options_pd_pool
         REFERENCES dhcp6_pd_pool(id)
         ON DELETE CASCADE ON UPDATE CASCADE;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '9', minor = '2';
 
index e9169c11c5334e559eacc1b050ddb5e82733dab6..768665c5a98e354d4cafc33bdce555b75c0c5d9c 100644 (file)
@@ -34,6 +34,7 @@ if [ "$VERSION" != "9.2" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 9.3.
 
 # Fix stat_lease4_update trigger
 DROP TRIGGER stat_lease4_update;
@@ -131,7 +132,7 @@ CREATE TRIGGER stat_lease6_delete AFTER DELETE ON lease6
     END $$
 DELIMITER ;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '9', minor = '3';
 
index 269e4afe7b3c8a8a6bee83c6bbe235949325097c..80fd89e1737f83efa9cd794f1f8b6ad89033119f 100644 (file)
@@ -34,6 +34,7 @@ if [ "$VERSION" != "9.3" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 9.4.
 
 # Starting from this version we allow specifying multiple IP reservations
 # for the same address in certain DHCP configurations. The server may check
@@ -75,7 +76,7 @@ ALTER TABLE dhcp6_options ADD CONSTRAINT fk_dhcp6_options_Host
         REFERENCES hosts(host_id)
         ON DELETE CASCADE ON UPDATE CASCADE;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '9', minor = '4';
 
index 9ef28f6f527cac7cc1eab0dbc0cefbb6027173d0..cba881e329b221e812d8f43c274160dd8bd1e5f4 100644 (file)
@@ -34,6 +34,7 @@ if [ "$VERSION" != "9.4" ]; then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 9.5.
 
 # Add new reservations flags.
 ALTER TABLE dhcp4_subnet
@@ -161,7 +162,7 @@ ALTER TABLE dhcp6_shared_network DROP COLUMN reservation_mode;
 # Enable audit in this session
 SET @disable_audit = 0;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '9', minor = '5';
 
index d97335b6cd35796bece7c75787e8f342961b18c4..1ad6753843dbb8aaffaedc6fe4737a88e1bbd78c 100644 (file)
@@ -58,11 +58,13 @@ EOF
 fi
 
 mysql "${@}" <<EOF
+-- This line starts the schema upgrade to version 9.6.
+
 # Add an auto-increment ID as primary key to support Percona.
 ALTER TABLE logs
     ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '9', minor = '6';
 
index 937ff22bdb57d8fa30203375104ad89902d8d750..3cdd0f1e4b44940aafe199be17dab3738c3ad70b 100644 (file)
@@ -97,6 +97,7 @@ shrink_tag_column "${schema}" dhcp4_server "${@}"
 shrink_tag_column "${schema}" dhcp6_server "${@}"
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 10.0.
 
 -- -----------------------------------------------------------------------
 -- Create a table holding the DHCPv4 client classes. Most table
@@ -1021,10 +1022,10 @@ ALTER TABLE dhcp6_option_def
     ON DELETE CASCADE
     ON UPDATE CASCADE;
 
-# Update the schema version number
+# Update the schema version number.
 UPDATE schema_version
     SET version = '10', minor = '0';
 
-# This line concludes the schema upgrade to version 10.
+# This line concludes the schema upgrade to version 10.0.
 
 EOF
index 7351e6ec569848a475163f9eacc5133859938095..12b3e947b505d7af294772b56638c15bbf1861ec 100644 (file)
@@ -52,6 +52,7 @@ then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 11.0.
 
 -- Reverse index order to improve reclamation query performance
 -- Add a constraint that any state value added to the lease4 must
@@ -77,7 +78,7 @@ ALTER TABLE dhcp6_client_class
     ADD COLUMN min_preferred_lifetime INT(10) DEFAULT NULL,
     ADD COLUMN max_preferred_lifetime INT(10) DEFAULT NULL;
 
--- Update the schema version number
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '11', minor = '0';
 
index b591d6c7414742a2153ec76df1cc6166648d9a8b..c104c236aeccba7f1c88714daf7652b9070aa9f5 100644 (file)
@@ -52,6 +52,7 @@ then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 12.0.
 
 -- Ensure that dhcp_client_class is NULL when an option does not
 -- belong to any client class. Later, we will add foreign keys for
@@ -79,10 +80,10 @@ ALTER TABLE dhcp6_options
     REFERENCES dhcp6_client_class (name)
     ON DELETE CASCADE ON UPDATE CASCADE;
 
--- Update the schema version number
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '12', minor = '0';
 
--- This line concludes the schema upgrade to version 12.
+-- This line concludes the schema upgrade to version 12.0.
 
 EOF
index 76969bb08db83645c30b7a7904dbffa02cdf82a0..0ba0db8a8eaae630d540b60649a6e1b4e1109498 100644 (file)
@@ -52,6 +52,7 @@ then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 13.0.
 
 -- Create a function that separates a contiguous hexadecimal string
 -- into groups of two hexadecimals separated by colons.
@@ -261,6 +262,6 @@ DELIMITER ;
 UPDATE schema_version
     SET version = '13', minor = '0';
 
--- This line concludes the schema upgrade to version 13.
+-- This line concludes the schema upgrade to version 13.0.
 
 EOF
index c8975174859191109df980eeaaccb996126ab4d3..c70dcf2cd72f9caf24147005e90cb0d62fa4f584 100644 (file)
@@ -52,6 +52,7 @@ then
 fi
 
 mysql "$@" <<EOF
+-- This line starts the schema upgrade to version 14.0.
 
 -- Modify shared-network-name foreign key constraint on dhcp4_subnet to not perform
 -- the update when the network is deleted the cascaded update will not execute
@@ -821,6 +822,6 @@ DELIMITER ;
 UPDATE schema_version
     SET version = '14', minor = '0';
 
--- This line concludes the schema upgrade to version 14.
+-- This line concludes the schema upgrade to version 14.0.
 
 EOF
index bc58082dadcc706823b331298e4fc6981749b8e5..fb78a855ecc2c458ed2d67c7a9103870f90b8b07 100644 (file)
@@ -52,7 +52,7 @@ then
 fi
 
 mysql "$@" <<EOF
--- This line starts the schema upgrade to version 15.
+-- This line starts the schema upgrade to version 15.0.
 
 -- Add cancelled (aka never-send) column to option tables.
 ALTER TABLE dhcp4_options
@@ -75,6 +75,6 @@ ALTER TABLE dhcp4_client_class
 UPDATE schema_version
     SET version = '15', minor = '0';
 
--- This line concludes the schema upgrade to version 15.
+-- This line concludes the schema upgrade to version 15.0.
 
 EOF
index c2969e3a4b221ce2a0b55b1a7b291caeafbc328c..97cf5a718979e8b785614cb3c42fdd1b28e80475 100644 (file)
@@ -52,7 +52,7 @@ then
 fi
 
 mysql "$@" <<EOF
--- This line starts the schema upgrade to version 16.
+-- This line starts the schema upgrade to version 16.0.
 
 -- Add relay and remote id columns to DHCPv4 leases.
 --
@@ -70,6 +70,6 @@ CREATE INDEX lease4_by_remote_id ON lease4 (remote_id);
 UPDATE schema_version
     SET version = '16', minor = '0';
 
--- This line concludes the schema upgrade to version 16.
+-- This line concludes the schema upgrade to version 16.0.
 
 EOF
index f3951c4907b743e74f8f3d532a41661714905b6f..e0228f0f6bb9a949364804b70bea4a62c8486a64 100644 (file)
@@ -52,7 +52,7 @@ then
 fi
 
 mysql "$@" <<EOF
--- This line starts the schema upgrade to version 17.
+-- This line starts the schema upgrade to version 17.0.
 
 -- Add the allocator column to the DHCPv4 tables.
 ALTER TABLE dhcp4_subnet ADD COLUMN allocator TEXT NULL;
@@ -70,6 +70,6 @@ ALTER TABLE dhcp6_shared_network ADD COLUMN pd_allocator TEXT NULL;
 UPDATE schema_version
     SET version = '17', minor = '0';
 
--- This line concludes the schema upgrade to version 17.
+-- This line concludes the schema upgrade to version 17.0.
 
 EOF
index eb2d59af6340e5dfbb6f115c12116d6de2d8c161..fb01d7b808bbc718c35966e64d3b5211d2032951 100644 (file)
@@ -52,7 +52,7 @@ then
 fi
 
 mysql "$@" <<EOF
--- This line starts the schema upgrade to version 18.
+-- This line starts the schema upgrade to version 18.0.
 
 -- Extend lease4 client_id to 255 bytes.
 ALTER TABLE lease4
@@ -192,6 +192,6 @@ DELIMITER ;
 UPDATE schema_version
     SET version = '18', minor = '0';
 
--- This line concludes the schema upgrade to version 18.
+-- This line concludes the schema upgrade to version 18.0.
 
 EOF
index e7662639acaac5fa52f35fe7fb31f07d15a48349..c8ddbcb18e4f6152e5fc2ff37d8e5c80d95a0248 100644 (file)
@@ -88,7 +88,7 @@ CREATE TABLE schema_version (
 
 INSERT INTO schema_version VALUES (1, 0);
 
--- Upgrade to schema 2.0 begins here:
+-- This line starts the schema upgrade to version 2.0.
 
 -- Add state column to the lease4 table.
 ALTER TABLE lease4
@@ -219,13 +219,13 @@ CREATE OR REPLACE FUNCTION lease6DumpData() RETURNS
 $$ LANGUAGE SQL;
 --
 
--- Set 2.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '2', minor = '0';
 
--- Schema 2.0 specification ends here.
+-- This line concludes the schema upgrade to version 2.0.
 
--- Upgrade to schema 3.0 begins here:
+-- This line starts the schema upgrade to version 3.0.
 
 --
 -- Table structure for table host_identifier_type.
@@ -474,13 +474,13 @@ ALTER TABLE hosts ADD COLUMN dhcp4_next_server BIGINT DEFAULT NULL;
 ALTER TABLE hosts ADD COLUMN dhcp4_server_hostname VARCHAR(64) DEFAULT NULL;
 ALTER TABLE hosts ADD COLUMN dhcp4_boot_file_name VARCHAR(128) DEFAULT NULL;
 
--- Set 3.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '3', minor = '0';
 
--- Schema 3.0 specification ends here.
+-- This line concludes the schema upgrade to version 3.0.
 
--- Upgrade to schema 3.1 begins here:
+-- This line starts the schema upgrade to version 3.1.
 
 -- This is a placeholder for the changes between 3.0 and 3.1. We have added a
 -- missing 'client-id' host reservation type entry that had been accidentally
@@ -488,13 +488,13 @@ UPDATE schema_version
 -- Also, new flexible identifier has been added.
 INSERT INTO host_identifier_type VALUES (4, 'flex-id');
 
--- Set 3.1 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '3', minor = '1';
 
--- Schema 3.1 specification ends here.
+-- This line concludes the schema upgrade to version 3.1.
 
--- Upgrade to schema 3.2 begins here:
+-- This line starts the schema upgrade to version 3.2.
 
 -- Remove constraints which perform too restrictive checks on the inserted
 -- host reservations. We want to be able to insert host reservations which
@@ -525,13 +525,13 @@ CREATE UNIQUE INDEX key_dhcp6_identifier_subnet_id ON hosts
         (dhcp_identifier ASC, dhcp_identifier_type ASC, dhcp6_subnet_id ASC)
     WHERE (dhcp6_subnet_id IS NOT NULL AND dhcp6_subnet_id <> 0);
 
--- Set 3.2 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '3', minor = '2';
 
--- Schema 3.2 specification ends here.
+-- This line concludes the schema upgrade to version 3.2.
 
--- Upgrade to schema 3.3 begins here:
+-- This line starts the schema upgrade to version 3.3.
 
 -- Change subnet ID columns type to BIGINT to match lease4/6 tables
 ALTER TABLE hosts ALTER COLUMN dhcp4_subnet_id TYPE BIGINT;
@@ -540,13 +540,13 @@ ALTER TABLE hosts ALTER COLUMN dhcp6_subnet_id TYPE BIGINT;
 ALTER TABLE dhcp4_options ALTER COLUMN dhcp4_subnet_id TYPE BIGINT;
 ALTER TABLE dhcp6_options ALTER COLUMN dhcp6_subnet_id TYPE BIGINT;
 
--- Set 3.3 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '3', minor = '3';
 
--- Schema 3.3 specification ends here.
+-- This line concludes the schema upgrade to version 3.3.
 
--- Upgrade to schema 4.0 begins here:
+-- This line starts the schema upgrade to version 4.0.
 
 -- Add a column holding hosts for user context.
 ALTER TABLE hosts ADD COLUMN user_context TEXT;
@@ -745,13 +745,13 @@ CREATE TRIGGER stat_lease6_delete
 AFTER DELETE ON lease6
     FOR EACH ROW EXECUTE PROCEDURE proc_stat_lease6_delete();
 
--- Set 4.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '4', minor = '0';
 
--- Schema 4.0 specification ends here.
+-- This line concludes the schema upgrade to version 4.0.
 
--- Upgrade to schema 5.0 begins here:
+-- This line starts the schema upgrade to version 5.0.
 
 -- Add a column holding leases for user context.
 ALTER TABLE lease4 ADD COLUMN user_context TEXT;
@@ -867,24 +867,24 @@ CREATE INDEX address_id ON logs (address);
 -- Create auth_key in hosts table for storing keys for DHCPv6 reconfigure.
 ALTER TABLE hosts ADD COLUMN auth_key  VARCHAR(16) DEFAULT NULL;
 
--- Set schema 5.0 version.
+-- Update the schema version number.
 UPDATE schema_version
    SET version = '5', minor = '0';
 
--- Schema 5.0 specification ends here.
+-- This line concludes the schema upgrade to version 5.0.
 
--- Upgrade to schema 5.1 begins here:
+-- This line starts the schema upgrade to version 5.1.
 
 -- Put the auth key in hexadecimal (double size but far more user friendly).
 ALTER TABLE hosts ALTER COLUMN auth_key TYPE VARCHAR(32);
 
--- Set schema 5.1 version.
+-- Update the schema version number.
 UPDATE schema_version
    SET version = '5', minor = '1';
 
--- Schema 5.1 specification ends here.
+-- This line concludes the schema upgrade to version 5.1.
 
--- Upgrade to schema 6.0 begins here:
+-- This line starts the schema upgrade to version 6.0.
 
 -- Create a lower case hostname index for hosts.
 CREATE INDEX hosts_by_hostname ON hosts (lower(hostname))
@@ -898,13 +898,13 @@ WHERE hostname IS NOT NULL;
 CREATE INDEX lease6_by_hostname ON lease6 (lower(hostname))
 WHERE hostname IS NOT NULL;
 
--- Set 6.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '6', minor = '0';
 
--- Schema 6.0 specification ends here.
+-- This line concludes the schema upgrade to version 6.0.
 
--- Upgrade to schema 6.1 begins here:
+-- This line starts the schema upgrade to version 6.1.
 
 -- Fix v4 update trigger procedure
 CREATE OR REPLACE FUNCTION proc_stat_lease4_update() RETURNS trigger AS $stat_lease4_update$
@@ -996,13 +996,13 @@ BEGIN
 END;
 $stat_lease6_delete$ LANGUAGE plpgsql;
 
--- Set 6.1 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '6', minor = '1';
 
--- Schema 6.1 specification ends here.
+-- This line concludes the schema upgrade to version 6.1.
 
--- Upgrade to schema 6.2 begins here:
+-- This line starts the schema upgrade to version 6.2.
 
 -- Starting from this version we allow specifying multiple IP reservations
 -- for the same address in certain DHCP configurations. The server may check
@@ -1022,13 +1022,13 @@ ALTER TABLE ipv6_reservations DROP CONSTRAINT IF EXISTS key_dhcp6_address_prefix
 CREATE INDEX key_dhcp6_address_prefix_len
     ON ipv6_reservations (address ASC, prefix_len ASC);
 
--- Set schema 6.2 version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '6', minor = '2';
 
--- Schema 6.2 specification ends here.
+-- This line concludes the schema upgrade to version 6.2.
 
--- Upgrade to schema 7.0 begins here:
+-- This line starts the schema upgrade to version 7.0.
 
 -- Add a lot (20+) of tables for the config backend.
 
@@ -3726,13 +3726,13 @@ END;
 $dhcp6_pd_pool_BDEL$
 LANGUAGE plpgsql;
 
--- Set schema 7.0 version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '7', minor = '0';
 
--- Schema 7.0 specification ends here.
+-- This line concludes the schema upgrade to version 7.0.
 
--- Upgrade to schema 8.0 begins here:
+-- This line starts the schema upgrade to version 8.0.
 
 -- Add a few missing elements for CB and functions for kea-admin's lease-dump
 -- and lease-upload commands.
@@ -4201,13 +4201,13 @@ BEGIN
 END
 $$ LANGUAGE plpgsql;
 
--- Set schema 8.0 version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '8', minor = '0';
 
--- Schema 8.0 specification ends here.
+-- This line concludes the schema upgrade to version 8.0.
 
--- Upgrade to schema 9.0 begins here:
+-- This line starts the schema upgrade to version 9.0.
 
 -- Add missing cascade to constraint on dhcp4/6_subnet_server tables.
 ALTER TABLE dhcp4_subnet_server
@@ -4453,13 +4453,13 @@ BEGIN
 END;$$
 LANGUAGE plpgsql;
 
--- Set schema 9.0 version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '9', minor = '0';
 
--- Schema 9.0 specification ends here.
+-- This line concludes the schema upgrade to version 9.0.
 
--- Upgrade to schema 10.0 begins here:
+-- This line starts the schema upgrade to version 10.0.
 
 -- It adds corrections for client classes for CB
 
@@ -4749,13 +4749,13 @@ END;
 $dhcp6_client_class_check_dependency_BINS$
 LANGUAGE plpgsql;
 
--- Set schema 10.0 version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '10', minor = '0';
 
--- Schema 10.0 specification ends here.
+-- This line concludes the schema upgrade to version 10.0.
 
--- Upgrade to schema 11.0 begins here:
+-- This line starts the schema upgrade to version 11.0.
 
 -- Replace createOptionAuditDHCP6() with a version corrected
 -- where clause when scope is 6 (i.e. PD pool)
@@ -4861,13 +4861,13 @@ BEGIN
     RETURN;
 END;$$;
 
--- Set schema 11.0 version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '11', minor = '0';
 
--- Schema 11.0 specification ends here.
+-- This line concludes the schema upgrade to version 11.0.
 
--- Upgrade to schema 12.0 begins here:
+-- This line starts the schema upgrade to version 12.0.
 
 -- Modify shared-network-name foreign key constraint on dhcp4_subnet to not perform
 -- the update when the network is deleted the cascaded update will not execute
@@ -4925,13 +4925,13 @@ LANGUAGE plpgsql;
 ALTER TABLE dhcp4_client_class ADD COLUMN user_context JSON DEFAULT NULL;
 ALTER TABLE dhcp6_client_class ADD COLUMN user_context JSON DEFAULT NULL;
 
--- Set schema 12.0 version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '12', minor = '0';
 
--- Schema 12.0 specification ends here.
+-- This line concludes the schema upgrade to version 12.0.
 
--- Upgrade to schema 13.0 begins here:
+-- This line starts the schema upgrade to version 13.0.
 
 -- JSON functions --
 
@@ -5564,13 +5564,13 @@ CREATE UNIQUE INDEX key_dhcp6_identifier_subnet_id ON hosts
         (dhcp_identifier ASC, dhcp_identifier_type ASC, dhcp6_subnet_id ASC)
     WHERE (dhcp6_subnet_id IS NOT NULL);
 
--- Set schema 13.0 version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '13', minor = '0';
 
--- Schema 13.0 specification ends here.
+-- This line concludes the schema upgrade to version 13.0.
 
--- Upgrade to schema 14.0 begins here:
+-- This line starts the schema upgrade to version 14.0.
 
 -- Add cancelled (aka never-send) column to option tables.
 
@@ -5587,13 +5587,13 @@ ALTER TABLE dhcp4_subnet
 ALTER TABLE dhcp4_client_class
     ADD COLUMN offer_lifetime BIGINT DEFAULT NULL;
 
--- Set schema 14.0 version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '14', minor = '0';
 
--- Schema 14.0 specification ends here.
+-- This line concludes the schema upgrade to version 14.0.
 
--- Upgrade to schema 15.0 begins here:
+-- This line starts the schema upgrade to version 15.0.
 
 -- Add relay and remote id columns to DHCPv4 leases.
 --
@@ -5607,23 +5607,13 @@ ALTER TABLE lease4
 CREATE INDEX lease4_by_relay_id ON lease4 (relay_id);
 CREATE INDEX lease4_by_remote_id ON lease4 (remote_id);
 
--- Set schema 15.0 version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '15', minor = '0';
 
--- Schema 15.0 specification ends here.
+-- This line concludes the schema upgrade to version 15.0.
 
--- Upgrade to schema 16.0 begins here:
-
-UPDATE lease6 SET duid = E'\\x000000' WHERE duid = E'\\x00';
-
--- Set 16.0 schema version.
-UPDATE schema_version
-    SET version = '16', minor = '0';
-
--- Schema 16.0 specification ends here.
-
--- Upgrade to schema 16.0 begins here:
+-- This line starts the schema upgrade to version 16.0.
 
 -- Add the allocator column to the DHCPv4 tables.
 ALTER TABLE dhcp4_subnet ADD COLUMN allocator TEXT DEFAULT NULL;
@@ -5637,11 +5627,21 @@ ALTER TABLE dhcp6_subnet ADD COLUMN pd_allocator TEXT DEFAULT NULL;
 ALTER TABLE dhcp6_shared_network ADD COLUMN allocator TEXT DEFAULT NULL;
 ALTER TABLE dhcp6_shared_network ADD COLUMN pd_allocator TEXT DEFAULT NULL;
 
--- Set 17.0 schema version.
+-- Update the schema version number.
+UPDATE schema_version
+    SET version = '16', minor = '0';
+
+-- This line concludes the schema upgrade to version 16.0.
+
+-- This line starts the schema upgrade to version 17.0.
+
+UPDATE lease6 SET duid = E'\\x000000' WHERE duid = E'\\x00';
+
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '17', minor = '0';
 
--- Schema 17.0 specification ends here.
+-- This line concludes the schema upgrade to version 17.0.
 
 -- Commit the script transaction.
 COMMIT;
index e5348b6ca9d9a6cdb399cc5d02b95b642a2fe1f2..b92e7716b2c4a16a55f08ba342da9eafd73f4ca7 100644 (file)
@@ -35,7 +35,7 @@ fi
 
 psql "$@" >/dev/null <<EOF
 
--- Upgrade to schema 2.0 begins here:
+-- This line starts the schema upgrade to version 2.0.
 
 -- Add state column to the lease4 table.
 ALTER TABLE lease4
@@ -168,14 +168,14 @@ CREATE FUNCTION lease6DumpData() RETURNS
 \$\$ LANGUAGE SQL;
 --
 
--- Set 2.0 schema version.
+-- Update the schema version number.
 START TRANSACTION;
 UPDATE schema_version
     SET version = '2', minor = '0';
 
--- Schema 2.0 specification ends here.
+-- This line concludes the schema upgrade to version 2.0.
 
--- Commit the script transaction
+-- Commit the script transaction.
 COMMIT;
 
 EOF
index 599859bf59c54c05fe30a2d736c1e7152f47e475..1924561add1e257700573d5a7c9d1a7b2f5a509c 100644 (file)
@@ -37,7 +37,7 @@ psql "$@" >/dev/null <<EOF
 
 START TRANSACTION;
 
--- Upgrade to schema 3.0 begins here:
+-- This line starts the schema upgrade to version 3.0.
 
 --
 -- Table structure for table host_identifier_type
@@ -281,13 +281,13 @@ ALTER TABLE hosts ADD COLUMN dhcp4_next_server BIGINT DEFAULT NULL;
 ALTER TABLE hosts ADD COLUMN dhcp4_server_hostname VARCHAR(64) DEFAULT NULL;
 ALTER TABLE hosts ADD COLUMN dhcp4_boot_file_name VARCHAR(128) DEFAULT NULL;
 
--- Set 3.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '3', minor = '0';
 
--- Schema 3.0 specification ends here.
+-- This line concludes the schema upgrade to version 3.0.
 
--- Commit the script transaction
+-- Commit the script transaction.
 COMMIT;
 
 EOF
index 1da6cb0b8cabca624fe3275c35693d8789fd2e2e..2f51e2cdc5ddb8e27a4bcd7e7d206f46af8080bf 100644 (file)
@@ -37,7 +37,7 @@ psql "$@" >/dev/null <<EOF
 
 START TRANSACTION;
 
--- Upgrade to schema 3.1 begins here:
+-- This line starts the schema upgrade to version 3.1.
 
 -- The 'client-id' host identifier type was missing in the
 -- 2.0 -> 3.0 upgrade script. However, it was present in the
@@ -53,13 +53,13 @@ INSERT INTO host_identifier_type (type, name)
 -- We also add a new identifier type: flex-id.
 INSERT INTO host_identifier_type VALUES (4, 'flex-id');
 
--- Set 3.1 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '3', minor = '1';
 
--- Schema 3.1 specification ends here.
+-- This line concludes the schema upgrade to version 3.1.
 
--- Commit the script transaction
+-- Commit the script transaction.
 COMMIT;
 
 EOF
index 757e90c251e63e0b4cc557b1d0ec1875bb5f7720..51eecee2acf023cfe42db55912404165109174b0 100644 (file)
@@ -37,7 +37,7 @@ psql "$@" >/dev/null <<EOF
 
 START TRANSACTION;
 
--- Upgrade to schema 3.2 begins here:
+-- This line starts the schema upgrade to version 3.2.
 
 -- Remove constraints which perform too restrictive checks on the inserted
 -- host reservations. We want to be able to insert host reservations which
@@ -68,13 +68,13 @@ CREATE UNIQUE INDEX hosts_dhcp6_identifier_subnet_id ON hosts
         (dhcp_identifier ASC, dhcp_identifier_type ASC, dhcp6_subnet_id ASC)
     WHERE (dhcp6_subnet_id IS NOT NULL AND dhcp6_subnet_id <> 0);
 
--- Set 3.2 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '3', minor = '2';
 
--- Schema 3.2 specification ends here.
+-- This line concludes the schema upgrade to version 3.2.
 
--- Commit the script transaction
+-- Commit the script transaction.
 COMMIT;
 
 EOF
index c6d7b16c10ab3e4030a115373751c00a0b5bbe4b..95aca7c42b2e88691f2af039dfc38e86d1a70c08 100644 (file)
@@ -37,7 +37,7 @@ psql "$@" >/dev/null <<EOF
 
 START TRANSACTION;
 
--- Upgrade to schema 3.3 begins here:
+-- This line starts the schema upgrade to version 3.3.
 
 -- Change subnet ID columns type to BIGINT to match lease4/6 tables
 ALTER TABLE hosts ALTER COLUMN dhcp4_subnet_id TYPE BIGINT;
@@ -46,13 +46,13 @@ ALTER TABLE hosts ALTER COLUMN dhcp6_subnet_id TYPE BIGINT;
 ALTER TABLE dhcp4_options ALTER COLUMN dhcp4_subnet_id TYPE BIGINT;
 ALTER TABLE dhcp6_options ALTER COLUMN dhcp6_subnet_id TYPE BIGINT;
 
--- Set 3.3 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '3', minor = '3';
 
--- Schema 3.3 specification ends here.
+-- This line concludes the schema upgrade to version 3.3.
 
--- Commit the script transaction
+-- Commit the script transaction.
 COMMIT;
 
 EOF
index f9a1754745af735416016bdf591b697e3d48fd2c..8dfb591fd33f34ee3c3e4f52356a77fb17bf5b49 100644 (file)
@@ -37,7 +37,7 @@ psql "$@" >/dev/null <<EOF
 
 START TRANSACTION;
 
--- Upgrade to schema 4.0 begins here:
+-- This line starts the schema upgrade to version 4.0.
 
 -- Add a column holding hosts for user context.
 ALTER TABLE hosts ADD COLUMN user_context TEXT;
@@ -251,13 +251,13 @@ INSERT INTO lease6_stat (subnet_id, lease_type, state, leases)
     GROUP BY subnet_id, lease_type, state
     ORDER BY subnet_id;
 
--- Set 4.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '4', minor = '0';
 
--- Schema 4.0 specification ends here.
+-- This line concludes the schema upgrade to version 4.0.
 
--- Commit the script transaction
+-- Commit the script transaction.
 COMMIT;
 
 EOF
index a64ffecc04f3706754fde2de29fbfb0f3526730c..90aa1a1ef041a677037627e66684ba95a3deae95 100644 (file)
@@ -37,7 +37,7 @@ psql "$@" >/dev/null <<EOF
 
 START TRANSACTION;
 
--- Upgrade to schema 5.0 begins here:
+-- This line starts the schema upgrade to version 5.0.
 
 -- Add a column holding leases for user context.
 ALTER TABLE lease4 ADD COLUMN user_context TEXT;
@@ -162,13 +162,13 @@ UPDATE dhcp4_options SET dhcp4_subnet_id = NULL WHERE dhcp4_subnet_id = 0;
 UPDATE hosts SET dhcp6_subnet_id = NULL WHERE dhcp6_subnet_id = 0;
 UPDATE dhcp6_options SET dhcp6_subnet_id = NULL WHERE dhcp6_subnet_id = 0;
 
--- Set 5.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '5', minor = '0';
 
--- Schema 5.0 specification ends here.
+-- This line concludes the schema upgrade to version 5.0.
 
--- Commit the script transaction
+-- Commit the script transaction.
 COMMIT;
 
 EOF
index 3883178ef1402897f5ed2c4da69d8578d708b2b9..7bd04edb1443b201ce07a2822b466af2769d5800 100644 (file)
@@ -37,18 +37,18 @@ psql "$@" >/dev/null <<EOF
 
 START TRANSACTION;
 
--- Upgrade to schema 5.1 begins here:
+-- This line starts the schema upgrade to version 5.1.
 
 -- Put the auth key in hexadecimal (double size but far more user friendly).
 ALTER TABLE hosts ALTER COLUMN auth_key TYPE VARCHAR(32);
 
--- Set 5.1 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '5', minor = '1';
 
--- Schema 5.1 specification ends here.
+-- This line concludes the schema upgrade to version 5.1.
 
--- Commit the script transaction
+-- Commit the script transaction.
 COMMIT;
 
 EOF
index 356562c0e6099ee1b80958710465df207828a0e4..3918582449f64f7c10fba6834a99a27754e7e673 100644 (file)
@@ -37,7 +37,7 @@ psql "$@" >/dev/null <<EOF
 
 START TRANSACTION;
 
--- Upgrade to schema 6.0 begins here:
+-- This line starts the schema upgrade to version 6.0.
 
 -- Create a lower case hostname index for hosts.
 CREATE INDEX hosts_by_hostname ON hosts (lower(hostname))
@@ -61,13 +61,13 @@ WHERE hostname IS NOT NULL;
 -- UPDATE lease6 SET hostname = lower(hostname)
 -- WHERE lower(hostname) != hostname;
 
--- Set 6.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '6', minor = '0';
 
--- Schema 6.0 specification ends here.
+-- This line concludes the schema upgrade to version 6.0.
 
--- Commit the script transaction
+-- Commit the script transaction.
 COMMIT;
 
 EOF
index beaf8b6f5d2a9ff6475c9db0dec072587142b83a..e95563c8c4089c06b05bbf8b3e5e92aaeb725bc9 100644 (file)
@@ -37,7 +37,7 @@ psql "$@" >/dev/null <<EOF
 
 START TRANSACTION;
 
--- Upgrade to schema 6.1 begins here:
+-- This line starts the schema upgrade to version 6.1.
 
 -- Fix v4 update trigger procedure
 CREATE OR REPLACE FUNCTION proc_stat_lease4_update () RETURNS trigger AS \$stat_lease4_update\$
@@ -129,13 +129,13 @@ BEGIN
 END;
 \$stat_lease6_delete\$ LANGUAGE plpgsql;
 
--- Set 6.1 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '6', minor = '1';
 
--- Schema 6.1 specification ends here.
+-- This line concludes the schema upgrade to version 6.1.
 
--- Commit the script transaction
+-- Commit the script transaction.
 COMMIT;
 
 EOF
index 11776f683886fb50262d3764bfc85018c77ed954..decffdd06a2d012e6d3a03f9a772fbc6a98292db 100644 (file)
@@ -35,7 +35,7 @@ fi
 
 psql "$@" >/dev/null <<EOF
 
--- Upgrade to schema 6.2 begins here:
+-- This line starts the schema upgrade to version 6.2.
 
 -- Starting from this version we allow specifying multiple IP reservations
 -- for the same address in certain DHCP configurations. The server may check
@@ -61,13 +61,13 @@ ALTER TABLE ipv6_reservations DROP CONSTRAINT IF EXISTS key_dhcp6_address_prefix
 CREATE INDEX key_dhcp6_address_prefix_len
     ON ipv6_reservations (address ASC, prefix_len ASC);
 
--- Set 6.2 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '6', minor = '2';
 
--- Schema 6.2 specification ends here.
+-- This line concludes the schema upgrade to version 6.2.
 
--- Commit the script transaction
+-- Commit the script transaction.
 COMMIT;
 
 EOF
index e39f99bdd16c9595316ec27be428b4d011529202..ab1b2734c9bc76d49bcea1139176637740bfec0d 100644 (file)
@@ -37,7 +37,7 @@ psql "$@" >/dev/null <<EOF
 
 START TRANSACTION;
 
--- Upgrade to schema 7.0 begins here:
+-- This line starts the schema upgrade to version 7.0.
 
 -- Add a lot (20+) of tables for the config backend.
 
@@ -2734,13 +2734,13 @@ END;
 \$dhcp6_pd_pool_BDEL\$
 LANGUAGE plpgsql;
 
--- Set 7.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '7', minor = '0';
 
--- Schema 7.0 specification ends here.
+-- This line concludes the schema upgrade to version 7.0.
 
--- Commit the script transaction
+-- Commit the script transaction.
 COMMIT;
 
 EOF
index c08150ebbcdc0304f9968d4189c0c0deb8dd0c55..7931323ddb0480e00370893cd93fbbffb189d6bc 100644 (file)
@@ -36,7 +36,7 @@ fi
 psql "$@" >/dev/null <<EOF
 START TRANSACTION;
 
--- Upgrade to schema 8.0 begins here:
+-- This line starts the schema upgrade to version 8.0.
 
 -- Adds a few missing elements for CB and functions for kea-admin's lease-dump
 -- and lease-upload commands.
@@ -506,10 +506,12 @@ BEGIN
 END
 \$\$ LANGUAGE plpgsql;
 
--- Set 8.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '8', minor = '0';
 
+-- This line concludes the schema upgrade to version 8.0.
+
 -- Commit the script transaction.
 COMMIT;
 
index c6a470b85f7ab80784012aa4e6af38ad4059dc50..07daaeecd227b7f465ec92c06a79671b97a44a37 100644 (file)
@@ -36,7 +36,7 @@ fi
 psql "$@" >/dev/null <<EOF
 START TRANSACTION;
 
--- Upgrade to schema 9.0 begins here:
+-- This line starts the schema upgrade to version 9.0.
 
 -- Add missing cascade to constraint on dhcp4/6_subnet_server tables.
 ALTER TABLE dhcp4_subnet_server
@@ -282,11 +282,11 @@ BEGIN
 END;\$\$
 LANGUAGE plpgsql;
 
--- Set 9.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '9', minor = '0';
 
--- Schema 9.0 specification ends here.
+-- This line concludes the schema upgrade to version 9.0.
 
 -- Commit the script transaction.
 COMMIT;
index 5bdb52ae5292d746e3bf6ce91d6a6b9fb73912e0..95741c74fd96dc4b10520d092e412126d2872f99 100644 (file)
@@ -36,7 +36,7 @@ fi
 psql "$@" >/dev/null <<EOF
 START TRANSACTION;
 
--- Upgrade to schema 10.0 begins here:
+-- This line starts the schema upgrade to version 10.0.
 
 -- It adds corrections for client classes for CB
 
@@ -326,11 +326,11 @@ END;
 \$dhcp6_client_class_check_dependency_BINS\$
 LANGUAGE plpgsql;
 
--- Set 10.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '10', minor = '0';
 
--- Schema 10.0 specification ends here.
+-- This line concludes the schema upgrade to version 10.0.
 
 -- Commit the script transaction.
 COMMIT;
index 772ec2f10ff09ae6aaf551bbac9a97b545b4db49..2c9373b718bf322660ce03fa6fc162e1f5f992f2 100644 (file)
@@ -36,7 +36,7 @@ fi
 psql "$@" >/dev/null <<EOF
 START TRANSACTION;
 
--- Upgrade to schema 11.0 begins here:
+-- This line starts the schema upgrade to version 11.0.
 
 -- Replace createOptionAuditDHCP6() with a version corrected
 -- where clause when scope is 6 (i.e. PD pool)
@@ -142,11 +142,11 @@ BEGIN
     RETURN;
 END;\$\$;
 
--- Set 11.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '11', minor = '0';
 
--- Schema 11.0 specification ends here.
+-- This line concludes the schema upgrade to version 11.0.
 
 -- Commit the script transaction.
 COMMIT;
index d3a672258c0671c3e2af228d95a7397cfdc31728..db4816f0aeedbb559ea5a14e6bfbfe436731e477 100644 (file)
@@ -36,7 +36,7 @@ fi
 psql "$@" >/dev/null <<EOF
 START TRANSACTION;
 
--- Upgrade to schema 12.0 begins here:
+-- This line starts the schema upgrade to version 12.0.
 
 -- Modify shared-network-name foreign key constraint on dhcp4_subnet to not perform
 -- the update when the network is deleted the cascaded update will not execute
@@ -94,11 +94,11 @@ LANGUAGE plpgsql;
 ALTER TABLE dhcp4_client_class ADD COLUMN user_context JSON DEFAULT NULL;
 ALTER TABLE dhcp6_client_class ADD COLUMN user_context JSON DEFAULT NULL;
 
--- Set 12.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '12', minor = '0';
 
--- Schema 12.0 specification ends here.
+-- This line concludes the schema upgrade to version 12.0.
 
 -- Commit the script transaction.
 COMMIT;
index 03053b8740b27c2b6ab86bd0685f060b7e7afc53..775e9c3a08f572b8bc96b65b951b1c7ea25b7860 100644 (file)
@@ -36,7 +36,7 @@ fi
 psql "$@" >/dev/null <<EOF
 START TRANSACTION;
 
--- Upgrade to schema 13.0 begins here:
+-- This line starts the schema upgrade to version 13.0.
 
 -- JSON functions --
 
@@ -669,11 +669,11 @@ CREATE UNIQUE INDEX key_dhcp6_identifier_subnet_id ON hosts
         (dhcp_identifier ASC, dhcp_identifier_type ASC, dhcp6_subnet_id ASC)
     WHERE (dhcp6_subnet_id IS NOT NULL);
 
--- Set 13.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '13', minor = '0';
 
--- Schema 13.0 specification ends here.
+-- This line concludes the schema upgrade to version 13.0.
 
 -- Commit the script transaction.
 COMMIT;
index 413b82eec5b6f2999ce8aedd61f8dfbf8067feac..4c13e2d44bb562c03bc006ccad9243fa6ce86600 100644 (file)
@@ -36,7 +36,7 @@ fi
 psql "$@" >/dev/null <<EOF
 START TRANSACTION;
 
--- Upgrade to schema 14.0 begins here:
+-- This line starts the schema upgrade to version 14.0.
 
 -- Add cancelled (aka never-send) column to option tables.
 
@@ -53,11 +53,11 @@ ALTER TABLE dhcp4_subnet
 ALTER TABLE dhcp4_client_class
     ADD COLUMN offer_lifetime BIGINT DEFAULT NULL;
 
--- Set 14.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '14', minor = '0';
 
--- Schema 14.0 specification ends here.
+-- This line concludes the schema upgrade to version 14.0.
 
 -- Commit the script transaction.
 COMMIT;
index 99056aeee445494fccf5e2420806cb3bd6243acb..340845bca8cab5189faf79d5db89a23450483cc3 100644 (file)
@@ -36,7 +36,7 @@ fi
 psql "$@" >/dev/null <<EOF
 START TRANSACTION;
 
--- Upgrade to schema 15.0 begins here:
+-- This line starts the schema upgrade to version 15.0.
 
 -- Add relay and remote id columns to DHCPv4 leases.
 --
@@ -50,11 +50,11 @@ ALTER TABLE lease4
 CREATE INDEX lease4_by_relay_id ON lease4 (relay_id);
 CREATE INDEX lease4_by_remote_id ON lease4 (remote_id);
 
--- Set 15.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '15', minor = '0';
 
--- Schema 15.0 specification ends here.
+-- This line concludes the schema upgrade to version 15.0.
 
 -- Commit the script transaction.
 COMMIT;
index 4603c2fef8116e193db7d28a7d91df893a604a55..826cd693e7dc2d22bda05787b07943751b732d0b 100644 (file)
@@ -36,7 +36,7 @@ fi
 psql "$@" >/dev/null <<EOF
 START TRANSACTION;
 
--- Upgrade to schema 16.0 begins here:
+-- This line starts the schema upgrade to version 16.0.
 
 -- Add the allocator column to the DHCPv4 tables.
 ALTER TABLE dhcp4_subnet ADD COLUMN allocator TEXT DEFAULT NULL;
@@ -50,11 +50,11 @@ ALTER TABLE dhcp6_subnet ADD COLUMN pd_allocator TEXT DEFAULT NULL;
 ALTER TABLE dhcp6_shared_network ADD COLUMN allocator TEXT DEFAULT NULL;
 ALTER TABLE dhcp6_shared_network ADD COLUMN pd_allocator TEXT DEFAULT NULL;
 
--- Set 16.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '16', minor = '0';
 
--- Schema 16.0 specification ends here.
+-- This line concludes the schema upgrade to version 16.0.
 
 -- Commit the script transaction.
 COMMIT;
index 51016c9d77625baf3c123e0220779f52be5fcbf6..b3dffaba6220ec07946e6932561935f2475f352c 100644 (file)
@@ -36,15 +36,15 @@ fi
 psql "$@" >/dev/null <<EOF
 START TRANSACTION;
 
--- Upgrade to schema 17.0 begins here:
+-- This line starts the schema upgrade to version 17.0.
 
 UPDATE lease6 SET duid = E'\\\\x000000' WHERE duid = E'\\\\x00';
 
--- Set 17.0 schema version.
+-- Update the schema version number.
 UPDATE schema_version
     SET version = '17', minor = '0';
 
--- Schema 17.0 specification ends here.
+-- This line concludes the schema upgrade to version 17.0.
 
 -- Commit the script transaction.
 COMMIT;