summaryrefslogtreecommitdiff
path: root/odb
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-10-19 10:55:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-10-21 19:25:06 +0200
commiteba1738e205e6047dad2c3df9648c65c7fb0f053 (patch)
tree2d4275b497492d39d49caf9d572a88865142931e /odb
parent6bd95f51beb26d87fd5d5db22391c73f333eee6e (diff)
Use base implementation instead of duplicating code
Diffstat (limited to 'odb')
-rw-r--r--odb/relational/mysql/schema.cxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/odb/relational/mysql/schema.cxx b/odb/relational/mysql/schema.cxx
index 8b31563..485fa9f 100644
--- a/odb/relational/mysql/schema.cxx
+++ b/odb/relational/mysql/schema.cxx
@@ -44,17 +44,15 @@ namespace relational
virtual void
null (semantics::data_member& m)
{
- if (!context::null (m, prefix_))
- os << " NOT NULL";
+ // MySQL TIMESTAMP is by default NOT NULL. If we want it
+ // to contain NULL values, we need to explicitly declare
+ // the column as NULL.
+ //
+ if (context::null (m, prefix_) &&
+ column_sql_type (m, prefix_).type == sql_type::TIMESTAMP)
+ os << " NULL";
else
- {
- // MySQL TIMESTAMP is by default NOT NULL. If we want it
- // to contain NULL values, we need to explicitly declare
- // the column as NULL.
- //
- if (column_sql_type (m, prefix_).type == sql_type::TIMESTAMP)
- os << " NULL";
- }
+ base::null (m);
}
virtual void