5 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 Selector icon 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.

Topics:

5.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.

  1. 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).
  2. After you navigate to the correct path, log in to the schema you want to capture with the following command:
    sqlcl <username>/<password>@<host>:<port>/<servicename>
  3. You can do one of the following:
    • Deploy the entire schema with the following command:
      lb genschema

      This command creates a controller.xml file that includes all the changesets for the schema.

    • Deploy a specific object using the following command:
      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.

  4. Log in to the schema where you want to add these changes (in this example, XYZ) with the following command:
    sqlcl xyz/<password>@<host>:<port>/<servicename>
  5. Run the following command:
    lb update -changelog controller.xml (or the file name of your changelog) 
  6. Log in to Database Actions on the schema where you deployed the changes and the Liquibase page displays information about the deployment.

5.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 Status

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.

Deployments

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.

deployment card

Changesets

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.