Hello World to FlywayDB
Install Docker for Mac
manually
Then run:
# Install FlywayDB
brew install flyway
# Start Postgres
docker-compose up -d
# Run migration
flyway migrate
# Look at your Database
# Then undo migration (requires paid version)
flyway undo
-
V
at the beginning stands forVersion
which is used for Migrations -
U
at the beginning stands forUndo
which is used for Undos -
V1
stands forVersion 1
of the database -
V1_1
stands forStep 1
forVersion 1
of the database -
V1_2
stands forStep 2
forVersion 1
of the database -
V2
stands forVersion 2
of the database -
V2_1
stands forStep 1
forVersion 2
of the database -
V2_2
stands forStep 2
forVersion 2
of the database -
Similarly for
U
-
Every
V
should have a corespondingU
so you can move forward and backward through the database version (Think: Finite State Machine!!!)