From adfa9bbd04cd3571932ee7675344ca723bfa1eab Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 20 Jul 2012 14:26:23 +0200 Subject: Move indexes from model scope to table scope Conceptually, indexes belong to tables and some databases (MySQL, MSSQL) indeed treat them as such (i.e., you can have indexes with the same name in different tables). --- odb/semantics/relational/index.hxx | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'odb/semantics/relational/index.hxx') diff --git a/odb/semantics/relational/index.hxx b/odb/semantics/relational/index.hxx index dcb8e6e..af90b12 100644 --- a/odb/semantics/relational/index.hxx +++ b/odb/semantics/relational/index.hxx @@ -6,31 +6,18 @@ #define ODB_SEMANTICS_RELATIONAL_INDEX_HXX #include -#include #include -#include namespace semantics { namespace relational { - // Note that unlike other keys, indexes are defined in the model - // scope, not table scope. + // Note that in our model indexes are defined in the table scope. // - class index: public qnameable, public key + class index: public key { public: - relational::table& - table () const - { - return contains_begin ()->column ().table (); - } - - public: - index (string const& id) - : qnameable (id) - { - } + index (string const& id): key (id) {} virtual string kind () const -- cgit v1.1