Skip to content

Latest commit

 

History

History
44 lines (29 loc) · 800 Bytes

README.md

File metadata and controls

44 lines (29 loc) · 800 Bytes

Flyway SQL Server Starter

Create Sample Database

export SA_PASSWORD=Password1

sqlcmd -S 127.0.0.1 -U sa -P $SA_PASSWORD \
    -Q "CREATE DATABASE db_example"
sqlcmd -S 127.0.0.1 -U sa -P $SA_PASSWORD \
    -Q "SELECT name FROM sys.databases"

How to Run

brew install flyway
# or see https://flywaydb.org/getstarted/firststeps/commandline

# show current db version status
flyway info

# apply migration
flyway migrate

# check diff of db version and sql file version
flyway validate

Check the result

sqlcmd -S 127.0.0.1 -U sa -P $SA_PASSWORD -d db_example \
    -Q "SELECT * FROM person"

Reference