summaryrefslogtreecommitdiff
path: root/odb/relational/mysql/schema.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/relational/mysql/schema.cxx')
-rw-r--r--odb/relational/mysql/schema.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/odb/relational/mysql/schema.cxx b/odb/relational/mysql/schema.cxx
index 4050d70..8068fc4 100644
--- a/odb/relational/mysql/schema.cxx
+++ b/odb/relational/mysql/schema.cxx
@@ -125,6 +125,36 @@ namespace relational
}
};
entry<create_table> create_table_;
+
+ struct create_index: relational::create_index, context
+ {
+ create_index (base const& x): base (x) {}
+
+ virtual void
+ create (sema_rel::index& in)
+ {
+ os << "CREATE ";
+
+ if (!in.type ().empty ())
+ os << in.type () << ' ';
+
+ os << "INDEX " << name (in);
+
+ if (!in.method ().empty ())
+ os << " USING " << in.method ();
+
+ os << endl
+ << " ON " << table_name (in) << " (";
+
+ columns (in);
+
+ os << ")" << endl;
+
+ if (!in.options ().empty ())
+ os << ' ' << in.options () << endl;
+ }
+ };
+ entry<create_index> create_index_;
}
}
}