diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-03-10 14:39:24 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-03-21 15:40:00 +0200 |
commit | 16bab3c7af5502f6a32e896a2789cefb7ffcaa72 (patch) | |
tree | 48c85a8985c6015b4278cc6a6a2c795316cc3cdd /odb/relational/schema.hxx | |
parent | 63403a8a095ceba0ad9a17e46013a46918726181 (diff) |
Separate auto increment from database type
Diffstat (limited to 'odb/relational/schema.hxx')
-rw-r--r-- | odb/relational/schema.hxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/odb/relational/schema.hxx b/odb/relational/schema.hxx index bccb2a9..9da6624 100644 --- a/odb/relational/schema.hxx +++ b/odb/relational/schema.hxx @@ -162,8 +162,7 @@ namespace relational os << " " << quote_id (name) << " " << column_type (m, prefix_); - if (m.count ("id")) - os << " PRIMARY KEY"; + constraints (m); if (semantics::class_* c = object_pointer (member_type (m, prefix_))) { @@ -174,6 +173,13 @@ namespace relational return true; } + virtual void + constraints (semantics::data_member& m) + { + if (m.count ("id")) + os << " PRIMARY KEY"; + } + protected: string prefix_; }; |