Commit 5336c37e authored by Francis Dupont's avatar Francis Dupont

[5584] Checkpoint: fixes

parent fe5098fd
......@@ -1492,7 +1492,7 @@ AC_CONFIG_FILES([Makefile
src/share/database/scripts/Makefile
src/share/database/scripts/cql/Makefile
src/share/database/scripts/cql/upgrade_1.0_to_2.0.sh
src/share/database/scripts/cql/upgrade_2.0_to_2.1.sh
src/share/database/scripts/cql/upgrade_2.0_to_3.0.sh
src/share/database/scripts/mysql/Makefile
src/share/database/scripts/mysql/upgrade_1.0_to_2.0.sh
src/share/database/scripts/mysql/upgrade_2.0_to_3.0.sh
......
......@@ -49,10 +49,10 @@ constexpr uint32_t CQL_DRIVER_VERSION_MAJOR = CASS_VERSION_MAJOR;
constexpr uint32_t CQL_DRIVER_VERSION_MINOR = CASS_VERSION_MINOR;
/// @}
/// Define CQL schema version: 2.1
/// Define CQL schema version: 3.0
/// @{
constexpr uint32_t CQL_SCHEMA_VERSION_MAJOR = 2u;
constexpr uint32_t CQL_SCHEMA_VERSION_MINOR = 1u;
constexpr uint32_t CQL_SCHEMA_VERSION_MAJOR = 3u;
constexpr uint32_t CQL_SCHEMA_VERSION_MINOR = 0u;
/// @}
/// @brief Defines a single statement or query
......
......@@ -222,6 +222,9 @@ struct Lease : public UserContext, public isc::data::CfgToElement {
/// @param probation_period lease lifetime will be set to this value
virtual void decline(uint32_t probation_period) = 0;
/// Avoid a clang spurious error
using isc::data::CfgToElement::toElement;
protected:
/// @brief Sets common (for v4 and v6) properties of the lease object.
......
......@@ -4,7 +4,7 @@ sqlscriptsdir = ${datarootdir}/${PACKAGE_NAME}/scripts/cql
sqlscripts_DATA = dhcpdb_create.cql
sqlscripts_DATA += dhcpdb_drop.cql
sqlscripts_DATA += upgrade_1.0_to_2.0.sh
sqlscripts_DATA += upgrade_2.0_to_2.1.sh
sqlscripts_DATA += upgrade_2.0_to_3.0.sh
sqlscripts_DATA += soft_wipe.cql
EXTRA_DIST = ${sqlscripts_DATA}
......@@ -274,7 +274,7 @@ INSERT INTO schema_version (version, minor) VALUES(2, 0);
-- This line concludes database upgrade to version 2.0
-- This line starts database upgrade to version 2.1
-- This line starts database upgrade to version 3.0
-- Add a column holding leases for user context.
ALTER TABLE lease4 ADD user_context text;
......@@ -293,7 +293,8 @@ CREATE TABLE IF NOT EXISTS logs (
-- Create search index for logs table
CREATE INDEX IF NOT EXISTS logsindex ON logs (address);
-- Cql requires primary keys in the WHERE here.
DELETE FROM schema_version WHERE version=2;
INSERT INTO schema_version (version, minor) VALUES(2, 1);
INSERT INTO schema_version (version, minor) VALUES(3, 0);
-- This line concludes database upgrade to version 2.1
-- This line concludes database upgrade to version 3.0
......@@ -12,12 +12,12 @@ fi
version=$(cql_version "$@")
if [ "${version}" != "2.0" ]; then
printf "This script upgrades 2.0 to 2.1. Reported version is %s. Skipping upgrade.\n" "${version}"
printf "This script upgrades 2.0 to 3.0. Reported version is %s. Skipping upgrade.\n" "${version}"
exit 0
fi
cqlsh "$@" <<EOF
-- This line starts database upgrade to version 2.1
-- This line starts database upgrade to version 3.0
-- Add a column holding leases for user context.
ALTER TABLE lease4 ADD user_context text;
......@@ -36,10 +36,11 @@ CREATE TABLE IF NOT EXISTS logs (
-- Create search index for logs table
CREATE INDEX IF NOT EXISTS logsindex ON logs (address);
-- Cql requires primary keys in the WHERE here.
DELETE FROM schema_version WHERE version=2;
INSERT INTO schema_version (version, minor) VALUES(2, 1);
INSERT INTO schema_version (version, minor) VALUES(3, 0);
-- This line concludes database upgrade to version 2.1
-- This line concludes database upgrade to version 3.0
EOF
exit $?
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