示例代码:
@Table("t_test")
@TableIndexes(@Index(fields = "test1",name = "index_test1"))
public class Test {
private String test1;
@Name
private String name;
}
Daos.migration(dao, Test.class, true, false,true);
第一次建表时,建立索引是这样的:
Create UNIQUE Index index_test1 ON t_test(test1)
ALTER TABLE t_test DROP INDEX index_test1
Create UNIQUE Index index_test1 ON t_test(test1)
表存在,且索引定义没有变化的情况下调用,也会重新建一遍索引
ALTER TABLE t_test DROP INDEX index_test1
Create UNIQUE Index index_test1 ON t_test(test1)