aboutsummaryrefslogtreecommitdiff
path: root/bpkg/database.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-12-16 16:40:17 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-01-17 18:45:14 +0300
commitf806768c53361f5404148cd4d216b10421a1288f (patch)
treec4990cc537d8635c0c77c59a10eeec9e8749f3f3 /bpkg/database.cxx
parentfaf999003af1d62e90b59791126dacedf7b28105 (diff)
Adapt to package manifest dependency classes change
Diffstat (limited to 'bpkg/database.cxx')
-rw-r--r--bpkg/database.cxx20
1 files changed, 20 insertions, 0 deletions
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<configuration> (odb::query<configuration>::id != 0))