diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-03-28 16:04:48 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-04-10 18:46:44 +0200 |
commit | 2aa3cabf1b737e225178230882ee9aadfd817ce0 (patch) | |
tree | 85a6c7a90f8483ca11a4bc825cd2ef22114c3d97 /odb/semantics/relational/table.cxx | |
parent | e999b1e7295acd8cdb646c2db7db1f5059f10c7d (diff) |
Add changelog support for add/drop index/foreign key
Also diagnose changes to primary keys and establish the 'alters'
association.
Diffstat (limited to 'odb/semantics/relational/table.cxx')
-rw-r--r-- | odb/semantics/relational/table.cxx | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/odb/semantics/relational/table.cxx b/odb/semantics/relational/table.cxx index 682196c..17265bd 100644 --- a/odb/semantics/relational/table.cxx +++ b/odb/semantics/relational/table.cxx @@ -13,14 +13,20 @@ namespace semantics // table // table:: - table (table const& t, qscope&, graph& g) - : qnameable (t, g), uscope (t, g) + table (table const& t, qscope& s, graph& g, bool b) + : qnameable (t, g), + uscope (t, (b ? s.lookup<table, drop_table> (t.name ()) : 0), g) { } table:: - table (xml::parser& p, qscope&, graph& g) - : qnameable (p, g), uscope (p, g) + table (xml::parser& p, qscope& s, graph& g, bool b) + : qnameable (p, g), + uscope ( + p, + (b ? s.lookup<table, drop_table> ( + p.attribute<qnameable::name_type> ("name")) : 0), + g) { } @@ -81,18 +87,6 @@ namespace semantics // alter_table // - alter_table:: - alter_table (alter_table const& t, qscope&, graph& g) - : qnameable (t, g), uscope (t, g) - { - } - - alter_table:: - alter_table (xml::parser& p, qscope&, graph& g) - : qnameable (p, g), uscope (p, g) - { - } - alter_table& alter_table:: clone (qscope& s, graph& g) const { @@ -103,8 +97,8 @@ namespace semantics serialize (xml::serializer& s) const { s.start_element (xmlns, "alter-table"); - qnameable::serialize_attributes (s); - uscope::serialize_content (s); + table::serialize_attributes (s); + table::serialize_content (s); s.end_element (); } @@ -154,8 +148,7 @@ namespace semantics // { type_info ti (typeid (alter_table)); - ti.add_base (typeid (qnameable)); - ti.add_base (typeid (uscope)); + ti.add_base (typeid (table)); insert (ti); } } |