Liquibase
makes the database migration
portable, so that same database
can setup on multiple server
and environments
as well. Liquibase
provides drop-all
command that drops all the database objects
own by the user to remove all unwanted database objects
and reset the database
to empty state
.
It makes it easy to keep multiple environments in sync instead of deleting everything manually.
Never use dropAll command in Production
dropAll command reads all database configurations from liquibase.properties file, if required those can also be passed in CLI as well.
liquibase.properties (update changeLog File file format with SQL, XML, YAML, JSON as per changelog.mysql.)
changeLogFile=changelog.mysql.xml
liquibase.command.url:jdbc:mysql://localhost:3306/appleDb?createDatabaseIfNotExist=true&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
liquibase.command.username : root
liquibase.command.password : rootroot
execute command
liquibase dropAll
or
liquibase drop-all