createDatabase
Creates a new database in Snowflake. Supports creating standard databases, transient databases, and replica databases from primary databases in other accounts.
Note: Automatic rollback drops the database.
Known limitation: This change type does not support database inspection features (snapshot, diff, diff-changelog, and generate-changelog commands).
Available attributes
Attribute | Type | Description | Required |
|---|---|---|---|
| String | Name of the database to create | Yes |
| Boolean | Replace the database if it already exists using | No |
| Boolean | Only create the database if it doesn't exist using | No |
| String | Comment describing the database | No |
| Nested | Configuration for standard/transient database | No* |
| Nested | Configuration for replica database | No* |
* replaceIfExists and ifNotExists are mutually exclusive. Exactly one of standardDatabase or replicaDatabase must be specified.
standardDatabase attributes
Attribute | Type | Description | Required |
|---|---|---|---|
| Boolean | Create a transient database | No |
| Integer | Days to retain data for Time Travel (0-90) | No |
| Integer | Maximum days Time Travel retention can be extended | No |
| String | Default collation for objects in the database | No |
| String | Storage format policy ( | No |
| String | External volume for Iceberg tables | No |
| String | Catalog integration for Iceberg tables | No |
| String | Replace invalid UTF-8 characters in Iceberg tables | No |
| Nested | Key-value pairs of tags to apply | No |
| Nested | Key-value pairs mapping contact purposes to names | No |
standardDatabase nested elements
tags - Key-value pairs of tags to apply:
Attribute | Type | Description | Required |
|---|---|---|---|
key | String | Tag name (simple, schema-qualified, or fully-qualified) | Yes |
value | String | Tag value | Yes |
Contacts - Key-value pairs mapping contact purposes to contact names:
Attribute | Type | Description | Required |
|---|---|---|---|
key | String | Contact purpose: `steward`, `support`, or `approver` | Yes |
value | String | Name of existing contact object (simple, schema, or fully qualified) | Yes |
replicaDatabase attributes
Attribute | Type | Description | Required |
|---|---|---|---|
| String | Account identifier of the primary database | Yes |
| String | Name of the primary database to replicate | Yes |
| Integer | Days to retain data for Time Travel | No |
| Integer | Maximum days Time Travel retention can be extended | 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">
<!-- Standard database with full configuration -->
<changeSet id="create-standard-database" author="examples">
<pro-snowflake:createDatabase
databaseName="MY_DATABASE"
comment="Standard database with full configuration"
ifNotExists="true">
<pro-snowflake:standardDatabase
dataRetentionTimeInDays="7"
maxDataExtensionTimeInDays="14"
defaultDdlCollation="en_US"
storageSerializationPolicy="COMPATIBLE">
<pro-snowflake:tags>
<pro-snowflake:entry key="PUBLIC.environment" value="production"/>
</pro-snowflake:tags>
</pro-snowflake:standardDatabase>
</pro-snowflake:createDatabase>
</changeSet>
<!-- Transient database -->
<changeSet id="create-transient-database" author="examples">
<pro-snowflake:createDatabase
databaseName="TEMP_DATABASE"
comment="Transient database for temporary data">
<pro-snowflake:standardDatabase
isTransient="true"
dataRetentionTimeInDays="1"/>
</pro-snowflake:createDatabase>
</changeSet>
<!-- Replica database -->
<changeSet id="create-replica-database" author="examples">
<pro-snowflake:createDatabase
databaseName="REPLICA_DATABASE"
comment="Replica of primary database">
<pro-snowflake:replicaDatabase
primaryAccount="MYORG.PRIMARY_ACCOUNT"
primaryDatabase="PRIMARY_DB"
dataRetentionTimeInDays="2"/>
</pro-snowflake:createDatabase>
</changeSet>
</databaseChangeLog>