Fixes to the migration generator script.
This commit is contained in:
parent
fe59ad4fb5
commit
626d984fb2
1 changed files with 4 additions and 4 deletions
|
@ -35,11 +35,11 @@ down_postgres() {
|
||||||
}
|
}
|
||||||
|
|
||||||
gen_migrate() {
|
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.
|
# Generate a SQLite database with the schema as defined by the existing alembic model.
|
||||||
GENMIGRATE=$1 PYTHONPATH=. alembic upgrade head
|
GENMIGRATE=$1 PYTHONPATH=. alembic upgrade head
|
||||||
|
|
||||||
|
# Generate the migration to the current model.
|
||||||
|
GENMIGRATE=$1 PYTHONPATH=. alembic revision --autogenerate -m "$2"
|
||||||
}
|
}
|
||||||
|
|
||||||
test_migrate() {
|
test_migrate() {
|
||||||
|
@ -59,7 +59,7 @@ if [ ! -z "$@" ]
|
||||||
then
|
then
|
||||||
set +e
|
set +e
|
||||||
echo '> Generating Migration'
|
echo '> Generating Migration'
|
||||||
gen_migrate "mysql"
|
gen_migrate "mysql" "$@"
|
||||||
set -e
|
set -e
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Reference in a new issue