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.