So it seems there is common misconception regarding foreign key and index? I came across following discussion which seems to indicate that is the case.
So it seems there is common misconception regarding foreign key and index? I came across following discussion which seems to indicate that is the case.
I’m experimenting with generateChangeLog to see if I can move the management of my MS SQL database to Liquibase.
After doing generateChangeLog and then creating new database with “update”, I noticed that a few of the index didn’t make into the new database.
After further investigation, I concluded that the index created on a column which has foreign key constants does not get saved off to change log with generateChangeLog.
This is done in DiffResult.addMissingIndexChanges as below:
Here is a sample database to demonstrate this. When generateChangeLog is run with this database, the index “move_person_id_idx” makes into the changelog but move_location_id_idx does not.
Why is the index explicitly removed from diff if it is associated with foreign key?
Hiroto