From 7c3e06b937e57bf57216b5c63b538d27da005227 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 27 Aug 2013 08:20:23 +0200 Subject: Add support for getting version and migration flag in one structure --- odb/database.ixx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'odb/database.ixx') diff --git a/odb/database.ixx b/odb/database.ixx index 066afd6..817aebe 100644 --- a/odb/database.ixx +++ b/odb/database.ixx @@ -24,19 +24,22 @@ namespace odb inline database::schema_version_type database:: schema_version (const std::string& name) const { - schema_version_map::const_iterator i (schema_version_map_.find (name)); - return i != schema_version_map_.end () && i->second.version != 0 - ? i->second.version - : load_schema_version (name).version; + return schema_version_migration (name).version; } inline bool database:: schema_migration (const std::string& name) const { + return schema_version_migration (name).migration; + } + + inline const database::schema_version_migration_type& database:: + schema_version_migration (const std::string& name) const + { schema_version_map::const_iterator i (schema_version_map_.find (name)); return i != schema_version_map_.end () && i->second.version != 0 - ? i->second.migration - : load_schema_version (name).migration; + ? i->second + : load_schema_version (name); } inline void database:: -- cgit v1.1