From 247ebd5e7b987c180fbd896af4b9d29808e3c0d1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 23 Jul 2020 13:01:53 +0300 Subject: Drop all database migrations to be backward compatible with only 0.13.0 (one minor version behind) --- libbrep/build-extra.sql | 6 - libbrep/build.hxx | 9 +- libbrep/build.xml | 81 ++++++------- libbrep/package.hxx | 2 +- libbrep/package.xml | 314 +++++------------------------------------------- migrate/migrate.cxx | 32 +---- 6 files changed, 81 insertions(+), 363 deletions(-) diff --git a/libbrep/build-extra.sql b/libbrep/build-extra.sql index a61f415..ddc5961 100644 --- a/libbrep/build-extra.sql +++ b/libbrep/build-extra.sql @@ -18,12 +18,6 @@ DROP FOREIGN TABLE IF EXISTS build_repository; DROP FOREIGN TABLE IF EXISTS build_tenant; --- @@ TMP Also drop tables that are removed in 12 schema version. Drop these --- statements after 0.13.0 is released. --- -DROP FOREIGN TABLE IF EXISTS build_package_benchmarks; -DROP FOREIGN TABLE IF EXISTS build_package_examples; - -- The foreign table for build_tenant object. -- CREATE FOREIGN TABLE build_tenant ( diff --git a/libbrep/build.hxx b/libbrep/build.hxx index 1041805..380b17b 100644 --- a/libbrep/build.hxx +++ b/libbrep/build.hxx @@ -23,7 +23,7 @@ // Used by the data migration entries. // -#define LIBBREP_BUILD_SCHEMA_VERSION_BASE 9 +#define LIBBREP_BUILD_SCHEMA_VERSION_BASE 12 #pragma db model version(LIBBREP_BUILD_SCHEMA_VERSION_BASE, 12, closed) @@ -254,7 +254,12 @@ namespace brep // #pragma db member(timestamp) index - // @@ TMP remove when 0.13.0 is released. + // This is not required since 0.14.0. Note however, that just dropping + // this line won't pan out since this would require migration which odb is + // currently unable to handle automatically, advising to re-implement this + // change by adding a new data member with the desired default value, + // migrating the data, and deleting the old data member. This sounds a bit + // hairy, so let's keep it for now. // #pragma db member(completion_timestamp) default(0) diff --git a/libbrep/build.xml b/libbrep/build.xml index 03d60e7..3af7640 100644 --- a/libbrep/build.xml +++ b/libbrep/build.xml @@ -1,49 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -65,6 +21,7 @@ + @@ -151,5 +108,39 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/libbrep/package.hxx b/libbrep/package.hxx index 65408a8..33444a9 100644 --- a/libbrep/package.hxx +++ b/libbrep/package.hxx @@ -18,7 +18,7 @@ // Used by the data migration entries. // -#define LIBBREP_PACKAGE_SCHEMA_VERSION_BASE 17 +#define LIBBREP_PACKAGE_SCHEMA_VERSION_BASE 19 #pragma db model version(LIBBREP_PACKAGE_SCHEMA_VERSION_BASE, 19, closed) diff --git a/libbrep/package.xml b/libbrep/package.xml index e650555..454cdbc 100644 --- a/libbrep/package.xml +++ b/libbrep/package.xml @@ -1,85 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -247,6 +167,7 @@ + @@ -672,27 +593,28 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -726,189 +648,19 @@ - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - + + + + + + + diff --git a/migrate/migrate.cxx b/migrate/migrate.cxx index 0ef6096..88c87c1 100644 --- a/migrate/migrate.cxx +++ b/migrate/migrate.cxx @@ -206,6 +206,7 @@ create (database& db, bool extra_only) const // Register the data migration functions for the package database schema. // +#if 0 template using package_migration_entry_base = data_migration_entry; @@ -217,36 +218,11 @@ struct package_migration_entry: package_migration_entry_base : package_migration_entry_base (f, "package") {} }; -// Set the unbuildable reason for unbuildable packages. -// -// Note that we are unable to restore the exact reason and so always set it -// to 'unbuildable'. -// -// Also note that we don't set the buildable flag to false for the separate -// test packages here. Implementing this properly in the data migration feels -// hairy (see load/load.cxx for details). Instead we rely on brep-load to -// handle this on the next tenant reload that can be enforced by using the -// --force option. -// -//#if 0 -static const package_migration_entry<18> -package_migrate_v18 ([] (database& db) -{ - db.execute ("UPDATE package SET unbuildable_reason = 'unbuildable' " - "WHERE NOT buildable"); -}); -//#endif - -// Merging the package examples and benchmarks tables into the package tests -// table is a bit hairy. Thus, we won't bother with that and just cleanup the -// amended package tests table, relying on the loader to fill it in a short -// time. -// -static const package_migration_entry<19> -package_migrate_v19 ([] (database& db) +static const package_migration_entry<20> +package_migrate_v20 ([] (database& db) { - db.execute ("DELETE from package_tests"); }); +#endif // main() function // -- cgit v1.1