aboutsummaryrefslogtreecommitdiff
path: root/odb/schema-catalog.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/schema-catalog.hxx')
-rw-r--r--odb/schema-catalog.hxx24
1 files changed, 17 insertions, 7 deletions
diff --git a/odb/schema-catalog.hxx b/odb/schema-catalog.hxx
index a186de4..07e625b 100644
--- a/odb/schema-catalog.hxx
+++ b/odb/schema-catalog.hxx
@@ -52,28 +52,38 @@ namespace odb
migrate_schema_impl (db, v, name, migrate_both);
}
+ // Migrate both schema and data to the specified version. If version
+ // is not specified, then migrate to the latest version.
+ //
+ static void
+ migrate (database& db, schema_version v = 0, const std::string& name = "");
+
// Return 0 if current is greater or equal to the latest version.
+ // If current is not specified, get the current version from the
+ // database.
//
- schema_version
+ static schema_version
next_version (const database& db,
- schema_version current /*= 0*/,
+ schema_version current = 0,
const std::string& name = "")
{
- return next_version (db.id (), current, name);
+ return next_version (db.id (),
+ current == 0 ? db.schema_version () : current,
+ name);
}
- schema_version
+ static schema_version
next_version (database_id,
- schema_version current /*= 0*/,
+ schema_version current,
const std::string& name = "");
- schema_version
+ static schema_version
latest_version (const database& db, const std::string& name = "")
{
return latest_version (db.id (), name);
}
- schema_version
+ static schema_version
latest_version (database_id, const std::string& name = "");
// Test for presence of a schema with a specific name.