aboutsummaryrefslogtreecommitdiff
path: root/odb/relational/oracle
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-04-08 14:34:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-04-10 18:46:44 +0200
commit8295d4bd02946b7bdbff2a9cfa7763232e2d2fd0 (patch)
tree3edef4af4087be023b5a1095955c449283fe0ad9 /odb/relational/oracle
parent7c2d91d07bbd32e81de6139776f0f5c5adbfb2ac (diff)
Clean up class order in schema generators
Diffstat (limited to 'odb/relational/oracle')
-rw-r--r--odb/relational/oracle/schema.cxx70
1 files changed, 37 insertions, 33 deletions
diff --git a/odb/relational/oracle/schema.cxx b/odb/relational/oracle/schema.cxx
index 68dab57..a49ace0 100644
--- a/odb/relational/oracle/schema.cxx
+++ b/odb/relational/oracle/schema.cxx
@@ -118,6 +118,23 @@ namespace relational
};
entry<drop_foreign_key> drop_foreign_key_;
+ 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_;
+
struct drop_table: relational::drop_table, context
{
drop_table (base const& x): base (x) {}
@@ -251,6 +268,23 @@ namespace relational
};
entry<create_foreign_key> create_foreign_key_;
+ struct create_index: relational::create_index, context
+ {
+ create_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<create_index> create_index_;
+
struct create_table: relational::create_table, context
{
create_table (base const& x): base (x) {}
@@ -284,39 +318,9 @@ namespace relational
};
entry<create_table> create_table_;
- struct create_index: relational::create_index, context
- {
- create_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<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_;
+ //
+ // Alter.
+ //
struct alter_column: relational::alter_column, context
{