Created
March 4, 2019 19:49
-
-
Save goyalmohit/a0e850eee02d378e6320be8b4083fd49 to your computer and use it in GitHub Desktop.
drop a table using precondition in liquibase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.1" encoding="UTF-8" standalone="no"?> | |
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> | |
<changeSet author="mohitgoyal" id="20190304224600"> | |
<preConditions onFail="HALT"> | |
<sqlCheck expectedResult="0">select count(*) from customer</sqlCheck> | |
</preConditions> | |
<comment>Make sure that no data exists in the table before you drop it</comment> | |
<dropTable tableName="customer"/> | |
</changeSet> | |
</databaseChangeLog> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment