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() { | ||||
|   # 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 | ||||
| 
 | ||||
|  |  | |||
		Reference in a new issue