diff options
Diffstat (limited to 'odb/common.cxx')
-rw-r--r-- | odb/common.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
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<string> ("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] != '_') |