moving alembic script directory
This commit is contained in:
		| @@ -41,7 +41,7 @@ before_script: | ||||
|  | ||||
| script: | ||||
|   - psql -c 'create database mpwo_test;' -U postgres | ||||
|   - docker-compose -f docker-compose-ci.yml run mpwo-api flask db upgrade | ||||
|   - docker-compose -f docker-compose-ci.yml run mpwo-api flask db upgrade --directory mpwo_api/migrations | ||||
|   - sh test.sh | ||||
|  | ||||
| after_script: | ||||
|   | ||||
							
								
								
									
										6
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								Makefile
									
									
									
									
									
								
							| @@ -8,7 +8,7 @@ make-p: | ||||
|  | ||||
| init-db: | ||||
| 	$(FLASK) drop_db | ||||
| 	$(FLASK) db upgrade | ||||
| 	$(FLASK) db upgrade --directory $(MIGRATIONS) | ||||
| 	$(FLASK) init_data | ||||
|  | ||||
| install: install-client install-python | ||||
| @@ -23,7 +23,7 @@ install-python: | ||||
| lint-all: lint-python lint-react | ||||
|  | ||||
| lint-python: | ||||
| 	$(PYTEST) --flake8 --isort -m "flake8 or isort" mpwo_api | ||||
| 	$(PYTEST) --flake8 --isort -m "flake8 or isort" mpwo_api --ignore=mpwo_api/migrations | ||||
|  | ||||
| lint-react: | ||||
| 	$(NPM) lint | ||||
| @@ -47,4 +47,4 @@ test-python: | ||||
| 	$(FLASK) test_local | ||||
|  | ||||
| upgrade-db: | ||||
| 	$(FLASK) db upgrade | ||||
| 	$(FLASK) db upgrade --directory $(MIGRATIONS) | ||||
|   | ||||
| @@ -8,6 +8,7 @@ export TEST_URL = http://$(HOST):$(CLIENT_PORT) | ||||
| export REQUIREMENTS = $(PWD)/mpwo_api/requirements.txt | ||||
| export DATABASE_URL = postgres://mpwo:mpwo@$(HOST):5432/mpwo | ||||
| export DATABASE_TEST_URL = postgres://mpwo:mpwo@$(HOST):5432/mpwo_test | ||||
| export MIGRATIONS = $(PWD)/mpwo_api/migrations | ||||
|  | ||||
| # Python env | ||||
| PYTHON_VERSION ?= python | ||||
|   | ||||
| @@ -14,7 +14,6 @@ RUN pip install -r mpwo_api/requirements.txt | ||||
|  | ||||
| # add app | ||||
| COPY . /usr/src/app | ||||
| COPY ../migrations /usr/src/app | ||||
|  | ||||
| # run server | ||||
| CMD flask run --with-threads -h 0.0.0.0 | ||||
|   | ||||
| @@ -81,6 +81,7 @@ def run_migrations_online(): | ||||
|     finally: | ||||
|         connection.close() | ||||
| 
 | ||||
| 
 | ||||
| if context.is_offline_mode(): | ||||
|     run_migrations_offline() | ||||
| else: | ||||
		Reference in New Issue
	
	Block a user