diff options
Diffstat (limited to 'migrate/migrate.cxx')
-rw-r--r-- | migrate/migrate.cxx | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/migrate/migrate.cxx b/migrate/migrate.cxx index c1f4dc1..090fcac 100644 --- a/migrate/migrate.cxx +++ b/migrate/migrate.cxx @@ -1,5 +1,4 @@ // file : migrate/migrate.cxx -*- C++ -*- -// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #include <strings.h> // strcasecmp() @@ -13,8 +12,10 @@ #include <odb/pgsql/database.hxx> -#include <libbutl/pager.mxx> +#include <libbutl/pager.hxx> +#include <libbrep/build.hxx> +#include <libbrep/build-odb.hxx> #include <libbrep/package.hxx> #include <libbrep/package-odb.hxx> #include <libbrep/database-lock.hxx> @@ -114,7 +115,7 @@ schema (const char* s, string name) string kw; i >> kw; - statement += " " + kw; + statement += ' ' + kw; if (strcasecmp (kw.c_str (), "FUNCTION") == 0) { @@ -132,7 +133,7 @@ schema (const char* s, string name) else if (strcasecmp (kw.c_str (), "FOREIGN") == 0) { i >> kw; - statement += " " + kw; + statement += ' ' + kw; valid = strcasecmp (kw.c_str (), "TABLE") == 0; // Fall through. @@ -219,8 +220,28 @@ struct package_migration_entry: package_migration_entry_base<v> : package_migration_entry_base<v> (f, "package") {} }; -static const package_migration_entry<18> -package_migrate_v18 ([] (database& db) +static const package_migration_entry<26> +package_migrate_v26 ([] (database& db) +{ +}); +#endif + +// Register the data migration functions for the build database schema. +// +#if 0 +template <schema_version v> +using build_migration_entry_base = + data_migration_entry<v, LIBBREP_BUILD_SCHEMA_VERSION_BASE>; + +template <schema_version v> +struct build_migration_entry: build_migration_entry_base<v> +{ + build_migration_entry (void (*f) (database& db)) + : build_migration_entry_base<v> (f, "build") {} +}; + +static const build_migration_entry<19> +build_migrate_v19 ([] (database& db) { }); #endif @@ -243,7 +264,7 @@ try << "libbbot " << LIBBBOT_VERSION_ID << endl << "libbpkg " << LIBBPKG_VERSION_ID << endl << "libbutl " << LIBBUTL_VERSION_ID << endl - << "Copyright (c) 2014-2019 Code Synthesis Ltd" << endl + << "Copyright (c) " << BREP_COPYRIGHT << "." << endl << "This is free software released under the MIT license." << endl; return 0; @@ -301,12 +322,12 @@ try ops.db_port (), "options='-c default_transaction_isolation=serializable'"); - // Prevent several brep-migrate/load instances from updating DB + // Prevent several brep utility instances from updating the database // simultaneously. // database_lock l (db); - // Currently we don't support data migration for the manual database scheme + // Currently we don't support data migration for the manual database schema // migration. // if (db.schema_migration (db_schema)) |