If I have a column named column01 that is indexed, and I submit a changeset to rename the column to column02 with renameColumn liquibase command, will the name change also occur in the index or will I need to drop and recreate the index?
Would you mind posting your changeset so I could verify. Also, what DB platform are you using?
If you are just using sqldirect or equivalent, liquibase is just running the sql you provide it. So, it would depend on the platform, and how it would respond.
@tremmie I will try this but as far as I know, the rename column SHOULD NOT update the index name as Index is an independent entity.
what DBMS are you working with ? oracle , postgresql ?
I will try it and see if what think is infact correct.
@hope99 I ended up experimenting and trying it myself, and from what I could tell the index name was updated and no errors were found when the changesets were ran. I am working with a Microsoft SQL Server and was surprised to see that the column name was updated and when I queried for the list of indexes the index for the old column name seemed to be renamed as well.
I think this is expected behavior on the mysql side. Here is a note I got from @costinmoraru:
Foreign key constraint names that point to the renamed table are automatically updated unless there is a conflict, in which case the statement fails with an error. A conflict occurs if the renamed constraint name already exists. In such cases, you must drop and re-create the foreign keys for them to function properly.