1 24 package org.riotfamily.revolt.refactor; 25 26 import org.riotfamily.revolt.Dialect; 27 import org.riotfamily.revolt.Refactoring; 28 import org.riotfamily.revolt.Script; 29 import org.riotfamily.revolt.definition.Database; 30 31 35 public class DropIndex implements Refactoring { 36 37 private String table; 38 39 private String index; 40 41 public DropIndex() { 42 } 43 44 public DropIndex(String table, String index) { 45 this.table = table; 46 this.index = index; 47 } 48 49 public void setTable(String table) { 50 this.table = table; 51 } 52 53 public void setIndex(String index) { 54 this.index = index; 55 } 56 57 public void alterModel(Database database) { 58 database.getTable(table).removeIndex(index); 59 } 60 61 public Script getScript(Dialect dialect) { 62 return dialect.dropIndex(table, index); 63 } 64 65 } 66 | Popular Tags |