-
Notifications
You must be signed in to change notification settings - Fork 0
Flyway DB Schema Migration π
Lyes S edited this page May 7, 2022
·
5 revisions
Table Of Contents
mitsuke ( β₯β£_β’β€ ) : ~/eclipse-workspace/network-device-inventory$ chmod +x scripts/inventory-profile-deployment/network-device-inventory-flyway-db-schema-migration-script
Schema Migration from : V1 -> V2
DDL V1__init.sql : Database-Modeling-and-Design#data-definition-language
mitsuke ( β₯β£_β’β€ ) : ~/eclipse-workspace/network-device-inventory/flyway-service/sql_versions$ ll
total 16
drwxrwxr-x 2 lsefiane lsefiane 4096 Jan 1 23:41 ./
drwxrwxr-x 3 lsefiane lsefiane 4096 Jan 1 19:26 ../
-rw-rw-r-- 1 lsefiane lsefiane 740 Jan 1 17:22 V1__init.sql
-rw-rw-r-- 1 lsefiane lsefiane 68 Jan 1 23:34 V2__add_description_column_to_table_network_device.sql
DDL V2__add_description_column_to_table_network_device
mitsuke ( β₯β£_β’β€ ) : ~/eclipse-workspace/network-device-inventory/flyway-service/sql_versions$ cat V2__add_description_column_to_table_network_device.sql
ALTER TABLE network_device
ADD description VARCHAR (255) NOT NULL;
Successfully applied 1 migration to schema "public", now at version v2 (execution time 00:00.037s)
mitsuke ( β₯β£_β’β€ ) : ~/eclipse-workspace/network-device-inventory$ ./scripts/inventory-profile-deployment/network-device-inventory-flyway-db-schema-migration-script
ββββ βββββββββββββββββββββββ βββ βββββββ βββββββ βββ βββ βββββββ βββββββββββ ββββββ βββββββββββββββ
βββββ βββββββββββββββββββββββ βββββββββββββββββββββββ ββββ βββββββββββββββββββ ββββββββββββββββββββββ
ββββββ βββββββββ βββ βββ ββ ββββββ ββββββββββββββββββ βββ βββββββββ βββ βββββββββ ββββββ
ββββββββββββββββ βββ βββββββββββββ ββββββββββββββββββ βββ βββββββββ ββββ ββββββββββ ββββββ
βββ ββββββββββββββ βββ ββββββββββββββββββββββ ββββββ βββ ββββββββββββββββ βββββββ βββββββββββββββββββ
βββ βββββββββββββ βββ ββββββββ βββββββ βββ ββββββ βββ βββββββ ββββββββ βββββ βββ βββββββββββββββ
βββββββ ββββββ βββββββββββββββ ββββββββββββ βββββββ βββββββ βββ βββ
ββββββββ ββββββ ββββββββββββββββ βββββββββββββββββββββββββββββββββ ββββ
βββββββββ ββββββ βββββββββ ββββββ βββ βββ βββ βββββββββββ βββββββ
βββββββββββββββββ ββββββββββ ββββββββββ βββ βββ βββββββββββ βββββ
ββββββ ββββββ βββββββ βββββββββββ ββββββ βββ ββββββββββββ βββ βββ
ββββββ βββββ βββββ βββββββββββ βββββ βββ βββββββ βββ βββ βββ
βββββββββββ βββ ββββββ βββ ββββββ βββ βββ βββββββ βββββββ ββββββββ ββββββββββ βββββββββββββββ ββββ ββββββ
βββββββββββ ββββ βββββββ βββββββββββββββ ββββ ββββββββββββββββ βββββββββββββββββββ ββββββββββββββββ βββββββββββββ
ββββββ βββ βββββββ βββ ββ βββββββββββ βββββββ βββ βββββββββββ βββββββββββ ββββββββββββββ βββββββββββββββββββ
ββββββ βββ βββββ ββββββββββββββββββ βββββ βββ βββββββββββ βββββββββββ ββββββββββββββ βββββββββββββββββββ
βββ βββββββββββ βββββββββββββ βββ βββ ββββββββββββββββ βββββββββββββββββββ ββββββββββββββ βββ ββββββ βββ
βββ βββββββββββ ββββββββ βββ βββ βββ βββββββ βββββββ ββββββββ ββββββββββ ββββββββββββββ ββββββ βββ
ββββ βββββββ βββββββ βββββββ ββββββ ββββββββββββ βββββββ ββββ βββ
βββββ ββββββββββββββββ ββββββββββββββββββββββββββββββββββββββββββ βββ
βββββββββββββββββ ββββββββββββββββββββ βββ ββββββ βββββββββ βββ
βββββββββββββββββ βββββββββββββββββββ βββ ββββββ βββββββββββββ
βββ βββ ββββββββββββββββββ ββββββ βββ βββ βββββββββββββββ ββββββ
βββ ββββββ βββββββ βββ ββββββ βββ βββ βββ βββββββ βββ βββββ
Linux : Hi π ! please make a selection.
1) Flyway DB Schema Migration
2) quit
#? 1
SQL Migration file is required for this procedure. It should be added in : deployment/flyway/sql_versions
In order to be picked up by Flyway, SQL migration file must comply with a certain naming convention : https://flywaydb.org/documentation/concepts/migrations.html#naming
Continue ? [y|n] y
Flyway DB Schema Migration...
postgreSQL is up-to-date
Starting flyway ... done
Attaching to flyway
flyway | 2022-01-02T15:21:18.206300852Z Successfully applied 1 migration to schema "public", now at version v1 (execution time 00:00.061s)
flyway | 2022-01-02T15:22:36.232464241Z Flyway Teams Edition 8.3.0 by Redgate
flyway | 2022-01-02T15:22:36.236686892Z Database: jdbc:postgresql://postgres:5432/network_device_inventory (PostgreSQL 14.1)
flyway | 2022-01-02T15:22:36.262210399Z ----------------------------------------
flyway | 2022-01-02T15:22:36.262407702Z Flyway Teams features are enabled by default for the next 27 days. Learn more at https://rd.gt/3A4IWym
flyway | 2022-01-02T15:22:36.262569504Z ----------------------------------------
flyway | 2022-01-02T15:22:36.282814848Z Successfully validated 2 migrations (execution time 00:00.017s)
flyway | 2022-01-02T15:22:36.293210173Z Current version of schema "public": 1
flyway | 2022-01-02T15:22:36.308195254Z Migrating schema "public" to version "2 - add description column to table network device"
flyway | 2022-01-02T15:22:36.323510638Z Successfully applied 1 migration to schema "public", now at version v2 (execution time 00:00.038s)
Β© 2024 | Lyes Sefiane
All Rights Reserved | CC BY-NC-ND 4.0