Integration of Liquibase as a versioning tool for changes in the Platform databases.

Introduction

Many of the evolutions that the platform presents, either to add new functionalities or to improve the existing ones, require modifications to our databases. To facilitate this process and automate it as much as possible, Liquibase has been added as a database change management tool.

What is Liquibase?

To run Liquibase on a database, you simply need to specify the database data. Once configured, it is enough to have the sentences to be applied in a file called changelog (which can be defined in different formats, facilitating the abstraction on the databases). Once executed, Liquibase generates information about the execution in the database, allowing both the analysis of the results, as well as the possibility of rollback.

How is Liquibase integrated into the continuous integration dynamics?

In order to make the necessary changes to the existing database schemas on the platform, Liquibase has been used by integrating it with Gitlab and Jenkins to follow a CI/CD cycle.

For this, we have used the containerized version of Liquibase, which will be launched on the target environment using Jenkins for this purpose.

We have configured this cycle in such a way that by parameterizing the execution simply with the version to be applied from Jenkins, it applies the whole process with Liquibase and the changelog corresponding to the version.

Liquibase therefore helps the process of automation and traceability of changes in a database.

Â