aboutsummaryrefslogtreecommitdiff
path: root/odb/schema-catalog.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-09-28 08:41:17 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-09-28 08:41:17 +0200
commit2e258ea80deae21b478c6aa8deae50bd24194c11 (patch)
treef67b51509a204ed3bf80db0be8a63f5e64d5f6f0 /odb/schema-catalog.cxx
parent4553b663da99e37b4b80251fdb8906ef8944a42e (diff)
Return number of calls made from migrate_data()
Can be useful for debugging/tracing.
Diffstat (limited to 'odb/schema-catalog.cxx')
-rw-r--r--odb/schema-catalog.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/odb/schema-catalog.cxx b/odb/schema-catalog.cxx
index 8a5ce71..15cdcb9 100644
--- a/odb/schema-catalog.cxx
+++ b/odb/schema-catalog.cxx
@@ -194,13 +194,13 @@ namespace odb
db.schema_version_migration (v, m == migrate_pre, name);
}
- void schema_catalog::
+ size_t schema_catalog::
migrate_data (database& db, schema_version v, const string& name)
{
if (v == 0)
{
if (!db.schema_migration ())
- return;
+ return 0;
v = db.schema_version ();
}
@@ -209,16 +209,22 @@ namespace odb
data_map::const_iterator i (c.data.find (data_key (name, v)));
if (i == c.data.end ())
- return; // No data migration for this schema/version.
+ return 0; // No data migration for this schema/version.
- const data_functions& df (i->second);
+ size_t r (0);
+ const data_functions& df (i->second);
for (data_functions::const_iterator i (df.begin ()), e (df.end ());
i != e; ++i)
{
if (i->id == id_common || i->id == db.id ())
+ {
i->migrate (db);
+ r++;
+ }
}
+
+ return r;
}
void schema_catalog::