Created
August 13, 2019 15:46
-
-
Save apolishch/4bb2581de12cf10378329eb28c385da0 to your computer and use it in GitHub Desktop.
Migration script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -eo pipefail | |
command="up" | |
input=$(echo "$2" | awk '{print tolower($0)}') | |
if [ "$input" == "down" ] ; then | |
command="down" | |
elif [ "$input" == "create" ] ; then | |
echo "Please do not attempt to create migrations directly from the server. Check out flock-core-migrations, and do this there!" | |
exit 1 | |
elif [ "$input" != "" ] && [ "$input" != "up" ] ; then | |
echo "You provided $1 which is an invalid command. Please provide one of 'up' or 'down'" | |
exit 1 | |
fi | |
npm explore @flockcover/flock-core-migrations npm run migrate $command --verbose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment