diff options
Diffstat (limited to 'odb/relational/schema.hxx')
-rw-r--r-- | odb/relational/schema.hxx | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/odb/relational/schema.hxx b/odb/relational/schema.hxx index 6551119..e6d4824 100644 --- a/odb/relational/schema.hxx +++ b/odb/relational/schema.hxx @@ -494,13 +494,10 @@ namespace relational } virtual void - create (sema_rel::index& in) + columns (sema_rel::index& in) { using sema_rel::index; - os << "CREATE INDEX " << name (in) << endl - << " ON " << table_name (in) << " ("; - for (index::contains_iterator i (in.contains_begin ()); i != in.contains_end (); ++i) @@ -515,9 +512,31 @@ namespace relational } os << quote_id (i->column ().name ()); + + if (!i->options ().empty ()) + os << ' ' << i->options (); } + } + + virtual void + create (sema_rel::index& in) + { + // Default implementation that ignores the method. + // + os << "CREATE "; + + if (!in.type ().empty ()) + os << in.type () << ' '; + + os << "INDEX " << name (in) << endl + << " ON " << table_name (in) << " ("; + + columns (in); os << ")" << endl; + + if (!in.options ().empty ()) + os << ' ' << in.options () << endl; } protected: |