Fixes to the migration generator script.

This commit is contained in:
Jake Moshenko 2014-10-07 16:09:30 -04:00
parent fe59ad4fb5
commit 626d984fb2

View file

@ -35,11 +35,11 @@ down_postgres() {
}
gen_migrate() {
# Generate the migration to the current model.
GENMIGRATE=$1 PYTHONPATH=. alembic revision --autogenerate -m "$@"
# Generate a SQLite database with the schema as defined by the existing alembic model.
GENMIGRATE=$1 PYTHONPATH=. alembic upgrade head
# Generate the migration to the current model.
GENMIGRATE=$1 PYTHONPATH=. alembic revision --autogenerate -m "$2"
}
test_migrate() {
@ -59,7 +59,7 @@ if [ ! -z "$@" ]
then
set +e
echo '> Generating Migration'
gen_migrate "mysql"
gen_migrate "mysql" "$@"
set -e
fi