8 The Liquibase Page
The Liquibase page displays information of all database deployments made in the current schema. A deployment consists of changesets, which is a list of sequential changes to be applied to the database.
To navigate to the Liquibase page, do either of the following:
In the Launchpad page, click Liquibase.
Click Selector to display the navigation menu. Under Development, select Liquibase.
If you have not made any deployments into the schema and you access the Liquibase page, no data appears.
8.1 Generate a Deployment
First, you have to make changes in the current schema such as creating a table, procedure or any database object.
Then, create a folder that will contain the changesets for the deployment. It is a good practice to create a different folder for each deployment. This ensures that you have information of all the deployments, in case you want to roll back to a previous version.
In the following example, Oracle SQLcl is used to deploy the changes.
- Open the terminal and navigate to the path of the folder that you will use to save the changes made to the database (changelog files).
- After you navigate to the correct path, log in to the schema you want to
capture with the following command:
- You can do one of the following:
- Deploy the entire schema with the following
This command creates a controller.xml file that includes all the changesets for the schema.
- Deploy a specific object using the following
lb genobject -type <object_type> -name <object_name>
This command generates the changelogs (which are XML files) that contain the changes made to the database in the current folder.
- Deploy the entire schema with the following command:
- Log in to the schema where you want to add these changes (in this example, XYZ)
with the following command:
- Run the following command:
lb update -changelog controller.xml (or the file name of your changelog)
- Log in to Database Actions on the schema where you deployed the changes and the Liquibase page displays information about the deployment.
8.2 About the Liquibase User Interface
In the Liquibase page, the card at the top displays the Liquibase status. The deployments are displayed as cards below, as shown in the following figure.
Liquibase runs only one deployment at a time. When there is no deployment running, the top Liquibase card indicates that Liquibase is currently unlocked and displays the ID of the last deployment.
If there is a deployment running at the time, the card indicates that Liquibase is locked, and displays the name of the resource blocking it and the time at which the deployment started.
The card for each deployment provides details such as the schema, deployment id, start and complete deployment date and time, and number of changesets run in the deployment. To open a specific deployment page, click the title of the card, or click Open Deployment Changes in the context menu.
In a deployment page, the changesets that have been run for that specific deployment is displayed below. The Current Deployment card at the top shows the deployment to which the changesets belong.
Each changeset card displays the changeset name, the date and time when the changeset started deploying, and the schema where the change was deployed.
The context menu for a changeset consists of the following options:
- Previous Object State XML: Displays an XML showing the state of the object (table, procedure) before the changeset was applied. If the object did not exist previously on the database (example, a table that was created in the deployment ), the following message is displayed: xml code not available....
- Show Executed SQL: Displays the SQL code that was executed when the changeset was deployed.