aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-07-23 13:17:20 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-07-23 13:17:20 +0300
commitedb9d402dca2abaa2c03efe341015771590187e8 (patch)
tree3e8bc893399f133d5085182dd6840f311cfdadfa
parent9ab24e671b1820936ad404e87a02e1d483713459 (diff)
Drop all database migrations to be backward compatible with 0.12.0 and above (two minor versions behind)
-rw-r--r--bpkg/database.cxx32
-rw-r--r--bpkg/package.hxx2
-rw-r--r--bpkg/package.xml4
3 files changed, 6 insertions, 32 deletions
diff --git a/bpkg/database.cxx b/bpkg/database.cxx
index 2ede577..7ba19f0 100644
--- a/bpkg/database.cxx
+++ b/bpkg/database.cxx
@@ -41,39 +41,15 @@ namespace bpkg
// Register the data migration functions.
//
+#if 0
template <odb::schema_version v>
using migration_entry = odb::data_migration_entry<v, DB_SCHEMA_VERSION_BASE>;
- static const migration_entry<6>
- migrate_v6 ([] (odb::database& db)
+ static const migration_entry<8>
+ migrate_v8 ([] (odb::database& db)
{
- // Set the zero version revision to NULL.
- //
- auto migrate_rev = [&db] (const char* table, const char* column)
- {
- db.execute (string ("UPDATE ") + table + " SET " + column + " = NULL " +
- "WHERE " + column + " = 0");
- };
-
- // The version package manifest value. Note: is not part of a primary key.
- //
- migrate_rev ("selected_package", "version_revision");
-
- // The depends package manifest value endpoint versions.
- //
- // Note that previously the zero and absent revisions had the same
- // semantics. Now the semantics differs and the zero revision is preserved
- // (see libbpkg/manifest.hxx for details).
- //
- migrate_rev ("selected_package_prerequisites", "min_version_revision");
- migrate_rev ("selected_package_prerequisites", "max_version_revision");
-
- migrate_rev ("available_package_dependency_alternatives",
- "dep_min_version_revision");
-
- migrate_rev ("available_package_dependency_alternatives",
- "dep_max_version_revision");
});
+#endif
database
open (const dir_path& d, tracer& tr, bool create)
diff --git a/bpkg/package.hxx b/bpkg/package.hxx
index f10e670..e7379b3 100644
--- a/bpkg/package.hxx
+++ b/bpkg/package.hxx
@@ -25,7 +25,7 @@
// Used by the data migration entries.
//
-#define DB_SCHEMA_VERSION_BASE 5
+#define DB_SCHEMA_VERSION_BASE 6
#pragma db model version(DB_SCHEMA_VERSION_BASE, 7, closed)
diff --git a/bpkg/package.xml b/bpkg/package.xml
index ed5dd64..2b94c71 100644
--- a/bpkg/package.xml
+++ b/bpkg/package.xml
@@ -59,9 +59,7 @@
</add-table>
</changeset>
- <changeset version="6"/>
-
- <model version="5">
+ <model version="6">
<table name="repository_fragment" kind="object">
<column name="name" type="TEXT" null="true"/>
<column name="url" type="TEXT" null="true"/>