Applies to:
- Liquibase Secure (Pro)
- Liquibase Community (Open Source)
Summary:
If you want to create a schema that doesn't already exist, you can do this with Liquibase in two ways: using formatted SQL or an XML changelog with the SQL tag.
Environment Conditions:
Only available on the following databases:
DB2/LUW, DB2/z, Derby, Firebird, H2, HyperSQL, INGRES, Informix, MariaDB, MySQL, Oracle, PostgreSQL, Snowflake, SQL Server, SQLite, Sybase, Sybase Anywhere.
How to Create a New Schema
Formatted SQL
-- liquibase formatted sql
-- changeset liquibase:1
CREATE SCHEMA schemaName;
-- rollback DROP SCHEMA schemaNameXML Changelog
<changeSet id="1" author="Liquibase">
<sql>
CREATE SCHEMA schemaName;
</sql>
</changeSet>Note: The SQL change type in XML changesets does not have an auto rollback.
Comments
0 comments
Article is closed for comments.