feat: 新增类级 @TableIndex 注解(复合/唯一/部分索引,对齐 .NET [Index(...)])、索引 diff 统一为 IndexSpec、快照升级 v4、迁移源码还原 filter,版本 1.3.0

This commit is contained in:
2026-08-25 11:38:59 +08:00
parent 270a01fd49
commit 95b18084d5
10 changed files with 347 additions and 56 deletions
+4 -1
View File
@@ -211,7 +211,10 @@ public class MigrationFileGenerator {
sb.append("${indent}builder.renameColumn(\"${escape(op.tableName)}\", \"${escape(op.columnName)}\", \"${escape(op.newColumnName)}\")\n")
case MigrationOperationKind.CreateIndex =>
sb.append("${indent}builder.createIndex(\"${escape(op.indexName)}\", \"${escape(op.tableName)}\", ArrayList<String>([${colList(op.columnNames)}])")
if (op.unique) {
if (op.filter != "") {
let uniqueLiteral = if (op.unique) { "true" } else { "false" }
sb.append(", ${uniqueLiteral}, \"${escape(op.filter)}\"")
} else if (op.unique) {
sb.append(", true")
}
sb.append(")\n")