From 6fce0f81df649b1d9086fe089304372858ce38ee Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 5 Oct 2013 11:21:32 +0200 Subject: Add schema_catalog::base_version() for completeness --- odb/schema-catalog.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'odb/schema-catalog.cxx') diff --git a/odb/schema-catalog.cxx b/odb/schema-catalog.cxx index bec13a7..7205ff6 100644 --- a/odb/schema-catalog.cxx +++ b/odb/schema-catalog.cxx @@ -283,6 +283,20 @@ namespace odb } schema_version schema_catalog:: + base_version (database_id id, const string& name) + { + const schema_catalog_impl& c (*schema_catalog_init::catalog); + schema_map::const_iterator i (c.schema.find (key (id, name))); + + if (i == c.schema.end ()) + throw unknown_schema (name); + + const version_map& vm (i->second.migrate); + assert (!vm.empty ()); + return vm.begin ()->first; + } + + schema_version schema_catalog:: current_version (database_id id, const string& name) { const schema_catalog_impl& c (*schema_catalog_init::catalog); -- cgit v1.1