我今天开始测试 grails 数据库迁移插件。我与域进行了初始同步,然后基于运行 diff 命令创建了一个新的更改日志。这应该就像重命名列和(重新)将索引分配给该列一样简单。所以我希望看到以下...
changeSet(author: "gdboling (generated)", id: "1306242441630-1") {
addColumn(tableName: "manuscript_review_reviewer") {
column(name: "reviewer_id", type: "bigint") {
constraints(nullable: "false")
}
}
}
changeSet(author: "gdboling (generated)", id: "1306242441630-2") {
addPrimaryKey(columnNames: "manuscript_review_id, reviewer_id", constraintName: "manuscript_rePK", tableName: "manuscript_review_reviewer")
}
changeSet(author: "gdboling (generated)", id: "1306242441630-3") {
dropPrimaryKey(tableName: "manuscript_review_reviewer")
}
changeSet(author: "gdboling (generated)", id: "1306242441630-4") {
dropForeignKeyConstraint(baseTableName: "manuscript_review_reviewer", baseTableSchemaName: "manning_main_dev", constraintName: "FK9BEFBBB34863C659")
}
changeSet(author: "gdboling (generated)", id: "1306242441630-179") {
addForeignKeyConstraint(baseColumnNames: "reviewer_id", baseTableName: "manuscript_review_reviewer", constraintName: "FK9BEFBBB3A28B41DF", deferrable: "false", initiallyDeferred: "false", referencedColumnNames: "id", referencedTableName: "user", referencesUniqueColumn: "false")
}
changeSet(author: "gdboling (generated)", id: "1306242441630-212") {
dropColumn(columnName: "user_id", tableName: "manuscript_review_reviewer")
}
这一切都很好。但是,我也看到很多与我的更改无关的 dropIndex 和 createIndex 块。有谁知道为什么会这样?