From 07ab59a93f9447d5489743e8d7e19b6adb5ebbf1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 9 Jul 2021 20:55:15 +0300 Subject: Add support for configuration type and bdep-config-link sub-command --- bdep/database.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'bdep/database.cxx') diff --git a/bdep/database.cxx b/bdep/database.cxx index 5e0aea5..064f9ed 100644 --- a/bdep/database.cxx +++ b/bdep/database.cxx @@ -8,6 +8,8 @@ #include +#include +#include #include #include @@ -18,6 +20,22 @@ namespace bdep using namespace odb::sqlite; using odb::schema_catalog; + // Register the data migration functions. + // + template + using migration_entry = odb::data_migration_entry; + + static const migration_entry<2> + migrate_v2 ([] (odb::database& db) + { + for (const shared_ptr& c: + pointer_result (db.query ())) + { + c->type = "target"; + db.update (c); + } + }); + database open (const dir_path& d, tracer& tr, bool create) { -- cgit v1.1