1

How to drop ALL DB objects made using liquibase i have come accross the command DropAll, it only drop all tables in the database, i have explore on the google but still strugling,

so i have drop the queue tables by running plsql with liquibase
then I have use the command dropAll to drop all the tables and sequences.

Is there is another solution to do that or I will stay with that

Girish
  • 1,717
  • 1
  • 18
  • 30
  • Did you check the rollback features that liquibase offers? See this [question](http://stackoverflow.com/questions/11131978/how-to-tag-a-changeset-in-liquibase-to-rollback) on SO for example. I am mostly using mysql and when I want to clear the database I just do a `drop schema xyz` and then `create schema xyz` to get rid of everything. Running liquibase again will recreate everything from scratch then. – Jens Jan 10 '14 at 09:51
  • @Jens I have maintained the rollback instructions in by databasechangelog xml and in the files that I m invoking from this file, but whenever I run the target "rollback" in the databasechangeLog file then it will rollback only the tables not the queues inside the schema and my database is of oracle. – Girish Jan 10 '14 at 17:56
  • I haven't really used the rollback feature myself yet - but I wonder how the queues were created? Shouldn't there also be a changeset for this? I think you sometimes need to add extra code to the rollback tags in order to cleanup everything. Tables will be rolled back by liquibase without extra work but other things might need extra sql from you which you need to add to the changeset that created the queue. – Jens Jan 13 '14 at 08:52

1 Answers1

1

The dropAll command doesn't read the changelog and do a rollback, it snapshots the database and drops everything it sees. Unfortunately, it doesn't know how to snapshot and drop queues so they are not dropped.

Depending on the database, you may be able to just call "drop database X; create database X" to clear it out without using dropAll.

You can write an extension to build queue support into Liquibase (liquibase.org/extensions). You would need to create new classes to implement AbstractDatabaseObject, JdbcSnapshotGenerator, and UnexpectedObjectChangeGenerator that to add the support.

Nathan Voxland
  • 15,453
  • 2
  • 48
  • 64