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"
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"