aboutsummaryrefslogtreecommitdiff
path: root/odb/relational/oracle
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-04-04 09:47:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-04-10 18:46:44 +0200
commit6d4b471afd63780b8a8a6c2d3fb8cc529ab5b15d (patch)
treed4cf0158f1b2ac03736b662003dbd11b556babef /odb/relational/oracle
parentb0391e168b489811708ca7ba5f71a0eb67b46ffe (diff)
Generate add/drop index migration statements
Diffstat (limited to 'odb/relational/oracle')
-rw-r--r--odb/relational/oracle/schema.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/odb/relational/oracle/schema.cxx b/odb/relational/oracle/schema.cxx
index bd0acda..a76e25a 100644
--- a/odb/relational/oracle/schema.cxx
+++ b/odb/relational/oracle/schema.cxx
@@ -95,7 +95,7 @@ namespace relational
virtual void
traverse (sema_rel::table& t, bool migration)
{
- if (pass_ != 1)
+ if (pass_ != 2)
return;
using sema_rel::primary_key;
@@ -290,6 +290,23 @@ namespace relational
}
};
entry<create_index> create_index_;
+
+ struct drop_index: relational::drop_index, context
+ {
+ drop_index (base const& x): base (x) {}
+
+ virtual string
+ name (sema_rel::index& in)
+ {
+ // In Oracle, index names can be qualified with the schema.
+ //
+ sema_rel::table& t (static_cast<sema_rel::table&> (in.scope ()));
+ sema_rel::qname n (t.name ().qualifier ());
+ n.append (in.name ());
+ return quote_id (n);
+ }
+ };
+ entry<drop_index> drop_index_;
}
}
}