summaryrefslogtreecommitdiff
path: root/odb/relational/model.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-09-15 12:46:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-09-15 12:46:09 +0200
commit51956f409ec7ebea8b6790b0c5d4f0b51513d683 (patch)
tree66f30e68fa3c8080d0d3d8d50c30e11914fc82b9 /odb/relational/model.hxx
parentd9ea777539b166c7347c44a6b7784626405bc029 (diff)
Cleanup polymorphic base tables when dropping derived one
Diffstat (limited to 'odb/relational/model.hxx')
-rw-r--r--odb/relational/model.hxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/odb/relational/model.hxx b/odb/relational/model.hxx
index 7b5fb78..325e614 100644
--- a/odb/relational/model.hxx
+++ b/odb/relational/model.hxx
@@ -536,6 +536,7 @@ namespace relational
model_.new_edge<sema_rel::qnames> (model_, t, name);
t.options (table_options (m, ct));
+ t.extra ()["kind"] = "container";
// object_id
//
@@ -545,7 +546,9 @@ namespace relational
oc->traverse (m, container_idt (m), "id", "object_id");
}
- // Foreign key and index for the object id.
+ // Foreign key and index for the object id. Keep this foreign
+ // key first since we reply on this information to lookup the
+ // corresponding object table.
//
{
// Derive the name prefix. See the comment for the other foreign
@@ -734,7 +737,9 @@ namespace relational
if (!object (c))
return;
- if (abstract (c) && !polymorphic (c))
+ semantics::class_* poly (polymorphic (c));
+
+ if (abstract (c) && poly == 0)
return;
qname const& name (table_name (c));
@@ -761,6 +766,9 @@ namespace relational
t.options (table_options (c));
+ if (poly != 0 && poly != &c)
+ t.extra ()["kind"] = "polymorphic";
+
// Add columns.
//
{