Using Liquibase Pro
Suggest editsLiquibase is a development tool that allows changes to be applied to the EDB database using the Liquibase CLI and viewed on the Liquibase Hub.
Creating a Project on Liquibase Hub
Use the following steps to create a project for the target database instance on the Liquibase Hub. All data related to the target database is stored in this project.
Log in to the Liquibase Hub console.
Select the Projects menu.
Create a Project on the Liquibase Hub by selecting Create Project.
On the Create Project page, enter the name and description of the project.
Select Create Project.
Applying Database Changes
This section provides examples of applying database changes using Liquibase changesets including:
Refer to the Liquibase documentation for available change types.
Note
All Liquibase commands in the examples are executed from the directory where Liquibase Pro is installed.
The initial database objects and data for these examples are created using this sample script:
Updating Tables
Create a changelog file using one of the following options for creating a changelog file:
Create the file manually. See the following changelog file example. For detailed information on changelogs, refer to the changelog documentation from Liquibase.
Generate a sample file and update it with your changes. Generate the sample changelog file using this command:
./liquibase --changeLogFile=edb_dbchangelog.xml generateChangeLog
Note
Before the command is run Liquibase will take a snapshot of the database, which is an essential step in the process.
For each database change, add a changeset entry to the changelog file. For detailed information on changesets, refer to the changeset documentation from Liquibase.
To register the changelog with the Liquibase Hub and provide the project name, execute this command:
./liquibase registerChangeLog
Sample output:
To update the table in the target database, use this command:
./liquibase update
Rolling Back Changes
Roll back changes made to the table using the rollbackCount
command. For example, this command uses the sample changelog file:
./liquibase rollbackCount 1
Viewing Database Changes On Liquibase Hub
To view the details of the changes made on the target database, select a ChangeLog link. For example, select dbchangelog.xml to see its details.
The diagram below shows the details for the selected changeset.
Could this page be better? Report a problem or suggest an addition!