From aaf47c94726ed05ca8c6790f0946e341125e7eb4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 24 Aug 2011 17:11:43 +0200 Subject: Don't append table prefix to names that already have it (container tables) --- odb/common.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'odb/common.cxx') diff --git a/odb/common.cxx b/odb/common.cxx index 2c23e76..130d5ec 100644 --- a/odb/common.cxx +++ b/odb/common.cxx @@ -128,8 +128,8 @@ traverse (semantics::data_member& m) // if (m.count ("table")) { - if (om_.table_prefix_.level == 1) - om_.table_prefix_.prefix.clear (); + if (om_.table_prefix_.level <= 1) + om_.table_prefix_.prefix = om_.options.table_prefix (); om_.table_prefix_.prefix += m.get ("table"); } @@ -141,6 +141,9 @@ traverse (semantics::data_member& m) string name (om_.public_name_db (m)); size_t n (name.size ()); + if (om_.table_prefix_.prefix.empty ()) + om_.table_prefix_.prefix = om_.options.table_prefix (); + om_.table_prefix_.prefix += name; if (n != 0 && name[n - 1] != '_') -- cgit v1.1