-
Notifications
You must be signed in to change notification settings - Fork 0
Database Flyway Migration
Dmitrii Hromtsov edited this page Jan 30, 2023
·
5 revisions
FlyWay is being used in order to create migrations. Flyway is an industry leading database versioning framework that aims to unlock DevOps for the database. It strongly favors simplicity and convention over configuration.
-
Create system environment variables
-
Download latest PostgreSQL and install it on default port (5432) as service.
-
Create user with credentials
- db_user
- db_password
- Create business-lunch-provider-db for db_user.
- Run docker-compose.yml database service
Run Backend application. This way FlyWay will automatically create the required blp_schema and apply migrations needed.
Flyway adheres to the following naming convention for migration scripts: Prefix_Version__Description.sql
Where:
- Prefix – The default prefix is V, which we can change in the above configuration file using the flyway.sqlMigrationPrefix property.
- Version – Migration version number. Major and minor versions may be separated by an underscore. The migration version should always start with 1.
- Description – Textual description of the migration. A double underscore separates the description from the version numbers. Example: V1_1_0__my_first_migration.sql
BLP project uses default versioning starting with V1_0_0__init_ddl.sql as first migration