E
E
Evgeny Bessonov2018-08-17 10:57:59
PostgreSQL
Evgeny Bessonov, 2018-08-17 10:57:59

How to "move" to Liquibase?

Hello.
I ask for hints/criticisms on the process of migrating to Liquibase.
Given:
1. Dump of the PostgreSQL database (in the plain format, i.e., in fact, database filling scripts).
2. The main application that uses this database in java, there is another one in php
Need: for this database, implement the use of database migration scripts. Those. ideal when the application starts and automatically creates or migrates the database. Now it is done by hand.
It is proposed to achieve the goal in steps:
1. Divide the dump into 2 separate parts: database schema, data (reference data, initial values ​​of application parameters).
2. Divide the file with the schema creation script into separate scripts that create database objects: extensions, functions, tables.
3. The file with the scripts that create the data is also divided into separate files for each table.
4. For each resulting file, describe the corresponding changeset in liuquibase format (YAML personal preference).
5. Transfer this set to developers for embedding in the application.
If there was a similar experience, please tell me what is not taken into account in this scheme. Or perhaps something extra. And, most importantly, what tools are there to automate the process of such a migration.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DS1977, 2018-08-17
@DS1977

In principle, we, at one time, had the same approach.
Just in case, I will mention:
- We remembered that sooner or later we would have to update the existing (working) database, and did not forget about preconditions for each set'a
- We wrote tests for migration using dunit, dbunit-rules and yandex postgresql-embedded

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question