updated components and page navigator
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
from logging.config import fileConfig
|
||||
import os
|
||||
|
||||
from sqlalchemy import engine_from_config
|
||||
from sqlalchemy import pool
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
from alembic import context
|
||||
from Schemas import *
|
||||
@@ -11,6 +13,19 @@ from Controllers.Postgres.database import Base
|
||||
# access to the values within the .ini file in use.
|
||||
config = context.config
|
||||
|
||||
# Override sqlalchemy.url with environment variables if they exist
|
||||
db_host = os.getenv("POSTGRES_HOST", "10.10.2.14")
|
||||
db_port = os.getenv("POSTGRES_PORT", "5432")
|
||||
db_user = os.getenv("POSTGRES_USER", "postgres")
|
||||
db_password = os.getenv("POSTGRES_PASSWORD", "password")
|
||||
db_name = os.getenv("POSTGRES_DB", "postgres")
|
||||
|
||||
# Build the connection URL from environment variables
|
||||
db_url = f"postgresql+psycopg2://{db_user}:{db_password}@{db_host}:{db_port}/{db_name}"
|
||||
|
||||
# Override the sqlalchemy.url in the alembic.ini file
|
||||
config.set_main_option("sqlalchemy.url", db_url)
|
||||
|
||||
# Interpret the config file for Python logging.
|
||||
# This line sets up loggers basically.
|
||||
if config.config_file_name is not None:
|
||||
|
||||
Reference in New Issue
Block a user