File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919# target_metadata = None
2020
2121from app .models import SQLModel # noqa
22+ from app .core .config import settings # noqa
2223
2324target_metadata = SQLModel .metadata
2425
2930
3031
3132def get_url ():
32- user = os .getenv ("POSTGRES_USER" , "postgres" )
33- password = os .getenv ("POSTGRES_PASSWORD" , "" )
34- server = os .getenv ("POSTGRES_SERVER" , "db" )
35- port = os .getenv ("POSTGRES_PORT" , "5432" )
36- db = os .getenv ("POSTGRES_DB" , "app" )
37- return f"postgresql+psycopg://{ user } :{ password } @{ server } :{ port } /{ db } "
33+ return str (settings .SQLALCHEMY_DATABASE_URI )
3834
3935
4036def run_migrations_offline ():
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ def server_host(self) -> str:
5151 POSTGRES_SERVER : str
5252 POSTGRES_PORT : int = 5432
5353 POSTGRES_USER : str
54- POSTGRES_PASSWORD : str
54+ POSTGRES_PASSWORD : str = ""
5555 POSTGRES_DB : str = ""
5656
5757 @computed_field # type: ignore[misc]
You can’t perform that action at this time.
0 commit comments