Elena
Elena

Reputation: 11

Liquibase: Deleting Sql File used in Changeset

we are using liquibase for our DB-Deployment. We are currently doing some refactoring. There is an old changeset which is running an sql script. This has been executed in the past. Now this sql script (or the statement in it) is outdated and I would like to deleted from our VCS System. I did that and tried to deploy again, but I am getting an exception saying that the sql file is not there, although my Changeset has runAlways="false" and runOnChange="false".

Does this mean that I have to always keep the specific sql script always in my CVS although it is deprecated?

Upvotes: 1

Views: 3893

Answers (1)

cralfaro
cralfaro

Reputation: 5948

According how checksum works on Liquibase, you can't delete it. Technically you run that changeset one time, and something happened on DB, then liquibase created a checksum for your file. Now if you change some part of it, liquibase will say your file is updated and you can't do that.

So in summary, your file is part of the story of your application build, even if it is no longer useful, and you can't get rid of it.

If you are not in production case, one solution could be create a dump from your current database as init.sql and start from that.

I hope this helps you.

Upvotes: 1

Related Questions