updated components and page navigator
This commit is contained in:
@@ -63,7 +63,7 @@ version_path_separator = os
|
||||
# are written from script.py.mako
|
||||
# output_encoding = utf-8
|
||||
|
||||
sqlalchemy.url = postgresql+psycopg2://berkay_wag_user:berkay_wag_user_password@postgres-service:5432/wag_database
|
||||
sqlalchemy.url = postgresql+psycopg2://postgres:password@10.10.2.14:5432/postgres
|
||||
|
||||
|
||||
[post_write_hooks]
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
from Controllers.Postgres.database import get_db
|
||||
|
||||
from init_app_defaults import create_application_defaults
|
||||
@@ -8,7 +9,7 @@ from init_services import create_modules_and_services_and_actions
|
||||
from init_address import create_one_address
|
||||
from init_occ_defaults import create_occupant_defaults
|
||||
|
||||
set_alembic = False
|
||||
set_alembic = bool(os.getenv("set_alembic", 0))
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
|
||||
Reference in New Issue
Block a user