I have a table generated by GORM (Grails Domain). It has foreign key / index that generated random characters like FKAC7AAF67162A158F. I need to remove that field that not needed anymore.
The problems, I have some servers that need to be updated. So I need to create a migration using Liquibase. But I have no idea how to remove that index manualy if the index are in random name (each server my have different name).
is it possible to drop an index of something without knowing its name ?
You can remove the index using the database-migration plugin (liquibase). It requires that you know the index name, but that name should be in one of your previous migrations.
// older index added in a previous release
changeSet(author: "frank", id: "1354228052849-1") {
createIndex(indexName: "FKAC7AAF67162A158F", tableName: "answer_option") {
column(name: "question_id")
}
}
Create a new migration to remove the index.
changeSet(author: "[email protected]", id: "1381257863746-1") {
dropIndex(indexName: "FKAC7AAF67162A158F", tableName: "answer_option")
}