summaryrefslogtreecommitdiff
path: root/odb/semantics/relational/index.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-07-20 14:26:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-07-27 10:30:15 +0200
commitadfa9bbd04cd3571932ee7675344ca723bfa1eab (patch)
treec47487e8253d71ce0f2dd2e360f872e1e59a6cef /odb/semantics/relational/index.hxx
parent526f66e63f23afb40cc01550ca1a3a3592a84254 (diff)
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).
Diffstat (limited to 'odb/semantics/relational/index.hxx')
-rw-r--r--odb/semantics/relational/index.hxx19
1 files changed, 3 insertions, 16 deletions
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 <odb/semantics/relational/elements.hxx>
-#include <odb/semantics/relational/column.hxx>
#include <odb/semantics/relational/key.hxx>
-#include <odb/semantics/relational/table.hxx>
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