cloneDynamicTable
Creates a zero-copy clone of a Snowflake dynamic table with optional time travel support. Clones can be created from the current state or from a specific point in time within the retention window. targetLag and warehouse parameters are optional and inherit from source if omitted.
Known limitations:
This change type does not support automatic rollback.
Snowflake snapshots created with Liquibase Secure 5.1 are incompatible with earlier versions due to enhanced object type detection for TABLES and VIEWS. Regenerate all snapshots with 5.1 after upgrading to avoid false differences in
diffanddiff-changelogoperations.
Available attributes
Attribute | Type | Description | Required |
|---|---|---|---|
| String | Name of the catalog containing the source dynamic table | No |
| String | Name of the schema containing the source dynamic table | No |
| String | Name of the dynamic table to clone from | Yes |
| String | Name of the catalog for the cloned dynamic table | No |
| String | Name of the schema for the cloned dynamic table | No |
| String | Name of the new cloned dynamic table | Yes |
| Boolean | If true, replaces existing table with | No |
| Boolean | If true, only creates if target doesn't exist* | No |
| Boolean | If true, copies grants from source table** | No |
| Boolean | If true, creates a | No |
| String | Target lag for refresh (e.g., | No |
| String | Warehouse for refresh operations | No |
| Nested | Time travel options for cloning from historical state | No |
*replaceIfExists and ifNotExists are mutually exclusive.
**copyGrants requires replaceIfExists=true.
timeTravelClause nested attributes
Attribute | Type | Description | Required |
|---|---|---|---|
| String | Either | Yes |
| String | Relative seconds (e.g., | No |
| String | DML statement ID from query history*** | No |
***Exactly one of offset or statement must be specified. Note: timestamp time travel is documented by Snowflake but currently broken for dynamic tables.
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:pro-snowflake="http://www.liquibase.org/xml/ns/pro-snowflake"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
http://www.liquibase.org/xml/ns/pro-snowflake
http://www.liquibase.org/xml/ns/pro-snowflake/liquibase-pro-snowflake-latest.xsd">
<!-- Simple clone (inherits targetLag and warehouse from source) -->
<changeSet id="clone-simple" author="examples">
<pro-snowflake:cloneDynamicTable
sourceTableName="source_dynamic_table"
targetTableName="cloned_dynamic_simple"/>
</changeSet>
<!-- Clone with explicit targetLag and warehouse -->
<changeSet id="clone-with-params" author="examples">
<pro-snowflake:cloneDynamicTable
sourceTableName="source_dynamic_table"
targetTableName="cloned_dynamic_custom"
targetLag="2 hours"
warehouse="RD_WH"
ifNotExists="true"/>
</changeSet>
<!-- Clone with time travel OFFSET -->
<changeSet id="clone-with-offset" author="examples">
<pro-snowflake:cloneDynamicTable
sourceTableName="source_dynamic_table"
targetTableName="cloned_dynamic_offset">
<pro-snowflake:timeTravelClause timeTravelType="BEFORE">
<pro-snowflake:offset>-300</pro-snowflake:offset>
</pro-snowflake:timeTravelClause>
</pro-snowflake:cloneDynamicTable>
</changeSet>
<!-- Clone with OR REPLACE, COPY GRANTS, and TRANSIENT -->
<changeSet id="clone-full-featured" author="examples">
<pro-snowflake:cloneDynamicTable
sourceTableName="source_dynamic_table"
targetTableName="cloned_dynamic_full"
replaceIfExists="true"
copyGrants="true"
isTransient="true"
targetLag="DOWNSTREAM"
warehouse="RD_WH"/>
</changeSet>
</databaseChangeLog>