Creating a liquibase.properties file allows you to store properties that don’t change often in a liquibase.properties file. You can also use parameters to specify your database connection information so Liquibase can access your database and save you the trouble of passing along command line arguments.
To create a liquibase.properties file, generate a new text file in your project Liquibase directory and name it liquibase.properties.
Note: The file can also be named something other than liquibase.properties and/or be in a completely different directory by using the –defaultsFile parameter during runtime. To learn more please see Liquibase Command Line.
The most common properties that you might set in the liquibase.properties are listed below. Any parameter that could be specified on the command line can also be specified in the properties file. If a parameter is specified in both the properties file and the command line, the command line value will override the value in the file.
Parameter | Definition |
---|---|
changeLogFile | The path for your changelog file |
driver | The driver class name for your source database |
url | The primary database when doing an update, or the source database for performing comparisons. |
username | The username for your source database. |
password | The password for your source database. |
referenceDriver | The driver class name for your target database. |
referenceUrl | The database you want to use to compare to your source database. Also known as your target. |
referenceUsername | The username for your target database. |
referencePassword | The password for your target database. |
liquibaseProLicenseKey | Your Liquibase Pro license key (If you have one). |
classpath | The path for your database driver |
parameter. [parameter name] |
Define global change log parameter. E.g. parameter.table.name: tableA |
Different commands require different parameter information to work. For more information on parameter requirements, search the Liquibase Command topics in the knowledge base.
Parameter | Definition |
---|---|
includeCatalogInSpecification | boolean Should Liquibase include the catalog name when determining equality? |
convertDataTypes | boolean Should Liquibase convert to/from STANDARD data types. Applies to both snapshot and update commands. Default= true |