* Appends an index creation SQL to the SQL appender.
* @param index The index object.
*/
protected void createIndex(Index index)
{
Table table = index.getTable();
if (index.getType() >= Index.BTREE && isIndexable(table))
{
StringBuffer buf = new StringBuffer(128);
if (!isConstraint(index))
{
buf.append("create ");
if (index.isUnique())
{
buf.append("unique ");
}
appendIndexPrefix(buf, index);
buf.append("index ");
buf.append(getIndexName(index, false, true));
buf.append(" on ");
buf.append(table.getFullName(getOwner()));
appendIndexColumns(buf, index);
appendIndexSuffix(buf, index);
m_appender.appendSQL(buf.toString());
buf.setLength(0);
}
else if (isPrimaryKey(index))
{
buf.append("alter table ");
buf.append(table.getFullName(getOwner()));
buf.append(" add ");
appendPrimaryKey(buf, index);
m_appender.appendSQL(buf.toString());
}