Skip to content

Instantly share code, notes, and snippets.

@apolishch
Created August 13, 2019 15:46
Show Gist options
  • Save apolishch/4bb2581de12cf10378329eb28c385da0 to your computer and use it in GitHub Desktop.
Save apolishch/4bb2581de12cf10378329eb28c385da0 to your computer and use it in GitHub Desktop.
Migration script
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