From f806768c53361f5404148cd4d216b10421a1288f Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 16 Dec 2021 16:40:17 +0300 Subject: Adapt to package manifest dependency classes change --- bpkg/database.cxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'bpkg/database.cxx') diff --git a/bpkg/database.cxx b/bpkg/database.cxx index 08f8122..b0a673e 100644 --- a/bpkg/database.cxx +++ b/bpkg/database.cxx @@ -265,6 +265,21 @@ namespace bpkg "FROM \"main\".\"available_package_dependency_alternatives\""); }); + // @@ Since there is no proper support for dropping table columns not in + // SQLite prior to 3.35.5 nor in ODB, we will drop the + // available_package_dependencies.conditional column manually. We, + // however, cannot do it here since ODB will try to set the dropped + // column values to NULL at the end of migration. Thus, we will do it + // ad hoc after the below schema_catalog::migrate() call. + // + // NOTE: remove the mentioned ad hoc migration when removing this + // function. + // + static const migration_entry<14> + migrate_v14 ([] (odb::database&) + { + }); + static inline path cfg_path (const dir_path& d, bool create) { @@ -609,6 +624,11 @@ namespace bpkg for (const char** c (cs); *c != nullptr; ++c) drop ("available_package_dependency_alternatives", *c); } + + // @@ TMP See migrate_v14() for details. + // + if (sv < 14) + drop ("available_package_dependencies", "conditional"); } for (auto& c: query (odb::query::id != 0)) -- cgit v1.1