summaryrefslogtreecommitdiff
path: root/odb/semantics/relational/key.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-03-28 16:04:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-04-10 18:46:44 +0200
commit2aa3cabf1b737e225178230882ee9aadfd817ce0 (patch)
tree85a6c7a90f8483ca11a4bc825cd2ef22114c3d97 /odb/semantics/relational/key.hxx
parente999b1e7295acd8cdb646c2db7db1f5059f10c7d (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/key.hxx')
-rw-r--r--odb/semantics/relational/key.hxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/odb/semantics/relational/key.hxx b/odb/semantics/relational/key.hxx
index 8d64993..184433e 100644
--- a/odb/semantics/relational/key.hxx
+++ b/odb/semantics/relational/key.hxx
@@ -6,6 +6,7 @@
#define ODB_SEMANTICS_RELATIONAL_KEY_HXX
#include <odb/semantics/relational/elements.hxx>
+#include <odb/semantics/relational/table.hxx>
namespace semantics
{
@@ -55,6 +56,8 @@ namespace semantics
typedef std::vector<contains*> contains_list;
public:
+ typedef contains_list::size_type contains_size_type;
+
typedef
pointer_iterator<contains_list::const_iterator>
contains_iterator;
@@ -65,9 +68,18 @@ namespace semantics
contains_iterator
contains_end () const {return contains_.end ();}
- contains_list::size_type
+ contains_size_type
contains_size () const {return contains_.size ();}
+ contains&
+ contains_at (contains_size_type i) const {return *contains_[i];}
+
+ public:
+ typedef relational::table table_type;
+
+ table_type&
+ table () const {return dynamic_cast<table_type&> (scope ());}
+
public:
key (std::string const& id): unameable (id) {}