From 16bab3c7af5502f6a32e896a2789cefb7ffcaa72 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 10 Mar 2011 14:39:24 +0200 Subject: Separate auto increment from database type --- odb/relational/schema.hxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'odb/relational/schema.hxx') 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_; }; -- cgit v1.1