#!/usr/bin/env bash # Usage: # ./create_migration.sh name of migration # ./create_migration.sh "name of migration" # ./create_migration.sh name_of_migration set -euo pipefail cat < "_" title="$(echo "${@}" | tr "[:upper:]" "[:lower:]" | sed -E -e "s/( |-)/_/g")" migrate create -ext sql -dir . -seq "$title" # Point LATEST at the new migration so a concurrent migration PR # conflicts with this one in git. ../../../scripts/check_migrations_latest.sh --write echo "Run \"make gen\" to generate models." )