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/mysql | |
parent | 436031d026eb004865faaa21af5213a6f89a6a85 (diff) |
Add support for table options in changelog, use to handle MySQL engine
Diffstat (limited to 'odb/relational/mysql')
-rw-r--r-- | odb/relational/mysql/model.cxx | 26 | ||||
-rw-r--r-- | odb/relational/mysql/schema.cxx | 10 |
2 files changed, 26 insertions, 10 deletions
diff --git a/odb/relational/mysql/model.cxx b/odb/relational/mysql/model.cxx index baec600..36b318f 100644 --- a/odb/relational/mysql/model.cxx +++ b/odb/relational/mysql/model.cxx @@ -105,6 +105,32 @@ namespace relational } }; entry<object_columns> object_columns_; + + struct member_create: relational::member_create, context + { + member_create (base const& x): base (x) {} + + virtual string + table_options (semantics::data_member&, semantics::type&) + { + string const& engine (options.mysql_engine ()); + return engine != "default" ? "ENGINE=" + engine : ""; + } + }; + entry<member_create> member_create_; + + struct class_: relational::class_, context + { + class_ (base const& x): base (x) {} + + virtual string + table_options (type&) + { + string const& engine (options.mysql_engine ()); + return engine != "default" ? "ENGINE=" + engine : ""; + } + }; + entry<class_> class__; } } } diff --git a/odb/relational/mysql/schema.cxx b/odb/relational/mysql/schema.cxx index c44b796..f89bb61 100644 --- a/odb/relational/mysql/schema.cxx +++ b/odb/relational/mysql/schema.cxx @@ -297,16 +297,6 @@ namespace relational } } } - - virtual void - create_post () - { - os << ")" << endl; - - string const& engine (options.mysql_engine ()); - if (engine != "default") - os << " ENGINE=" << engine << endl; - } }; entry<create_table> create_table_; |