-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Hello,
What is the path for creating alembic migrations? If I do it on my host machine. First, I had to add the following lines to env.py, so alembic could find the model files:
import sys
sys.path = ['', '..'] + sys.path[1:]
Then, if i try to generate migrations on my host, i get issues that all the POSTGRES variables are missing:
alembic revision --autogenerate -m "test migration"
...
pydantic.error_wrappers.ValidationError: 8 validation errors for Settings
SERVER_NAME
field required (type=value_error.missing)
PROJECT_NAME
field required (type=value_error.missing)
POSTGRES_SCHEME
field required (type=value_error.missing)
POSTGRES_SERVER
field required (type=value_error.missing)
POSTGRES_USER
field required (type=value_error.missing)
POSTGRES_PASSWORD
field required (type=value_error.missing)
POSTGRES_DB
field required (type=value_error.missing)
SQLALCHEMY_DATABASE_URI
unsupported operand type(s) for +: 'NoneType' and 'str' (type=type_error)
If I exec in to my app container and run the migration there, I get connection issues:
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
Metadata
Metadata
Assignees
Labels
No labels