Commit 732505e5 authored by Francis Dupont's avatar Francis Dupont

[#1196] Renamed PG_SCHEMA_VERSION_XXX

parent 845164ff
......@@ -2035,8 +2035,8 @@ PgSqlHostDataSourceImpl::PgSqlHostDataSourceImpl(const PgSqlConnection::Paramete
: parameters_(parameters) {
// Validate the schema version first.
std::pair<uint32_t, uint32_t> code_version(PG_SCHEMA_VERSION_MAJOR,
PG_SCHEMA_VERSION_MINOR);
std::pair<uint32_t, uint32_t> code_version(PGSQL_SCHEMA_VERSION_MAJOR,
PGSQL_SCHEMA_VERSION_MINOR);
std::pair<uint32_t, uint32_t> db_version = getVersion();
if (code_version != db_version) {
isc_throw(DbOpenError,
......
......@@ -1212,8 +1212,8 @@ PgSqlLeaseMgr::PgSqlLeaseMgr(const DatabaseConnection::ParameterMap& parameters)
: parameters_(parameters) {
// Validate schema version first.
std::pair<uint32_t, uint32_t> code_version(PG_SCHEMA_VERSION_MAJOR,
PG_SCHEMA_VERSION_MINOR);
std::pair<uint32_t, uint32_t> code_version(PGSQL_SCHEMA_VERSION_MAJOR,
PGSQL_SCHEMA_VERSION_MINOR);
std::pair<uint32_t, uint32_t> db_version = getVersion();
if (code_version != db_version) {
isc_throw(DbOpenError,
......@@ -1263,8 +1263,8 @@ PgSqlLeaseMgr::createContext() const {
std::string
PgSqlLeaseMgr::getDBVersion() {
std::stringstream tmp;
tmp << "PostgreSQL backend " << PG_SCHEMA_VERSION_MAJOR;
tmp << "." << PG_SCHEMA_VERSION_MINOR;
tmp << "PostgreSQL backend " << PGSQL_SCHEMA_VERSION_MAJOR;
tmp << "." << PGSQL_SCHEMA_VERSION_MINOR;
tmp << ", library " << PQlibVersion();
return (tmp.str());
}
......
......@@ -246,8 +246,8 @@ TEST_F(PgSqlLeaseMgrTest, checkVersion) {
// Check version
pair<uint32_t, uint32_t> version;
ASSERT_NO_THROW(version = lmptr_->getVersion());
EXPECT_EQ(PG_SCHEMA_VERSION_MAJOR, version.first);
EXPECT_EQ(PG_SCHEMA_VERSION_MINOR, version.second);
EXPECT_EQ(PGSQL_SCHEMA_VERSION_MAJOR, version.first);
EXPECT_EQ(PGSQL_SCHEMA_VERSION_MINOR, version.second);
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -18,8 +18,8 @@ namespace isc {
namespace db {
/// @brief Define PostgreSQL backend version: 6.1
const uint32_t PG_SCHEMA_VERSION_MAJOR = 6;
const uint32_t PG_SCHEMA_VERSION_MINOR = 1;
const uint32_t PGSQL_SCHEMA_VERSION_MAJOR = 6;
const uint32_t PGSQL_SCHEMA_VERSION_MINOR = 1;
// Maximum number of parameters that can be used a statement
// @todo This allows us to use an initializer list (since we can't
......
// Copyright (C) 2016-2019 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2016-2020 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
......@@ -56,7 +56,7 @@ bool wipePgSQLData(bool show_err) {
cmd << " sh " << DATABASE_SCRIPTS_DIR << "/pgsql/wipe_data.sh";
// Add expected schema version as the wipe script's first argument.
cmd << " " << PG_SCHEMA_VERSION_MAJOR << "." << PG_SCHEMA_VERSION_MINOR;
cmd << " " << PGSQL_SCHEMA_VERSION_MAJOR << "." << PGSQL_SCHEMA_VERSION_MINOR;
// Now add command line arguments for psql.
cmd << " --set ON_ERROR_STOP=1 -A -t -h localhost -q -U keatest -d keatest";
......
// Copyright (C) 2016-2019 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2016-2020 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
......@@ -76,8 +76,8 @@ void createPgSQLSchema(bool show_err = false, bool force = false);
/// <TEST_ADMIN_SCRIPTS_DIR>/pgsql/wipe_data.sh
///
/// This will fail if there is no schema, if the existing schema
/// version is incorrect (i.e. does not match PG_SCHEMA_VERSION_MAJOR
/// and PG_SCHEMA_VERSION_MINOR), or a SQL error occurs. Otherwise,
/// version is incorrect (i.e. does not match PGSQL_SCHEMA_VERSION_MAJOR
/// and PGSQL_SCHEMA_VERSION_MINOR), or a SQL error occurs. Otherwise,
/// the script is should delete all transient data, leaving intact
/// reference tables.
///
......
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