Drop table means deleting data along with strcture of table from that schema. Most of the times we cannot rollback that action. So please get it confirmed before performing this drop operation.
In Liquibase we can use this Drop Table change set . Below is the syntax for it.
<changeSet author=”liquibase-docs” id=”dropTable-example”>
<dropTable cascadeConstraints=”true”
catalogName=”cat”
schemaName=”public”
tableName=”person”/>
</changeSet>
Mandatory field is : tableName .
id : please ensure unique ness
cascadeConstraints set to true means all related tables effect.
Once this change set executed table will be deleted permanently. Please check this entry dbchangelog table which liquibase creates first time to keep track of changes in changeset’s.
Here full video :
Hope its useful.
Leave a Reply