- Reference
- Version · 6.0
- Change Automation Reference
generate-changelog
Last updated: September 29, 2026
The generate-changelog command creates a changelog file that has a sequence of changesets which describe how to re-create the current state of the database.
Uses
The generate-changelog command is typically used when you want to capture the current state of a database, then apply those changes to any number of databases. This is typically only done when a project has an existing database, but hasn't used Liquibase before. See How to set up Liquibase with an Existing Project and Multiple Environments for more details.
Note: When using the update command to apply the changes in the changelog, Liquibase will not create a new database or schema. You must create them before applying the changelog to it.
Run the generate-changelog command
In this example, our sample database has the following content:

Note: The username and password attributes are not required for connections and systems which use alternate means of authentication. Also, you can specify database credentials as part of the url attribute.
* --include-tablespace only captures the tablespace if it was specified in the create table statement.
Output changelogs
The generate-changelog command generates a changelog that contains all your objects (represented as changesets) and places the file in the same directory where the command was ran.
The extension you provide determines the format of the changelog, so if you specify the filename as changelog.xml, you will get an XML formatted changelog. However, if you specify the filename as changelog.yaml, changelog.json, or changelog.sql, you will get changelogs formatted in YAML, JSON, or SQL, respectively.
Note: By default, Liquibase does not split statements for formatted SQL changelogs because splitStatements is set to false in the changelog. If the generatedSQL has multiple SQL statements, then Liquibase adds splitStatements:true to the changelog.
Learn more about split statements here: sql
Pretty-printed SQL output
When you generate a changelog in SQL format, Liquibase can write each statement it recognizes across several lines instead of one long line, so the file stays readable and produces a useful git diff.
The --changelog-pretty-print-sql global parameter controls this, and it is false by default, so each statement is written on a single line. Set it to true to turn pretty-printing on. The parameter covers any command that writes a SQL-format changelog, including diff-changelog.
Note: Pretty-printing adds line breaks and indentation and nothing else. Liquibase does not rewrite or reinterpret your SQL, and column types are written exactly as the database reported them. Your checksums are unaffected, because Liquibase strips whitespace out of a statement before it computes the changeset checksum.
This example shows one table as Liquibase writes it without pretty-printing and with it:
What Liquibase formats
Liquibase reformats these statements on any database platform:
CREATE TABLE: One column per line, including table-level
PRIMARY KEY,FOREIGN KEY, andUNIQUEconstraint clauses.CREATE INDEX: One column per line. The
UNIQUE,BITMAP,CLUSTERED,NONCLUSTERED,HASH,SPATIAL, andFULLTEXTmodifiers are all recognized.ALTER TABLE ... ADD CONSTRAINT: Primary key, foreign key, and unique constraints, with long
REFERENCES,ON UPDATE, andON DELETEchains split across lines. ACHECKconstraint holds an expression rather than a column list, so it stays on one line.CREATE VIEW:
SELECT,FROM,WHERE,GROUP BY,HAVING,ORDER BY,JOIN, andUNIONeach start a new line. Materialized views are included.CREATE SEQUENCE:
START WITH,INCREMENT BY,MINVALUE,MAXVALUE,CACHE,ORDER, andCYCLEeach start a new line.CREATE TYPE ... AS (...): One attribute per line, for PostgreSQL composite types.
Microsoft SQL Server extended properties: One argument per line in the
sp_addextendedpropertyandsp_updateextendedpropertyblocks. These are the longest statements Liquibase generates, reaching 800 characters on a single line.
A list holding a single column or attribute stays on one line, because splitting it gains nothing. A primary key or other table-level constraint counts as an item in the list, so a table with one column and a primary key is still split across lines.
What Liquibase leaves alone
Anything Liquibase does not recognize is written exactly as it was generated. That includes:
Stored logic: Procedures, functions, triggers, and packages are never reformatted. The database returns these bodies as their author wrote them, and reformatting procedural code risks corrupting it.
Statements that are already short:
COMMENT ON,GRANT,REVOKE, default values, autoincrement andNOT NULLconstraints, drops, and renames.Data statements:
INSERT,UPDATE,DELETE, andMERGE.
Note: For the directory layout that each --object-changelogs value writes to disk, including the by-table layout, see Generate your changelog structure with --object-changelogs.
Default diff types
Specific diff types
Parameters
Global parameters
Attribute | Definition | Requirement |
| When | Optional |
| Comma-separated list of Example: Uses prefix matching: • With a trailing dot (e.g., • Without a trailing dot (e.g., Ignored if | Optional |
| When Use this to prevent false positive drift detection caused by system-managed If both this parameter and Default: | Optional |
| Your Liquibase Pro license key | Required |
| Liquibase Secure 5.1.0+. Oracle only. Sets the maximum number of rows Liquibase loads into memory from a single query while it inspects your database. If a query returns more rows, the command fails with an error. Set it to | Optional |
Command parameters
Attribute | Definition | Requirement |
| The JDBC database connection URL. | Required |
| Specifies the author for changesets in the generated changelog. | Optional |
| Changelog file to write results | Optional |
| Specifies the context filter to generate and apply to all changesets in your changelog. Useful to set many contexts quickly. Similar to the set-contexts command. Available in Liquibase 4.24.0 and later. Contexts are tags you can add to changesets to control which changesets will be executed in any particular migration run. After generating changesets with contexts, to deploy specific changes according to these contexts, you must run a command that specifies a context filter. For example, | Optional |
| Specifies a directory to send the loadData output to a CSV file which is generated by running the | Optional |
| Name of the default catalog to use for the database connection | Optional |
| Name of the default schema to use for the database connection. If Note: In the properties file and Note: In Liquibase 4.12.0 and later, you can use mixed-case schema names if you set | Optional |
| Specifies the types of objects to compare. Specify multiple values as a comma-separated list (without spaces). Valid values are: If null, default types are Liquibase Secure 5.1.0+. Snowflake accepted values are: Note: For Snowflake, unique constraints are not snapshotted as standalone objects. Instead, uniqueness is captured as the Snowflake view and table support has been enhanced with four Snowflake-specific view and table objects: Snowflake standard views, Snowflake materialized views, Snowflake standard tables, and Snowflake dynamic tables. The generic Liquibase VIEW and TABLE objects are supported for backward compatibility in CRUD operations only and do not support database inspection. For full Snowflake functionality, use the Snowflake standard view, Snowflake standard table, and Snowflake dynamic table objects. The Snowflake materialized view objects support CRUD operations. Note: The diff types | Optional |
| The JDBC driver class | Optional |
| The JDBC driver properties file | Optional |
| Objects to exclude from diff | Optional |
| Controls behavior when snapshots reference objects from schemas not included in the snapshot (like cross-schema triggers or foreign keys)
Default: | Optional |
| If | Optional |
| Objects to include in diff | Optional |
| If When specifying multiple schemas see Diff multiple schemas in Liquibase for file path considerations when same-named objects exist across schemas. | Optional |
| Includes the tablespace of tables and indexes in a generated changesets if the value is | Optional * |
| Specifies the label filter to generate and apply to all changesets in your changelog. Useful to set many labels quickly. Similar to the set-labels command. Available in Liquibase 4.24.0 and later. Labels are tags you can add to changesets to control which changeset will be executed in any migration run. After generating changesets with labels, to deploy specific changes according to these labels, you must run a command that specifies a label filter. For example, | Optional |
| Generates a separate changelog for each object. Valid values:
Default: | Optional |
| Lets you replace the schemas in the output changelog. This is a CSV list. The parameter size must match Example: | Optional |
| Determines whether | Optional |
| Password to connect to the target database. | Optional |
| Specify Change Types you want to target. Liquibase sets | Optional |
| Specify Change Types you want to target. Liquibase sets | Optional |
| Specifies database schemas you want to include | Optional |
| When Supported for: Oracle, Postgres, SQL Server, MySQL, MariaDB, DB2, Snowflake, Databricks, MongoDB, and BigQuery. | Optional |
| Username to connect to the target database. | Optional |
Global parameters
Attribute | Definition | Requirement |
| When | Optional |
| Comma-separated list of Example: Uses prefix matching: • With a trailing dot (e.g., • Without a trailing dot (e.g., Ignored if | Optional |
| When Use this to prevent false positive drift detection caused by system-managed If both this parameter and Default: | Optional |
| Your Liquibase Pro license key | Required |
| Liquibase Secure 5.1.0+. Oracle only. Sets the maximum number of rows Liquibase loads into memory from a single query while it inspects your database. If a query returns more rows, the command fails with an error. Set it to | Optional |
Command parameters
Attribute | Definition | Requirement |
| The JDBC database connection URL. | Required |
| Specifies the author for changesets in the generated changelog. | Optional |
| Changelog file to write results | Optional |
| Specifies the context filter to generate and apply to all changesets in your changelog. Useful to set many contexts quickly. Similar to the set-contexts command. Available in Liquibase 4.24.0 and later. Contexts are tags you can add to changesets to control which changesets will be executed in any particular migration run. After generating changesets with contexts, to deploy specific changes according to these contexts, you must run a command that specifies a context filter. For example, | Optional |
| Specifies a directory to send the loadData output to a CSV file which is generated by running the | Optional |
| Name of the default catalog to use for the database connection | Optional |
| Name of the default schema to use for the database connection. If Note: In the properties file and Note: In Liquibase 4.12.0 and later, you can use mixed-case schema names if you set | Optional |
| Specifies the types of objects to compare. Specify multiple values as a comma-separated list (without spaces). Valid values are: If null, default types are Liquibase Secure 5.1.0+. Snowflake accepted values are: Note: For Snowflake, unique constraints are not snapshotted as standalone objects. Instead, uniqueness is captured as the Snowflake view and table support has been enhanced with four Snowflake-specific view and table objects: Snowflake standard views, Snowflake materialized views, Snowflake standard tables, and Snowflake dynamic tables. The generic Liquibase VIEW and TABLE objects are supported for backward compatibility in CRUD operations only and do not support database inspection. For full Snowflake functionality, use the Snowflake standard view, Snowflake standard table, and Snowflake dynamic table objects. The Snowflake materialized view objects support CRUD operations. Note: The diff types | Optional |
| The JDBC driver class | Optional |
| The JDBC driver properties file | Optional |
| Objects to exclude from diff | Optional |
| Controls behavior when snapshots reference objects from schemas not included in the snapshot (like cross-schema triggers or foreign keys)
Default: | Optional |
| If | Optional |
| Objects to include in diff | Optional |
| If When specifying multiple schemas see Diff multiple schemas in Liquibase for file path considerations when same-named objects exist across schemas. | Optional |
| Includes the tablespace of tables and indexes in a generated changesets if the value is | Optional * |
| Specifies the label filter to generate and apply to all changesets in your changelog. Useful to set many labels quickly. Similar to the set-labels command. Available in Liquibase 4.24.0 and later. Labels are tags you can add to changesets to control which changeset will be executed in any migration run. After generating changesets with labels, to deploy specific changes according to these labels, you must run a command that specifies a label filter. For example, | Optional |
| Generates a separate changelog for each object. Valid values:
Default: | Optional |
| Lets you replace the schemas in the output changelog. This is a CSV list. The parameter size must match Example: | Optional |
| Determines whether | Optional |
| Password to connect to the target database. | Optional |
| Specify Change Types you want to target. Liquibase sets | Optional |
| Specify Change Types you want to target. Liquibase sets | Optional |
| Specifies database schemas you want to include | Optional |
| When Supported for: Oracle, Postgres, SQL Server, MySQL, MariaDB, DB2, Snowflake, Databricks, MongoDB, and BigQuery. | Optional |
| Username to connect to the target database. | Optional |
Global parameters
Attribute | Definition | Requirement |
| When | Optional |
| Comma-separated list of Example: Uses prefix matching: • With a trailing dot (e.g., • Without a trailing dot (e.g., Ignored if | Optional |
| When Use this to prevent false positive drift detection caused by system-managed If both this parameter and Default: | Optional |
| Your Liquibase Pro license key | Required |
| Liquibase Secure 5.1.0+. Oracle only. Sets the maximum number of rows Liquibase loads into memory from a single query while it inspects your database. If a query returns more rows, the command fails with an error. Set it to | Optional |
Command parameters
Attribute | Definition | Requirement |
| The JDBC database connection URL. | Required |
| Specifies the author for changesets in the generated changelog. | Optional |
| Changelog file to write results | Optional |
| Specifies the context filter to generate and apply to all changesets in your changelog. Useful to set many contexts quickly. Similar to the set-contexts command. Available in Liquibase 4.24.0 and later. Contexts are tags you can add to changesets to control which changesets will be executed in any particular migration run. After generating changesets with contexts, to deploy specific changes according to these contexts, you must run a command that specifies a context filter. For example, | Optional |
| Specifies a directory to send the loadData output to a CSV file which is generated by running the | Optional |
| Name of the default catalog to use for the database connection | Optional |
| Name of the default schema to use for the database connection. If Note: In the properties file and Note: In Liquibase 4.12.0 and later, you can use mixed-case schema names if you set | Optional |
| Specifies the types of objects to compare. Specify multiple values as a comma-separated list (without spaces). Valid values are: If null, default types are Liquibase Secure 5.1.0+. Snowflake accepted values are: Snowflake view and table support has been enhanced with four Snowflake-specific view and table objects: Snowflake standard views, Snowflake materialized views, Snowflake standard tables, and Snowflake dynamic tables. The generic Liquibase VIEW and TABLE objects are supported for backward compatibility in CRUD operations only and do not support database inspection. For full Snowflake functionality, use the Snowflake standard view, Snowflake standard table, and Snowflake dynamic table objects. The Snowflake materialized view objects support CRUD operations. Note: The diff types | Optional |
| The JDBC driver class | Optional |
| The JDBC driver properties file | Optional |
| Objects to exclude from diff | Optional |
| Controls behavior when snapshots reference objects from schemas not included in the snapshot (like cross-schema triggers or foreign keys)
Default: | Optional |
| If | Optional |
| Objects to include in diff | Optional |
| If When specifying multiple schemas see Diff multiple schemas in Liquibase for file path considerations when same-named objects exist across schemas. | Optional |
| Includes the tablespace of tables and indexes in a generated changesets if the value is | Optional * |
| Specifies the label filter to generate and apply to all changesets in your changelog. Useful to set many labels quickly. Similar to the set-labels command. Available in Liquibase 4.24.0 and later. Labels are tags you can add to changesets to control which changeset will be executed in any migration run. After generating changesets with labels, to deploy specific changes according to these labels, you must run a command that specifies a label filter. For example, | Optional |
| Generates a separate changelog for each object. Valid values:
Default: | Optional |
| Lets you replace the schemas in the output changelog. This is a CSV list. The parameter size must match Example: | Optional |
| Determines whether | Optional |
| Password to connect to the target database. | Optional |
| Specify Change Types you want to target. Liquibase sets | Optional |
| Specify Change Types you want to target. Liquibase sets | Optional |
| Specifies database schemas you want to include | Optional |
| When Supported for: Oracle, Postgres, SQL Server, MySQL, MariaDB, DB2, Snowflake, Databricks, MongoDB, and BigQuery. | Optional |
| Username to connect to the target database. | Optional |
Global parameters
Attribute | Definition | Requirement |
| When | Optional |
| Comma-separated list of Example: Uses prefix matching: • With a trailing dot (e.g., • Without a trailing dot (e.g., Ignored if | Optional |
| When Use this to prevent false positive drift detection caused by system-managed If both this parameter and Default: | Optional |
| Your Liquibase Pro license key | Required |
| Liquibase Secure 5.1.0+. Oracle only. Sets the maximum number of rows Liquibase loads into memory from a single query while it inspects your database. If a query returns more rows, the command fails with an error. Set it to | Optional |
Command parameters
Attribute | Definition | Requirement |
| The JDBC database connection URL. | Required |
| Specifies the author for changesets in the generated changelog. | Optional |
| Changelog file to write results | Optional |
| Specifies the context filter to generate and apply to all changesets in your changelog. Useful to set many contexts quickly. Similar to the set-contexts command. Available in Liquibase 4.24.0 and later. Contexts are tags you can add to changesets to control which changesets will be executed in any particular migration run. After generating changesets with contexts, to deploy specific changes according to these contexts, you must run a command that specifies a context filter. For example, | Optional |
| Specifies a directory to send the loadData output to a CSV file which is generated by running the | Optional |
| Name of the default catalog to use for the database connection | Optional |
| Name of the default schema to use for the database connection. If Note: In the properties file and Note: In Liquibase 4.12.0 and later, you can use mixed-case schema names if you set | Optional |
| Specifies the types of objects to compare. Specify multiple values as a comma-separated list (without spaces). Valid values are: If null, default types are Liquibase Secure 5.1.0+. Snowflake accepted values are: Snowflake view and table support has been enhanced with four Snowflake-specific view and table objects: Snowflake standard views, Snowflake materialized views, Snowflake standard tables, and Snowflake dynamic tables. The generic Liquibase VIEW and TABLE objects are supported for backward compatibility in CRUD operations only and do not support database inspection. For full Snowflake functionality, use the Snowflake standard view, Snowflake standard table, and Snowflake dynamic table objects. The Snowflake materialized view objects support CRUD operations. Note: The diff types | Optional |
| The JDBC driver class | Optional |
| The JDBC driver properties file | Optional |
| Objects to exclude from diff | Optional |
Unix
| Controls behavior when snapshots reference objects from schemas not included in the snapshot (like cross-schema triggers or foreign keys)
Default: | Optional |
| If | Optional |
| Objects to include in diff | Optional |
| If When specifying multiple schemas see Diff multiple schemas in Liquibase for file path considerations when same-named objects exist across schemas. | Optional |
| Includes the tablespace of tables and indexes in a generated changesets if the value is | Optional * |
| Specifies the label filter to generate and apply to all changesets in your changelog. Useful to set many labels quickly. Similar to the set-labels command. Available in Liquibase 4.24.0 and later. Labels are tags you can add to changesets to control which changeset will be executed in any migration run. After generating changesets with labels, to deploy specific changes according to these labels, you must run a command that specifies a label filter. For example, | Optional |
| Generates a separate changelog for each object. Valid values:
Default: | Optional |
| Lets you replace the schemas in the output changelog. This is a CSV list. The parameter size must match Example: | Optional |
| Determines whether | Optional |
| Password to connect to the target database. | Optional |
| Specify Change Types you want to target. Liquibase sets | Optional |
| Specify Change Types you want to target. Liquibase sets | Optional |
| Specifies database schemas you want to include | Optional |
| When Supported for: Oracle, Postgres, SQL Server, MySQL, MariaDB, DB2, Snowflake, Databricks, MongoDB, and BigQuery. | Optional |
Unix:
Windows:
| Liquibase Secure 5.1+
This is a JVM system property that controls how the Oracle JDBC driver handles fetch sizes when querying tables containing LONG or LONG RAW columns. It is available in Liquibase 5.1.0 and later. The default value is You might want to set this property to | Optional |
| Username to connect to the target database. | Optional |
Global parameters
Attribute | Definition | Requirement |
| When | Optional |
| Comma-separated list of Example: Uses prefix matching: • With a trailing dot (e.g., • Without a trailing dot (e.g., Ignored if | Optional |
| When Use this to prevent false positive drift detection caused by system-managed If both this parameter and Default: | Optional |
| Your Liquibase Pro license key | Required |
| Liquibase Secure 5.1.0+. Oracle only. Sets the maximum number of rows Liquibase loads into memory from a single query while it inspects your database. If a query returns more rows, the command fails with an error. Set it to | Optional |
Command parameters
Attribute | Definition | Requirement |
| The JDBC database connection URL. | Required |
| Specifies the author for changesets in the generated changelog. | Optional |
| Changelog file to write results | Optional |
| Specifies the context filter to generate and apply to all changesets in your changelog. Useful to set many contexts quickly. Similar to the set-contexts command. Available in Liquibase 4.24.0 and later. Contexts are tags you can add to changesets to control which changesets will be executed in any particular migration run. After generating changesets with contexts, to deploy specific changes according to these contexts, you must run a command that specifies a context filter. For example, | Optional |
| Specifies a directory to send the loadData output to a CSV file which is generated by running the | Optional |
| Name of the default catalog to use for the database connection | Optional |
| Name of the default schema to use for the database connection. If Note: In the properties file and Note: In Liquibase 4.12.0 and later, you can use mixed-case schema names if you set | Optional |
| Specifies the types of objects to compare. Specify multiple values as a comma-separated list (without spaces). Valid values are: If null, default types are Liquibase Secure 5.1.0+. Snowflake accepted values are: Snowflake view and table support has been enhanced with four Snowflake-specific view and table objects: Snowflake standard views, Snowflake materialized views, Snowflake standard tables, and Snowflake dynamic tables. The generic Liquibase VIEW and TABLE objects are supported for backward compatibility in CRUD operations only and do not support database inspection. For full Snowflake functionality, use the Snowflake standard view, Snowflake standard table, and Snowflake dynamic table objects. The Snowflake materialized view objects support CRUD operations. Note: The diff types | Optional |
| The JDBC driver class | Optional |
| The JDBC driver properties file | Optional |
| Objects to exclude from diff | Optional |
| Controls behavior when snapshots reference objects from schemas not included in the snapshot (like cross-schema triggers or foreign keys)
Default: | Optional |
| If | Optional |
| Objects to include in diff | Optional |
| If When specifying multiple schemas see Diff multiple schemas in Liquibase for file path considerations when same-named objects exist across schemas. | Optional |
| Includes the tablespace of tables and indexes in a generated changesets if the value is | Optional * |
| Specifies the label filter to generate and apply to all changesets in your changelog. Useful to set many labels quickly. Similar to the set-labels command. Available in Liquibase 4.24.0 and later. Labels are tags you can add to changesets to control which changeset will be executed in any migration run. After generating changesets with labels, to deploy specific changes according to these labels, you must run a command that specifies a label filter. For example, | Optional |
| Generates a separate changelog for each object. Valid values:
Default: | Optional |
| Lets you replace the schemas in the output changelog. This is a CSV list. The parameter size must match Example: | Optional |
| Determines whether | Optional |
| Password to connect to the target database. | Optional |
| Specify Change Types you want to target. Liquibase sets | Optional |
| Specify Change Types you want to target. Liquibase sets | Optional |
| Specifies database schemas you want to include | Optional |
| When Supported for: Oracle, Postgres, SQL Server, MySQL, MariaDB, DB2, Snowflake, Databricks, MongoDB, and BigQuery. | Optional |
| Username to connect to the target database. | Optional |
The generate-changelog command supports formatted SQL output. You can specify a changelog filename in the format changelog.<database short name>.sql, and Liquibase infers the target database from the short name embedded in the filename. The short name segment is optional. If you omit it, for example changelog.sql, Liquibase infers the target database from your connection instead. In Liquibase Secure 5.2 and earlier, omitting the segment works only when you are connected to PostgreSQL.
Database short names
Database | Short name | Example filename |
Oracle | oracle | changelog.oracle.sql |
MySQL | mysql | changelog.mysql.sql |
MariaDB | mariadb | changelog.mariadb.sql |
PostgreSQL | postgresql | changelog.postgresql.sql |
SQL Server | mssql | changelog.mssql.sql |
DB2 (LUW) | db2 | changelog.db2.sql |
DB2 (z/OS) | db2z | changelog.db2z.sql |
H2 | h2 | changelog.h2.sql |
HSQLDB | hsqldb | changelog.hsqldb.sql |
SQLite | sqlite | changelog.sqlite.sql |
Derby | derby | changelog.derby.sql |
Firebird | firebird | changelog.firebird.sql |
Informix | informix | changelog.informix.sql |
Ingres | ingres | changelog.ingres.sql |
Sybase | sybase | changelog.sybase.sql |
Sybase ASA (SQL Anywhere) | asany | changelog.asany.sql |
CockroachDB | cockroachdb | changelog.cockroachdb.sql |
EnterpriseDB | edb | changelog.edb.sql |
Snowflake | snowflake | changelog.snowflake.sql |
Databricks | databricks | changelog.databricks.sql |
BigQuery | bigquery | changelog.bigquery.sql |
Cassandra | cassandra | changelog.cassandra.sql |
Database objects supported by Liquibase
You can use the following object types in Liquibase:
Object type |
syntax | Liquibase edition |
Catalog |
| Liquibase Open Source |
Column |
| Liquibase Open Source |
Data |
| Liquibase Open Source |
Foreign key |
| Liquibase Open Source |
Index |
| Liquibase Open Source |
NOT NULL constraint | N/A | Liquibase Open Source |
Primary key |
| Liquibase Open Source |
Schema | N/A | Liquibase Open Source |
Sequence |
| Liquibase Open Source |
Table |
| Liquibase Open Source |
Unique constraint |
| Liquibase Open Source |
View |
| Liquibase Open Source |
Check constraint |
| Liquibase Secure |
Composite type |
| Liquibase Secure |
Function |
| Liquibase Secure |
Package |
| Liquibase Secure |
Package body |
| Liquibase Secure |
Stored procedure |
| Liquibase Secure |
Trigger |
| Liquibase Secure |
Liquibase Secure stored logic behavior
While Liquibase Open Source stores all changesets in a changelog, Liquibase Secure creates a directory called Objects and places the directory at the same level as your changelog.
The Objects directory contains subdirectories for each of the stored logic types:
packagepackagebodyfunctionstored proceduretrigger
Note: Some database platforms may not support all of these stored logic types.
The generate-changelog command will not create the Objects directory if:
You don't have a valid Liquibase Secure license key.
Stored logic is not present in the database.
The target database does not support the
generate-changelogcommand and stored logic objects.The changelog file is written in formatted SQL. The
Objectsfolder can only be created when generating XML, JSON, or YAML changelogs.There is a pre-existing directory called
Objectsthat was created outside Liquibase.
If your database contains Stored Logic objects, you may have issues attempting to run the generate-changelog command more than once, even with a new changelog name, because the stored logic files already exist in the Objects directory.
To generate a newer version of the changelog file with stored logic objects based on the current database state, you need to delete, rename, or move the Objects directory that was created by running the generate-changelog command previously. Then, you can run the generate-changelog command again.
Note: If there is a pre-existing Objects directory that is not related to Liquibase, you need to delete, rename, or move it to run the generate-changelog command.
If you want to track the history of stored logic objects, use the diff-changelog command. The diff-changelog command structures stored logic files into timestamped directories every time you run the command.
Note: For JVM heap and RAM sizing guidance when running this command against large schemas, see Size JVM heap and RAM for diff-class commands.