The article will be of interest to those who have ever thought about the issue of a change (patch) to a relational database. The article will not be interesting to those who have already mastered and uses Liquibase. The main purpose of this article is to provide a link to the repository with an example of use. As an example, I chose the rollout of the HR sample schema on the Oracle database (a list of all supported databases ) - anyone can download the repository and play at home. The desire to demonstrate an example is caused by the discussion of this issue on the sql.ru resource.
What is Liquibase, can be found on the official website of the product. I would like to mention a couple of good articles on this resource:
Manage database migrations with Liquibase
Using Liquibase without a headache. 10 tips from real development experience
My choice was on this tool, because:
1) The tool keeps track of which changesets have already been applied to this instance of the database and rolls only those that have not yet been rolled up and which still need to be added. If in the process of a roll forward, the application of any change fell with an error, then, after eliminating the cause, you restart the roll forward and Liquibase continues to execute from the changeset on which it stopped.
2) The ability to set changeset attributes runOnChange and runAlways greatly simplifies the management of changes, in particular, recreatable-objects.
3) The context property allows you to perform / not perform changesets depending on the current environment (for example, do not run unit tests on the prod).
It was not a complete list of features.
He is here . It contains "hard" (tables, indexes, integrity constraints) and "soft" (triggers, procedures, views) objects, changesets with sql and sqlFile tags, with and without runOnChange and runAlways attributes.
Due to the lack of need for a repository, there are no such useful features / steps that I usually use in my projects:
Source: https://habr.com/ru/post/339084/
All Articles