renameFileFormat

Renames an existing file format in Snowflake.

Note: Automatic rollback renames the file format back to original name.

Available attributes

Attribute

Type

Description

Required

catalogName

String

Name of the catalog (database) containing the file format

No

schemaName

String

Name of the schema containing the file format

No

oldFileFormatName

String

Current name of the file format

Yes

newFileFormatName

String

New name for the file format

Yes

ifExists

Boolean

Only rename if the file format exists using IF EXISTS

No

<?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">
  <!-- Basic rename -->
  <changeSet id="rename-file-format-basic" author="examples">
    <pro-snowflake:renameFileFormat
                oldFileFormatName="CSV_FORMAT"
                newFileFormatName="CSV_FORMAT_V2"/>
  </changeSet>
  <!-- Rename with IF EXISTS -->
  <changeSet id="rename-file-format-if-exists" author="examples">
    <pro-snowflake:renameFileFormat
                oldFileFormatName="OLD_JSON_FORMAT"
                newFileFormatName="JSON_FORMAT_PRODUCTION"
                ifExists="true"/>
  </changeSet>
  <!-- Rename with schema qualification -->
  <changeSet id="rename-file-format-qualified" author="examples">
    <pro-snowflake:renameFileFormat
                catalogName="MY_DATABASE"
                schemaName="STAGING"
                oldFileFormatName="TEMP_FORMAT"
                newFileFormatName="PRODUCTION_FORMAT"
                ifExists="true"/>
  </changeSet>
</databaseChangeLog>