From 2c54bc97c94b5a53ad0a7fff684fece4ae24dc66 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 2 Jan 2007 22:12:05 +0000 Subject: [PATCH] Don't auto-remove indices either. Deciphering whether that's the right thing to do is a PITA and not really worth the trouble. --- .../com/samskivert/jdbc/depot/DepotMarshaller.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/java/com/samskivert/jdbc/depot/DepotMarshaller.java b/src/java/com/samskivert/jdbc/depot/DepotMarshaller.java index f2091c3..b710d54 100644 --- a/src/java/com/samskivert/jdbc/depot/DepotMarshaller.java +++ b/src/java/com/samskivert/jdbc/depot/DepotMarshaller.java @@ -714,15 +714,12 @@ public class DepotMarshaller 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 - // remove any extra indices - for (String index : indices) { - log.info("Dropping old index '" + index + "' from " + getTableName()); - String query = "alter table " + getTableName() + " drop index " + index; - ctx.invoke(new Modifier.Simple(query)); - } + // we don't auto-remove indices either because we'd have to sort out the potentially + // complex origins of an index (which might be because of a @Unique column or maybe the + // index was hand defined in a @Column clause) // run our post-default-migrations for (EntityMigration migration : _migrations) {