Reputation: 426
I am just starting to use Liquibase and I am wondering: why is it that when I run ./mvnw compile liquibase:diff
are change sets generated to first drop existing indexes and then recreate them if they already exist?
Ex:
<changeSet author="me (generated)" id="1486157347995-13">
<dropIndex indexName="my_idx" tableName="notification"/>
<createIndex indexName="my_idx" tableName="notification">
<column name="index_col"/>
</createIndex>
</changeSet>
Upvotes: 3
Views: 1318
Reputation: 2841
Probably out of "laziness".
This is a simple way to make sure the index created is the same (not only the name, but the columns used) than the one in the reference database.
It handles two diff cases in one:
Upvotes: 2