public void apply(RelationalSchemaUpgradeState state)
{
final RelationalSchema schema = state.getSchema();
final Table table = schema.getTable(m_sTableName);
m_index = new Index(m_outline.getName(), m_outline.getType(), table);
m_outline.copyTo(m_index);
table.addIndex(m_index);
new RelationalSchemaAspectManager(schema)
{
protected Iterator getTableAspectIterator()
{
return schema.getTableIterator();
}
protected Iterator getTablePointcutIterator()
{
return EmptyIterator.getInstance();
}
protected Iterator getIndexAspectIterator()
{
return schema.getIndexIterator();
}
protected Iterator getIndexPointcutIterator()
{
return Collections.singletonList(m_index).iterator();
}
}.applyAspects(2);
if (table.isAspect())
{
if (!m_index.isAspect())
{
for (Iterator itr = schema.getTableIterator(); itr.hasNext();)
{
Table pointcut = (Table)itr.next();
if (pointcut.hasAspect(table))
{
Index index = new Index(m_index.getName(pointcut), m_outline.getType(), table);
m_outline.copyTo(index);
pointcut.addIndex(index);
if (m_outline.getRelatedTableName() != null)