diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-04-26 15:54:19 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-04-26 15:54:19 +0200 |
commit | 84cb9f184bc24ef7151ab9931b46311b03219b14 (patch) | |
tree | db976c22d0dfacdf7ceae4e0d27f4f1615bf5cb0 /odb/relational/changelog.cxx | |
parent | 436031d026eb004865faaa21af5213a6f89a6a85 (diff) |
Add support for table options in changelog, use to handle MySQL engine
Diffstat (limited to 'odb/relational/changelog.cxx')
-rw-r--r-- | odb/relational/changelog.cxx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/odb/relational/changelog.cxx b/odb/relational/changelog.cxx index af1dcea..6fc85b7 100644 --- a/odb/relational/changelog.cxx +++ b/odb/relational/changelog.cxx @@ -356,6 +356,9 @@ namespace relational assert (bt != 0); alters& ae (g.new_edge<alters> (at, *bt)); + if (t.options () != ot->options ()) + diagnose_table (t, "options", ot->options (), t.options ()); + { trav_rel::table table; trav_rel::unames names; @@ -398,6 +401,31 @@ namespace relational } } + void + diagnose_table (sema_rel::table& t, + char const* name, + string const& ov, + string const& nv) + { + location const& tl (t.get<location> ("cxx-location")); + + error (tl) << "change to object or container member results in " + "the change of the corresponding table " << name; + + if (!ov.empty () || !nv.empty ()) + cerr << " (old: '" << ov << "', new: '" << nv << "')"; + + cerr << endl; + + error (tl) << "this change is not yet handled automatically" << endl; + info (tl) << "consider re-implementing this change by adding a " << + "new object or container member with the desired " << name << + ", migrating the data, and deleting the old object or member" << + endl; + + throw operation_failed (); + } + protected: model& other; mode_type mode; |