From 6d4b471afd63780b8a8a6c2d3fb8cc529ab5b15d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 4 Apr 2013 09:47:32 +0200 Subject: Generate add/drop index migration statements --- odb/relational/oracle/schema.cxx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'odb/relational/oracle') 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_; + + 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 (in.scope ())); + sema_rel::qname n (t.name ().qualifier ()); + n.append (in.name ()); + return quote_id (n); + } + }; + entry drop_index_; } } } -- cgit v1.1