Is there a way how to truncate all tables using liquibase? Is there a way how to truncate all tables using liquibase? oracle oracle

Is there a way how to truncate all tables using liquibase?


You can use native SQL. It isn't liquibase constructs as such, and not DB agnostic, but I suspect truncate commands should be supported by any DB platform that liquibase supports. Of course, be careful of Foreign Key references when truncating any table, and make sure you truncate in the right order.

For example:

<changeSet author="eric.b" id="10288-201-5">    <comment>Clear any existing legacy data in the tables</comment>    <sql splitStatements="true">        TRUNCATE TABLE ADDRESS;        TRUNCATE TABLE PHONE;        TRUNCATE TABLE USERS;    </sql></changeSet>