diff options
Diffstat (limited to 'odb/relational/schema.cxx')
-rw-r--r-- | odb/relational/schema.cxx | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/odb/relational/schema.cxx b/odb/relational/schema.cxx index 2cf1a4c..b7498f6 100644 --- a/odb/relational/schema.cxx +++ b/odb/relational/schema.cxx @@ -53,6 +53,14 @@ namespace relational model->traverse (*ctx.model); } + + if (ctx.model->version () != 0 && + !ctx.options.suppress_schema_version ()) + { + instance<version_table> vt (*em, emos, f); + vt->create_table (); + vt->drop (); + } } void @@ -79,6 +87,17 @@ namespace relational model->traverse (*ctx.model); } + + if (ctx.model->version () != 0 && + !ctx.options.suppress_schema_version ()) + { + instance<version_table> vt (*em, emos, f); + + if (ctx.options.omit_drop ()) + vt->create_table (); + + vt->create (ctx.model->version ()); + } } void @@ -109,6 +128,12 @@ namespace relational changeset->traverse (cs); } + + if (!ctx.options.suppress_schema_version ()) + { + instance<version_table> vt (*em, emos, f); + vt->migrate_pre (cs.version ()); + } } void @@ -139,6 +164,12 @@ namespace relational changeset->traverse (cs); } + + if (!ctx.options.suppress_schema_version ()) + { + instance<version_table> vt (*em, emos, f); + vt->migrate_post (); + } } } } |