Don't auto-remove indices either. Deciphering whether that's the right thing to

do is a PITA and not really worth the trouble.
This commit is contained in:
Michael Bayne
2007-01-02 22:12:05 +00:00
parent ea85c1d500
commit 2c54bc97c9
@@ -714,15 +714,12 @@ public class DepotMarshaller<T>
ctx.invoke(new Modifier.Simple(indexdef)); ctx.invoke(new Modifier.Simple(indexdef));
} }
// we do not hand remove columns but rather require that EntityMigration.Drop records be // we do not auto-remove columns but rather require that EntityMigration.Drop records be
// registered by hand to avoid accidentally causin the loss of data // registered by hand to avoid accidentally causin the loss of data
// remove any extra indices // we don't auto-remove indices either because we'd have to sort out the potentially
for (String index : indices) { // complex origins of an index (which might be because of a @Unique column or maybe the
log.info("Dropping old index '" + index + "' from " + getTableName()); // index was hand defined in a @Column clause)
String query = "alter table " + getTableName() + " drop index " + index;
ctx.invoke(new Modifier.Simple(query));
}
// run our post-default-migrations // run our post-default-migrations
for (EntityMigration migration : _migrations) { for (EntityMigration migration : _migrations) {