Table and schema names are now no longer pulled from .env

This commit is contained in:
2025-09-09 15:22:20 +03:00
parent c3788356c7
commit 355aff8cf3
2 changed files with 5 additions and 4 deletions

View File

@ -12,12 +12,15 @@ if config.enable_api_docs:
else: else:
docs_url = None docs_url = None
schema_name = 'harticle'
table_name = 'articles'
@asynccontextmanager @asynccontextmanager
async def lifespan(app: FastAPI): async def lifespan(app: FastAPI):
DBwork.set_connection() DBwork.set_connection()
DBwork.schema_creator(config.schema_name, db.connection) DBwork.schema_creator(schema_name, db.connection)
DBwork.table_creator(config.schema_name, config.table_name, db.connection) DBwork.table_creator(schema_name, table_name, db.connection)
yield yield
DBwork.close_connection(db.connection) DBwork.close_connection(db.connection)

View File

@ -6,8 +6,6 @@ postgres_user = config('POSTGRES_USER')
postgres_password = config('POSTGRES_PASSWORD') postgres_password = config('POSTGRES_PASSWORD')
host_name = config('HOST_NAME') host_name = config('HOST_NAME')
port = config('PG_PORT') port = config('PG_PORT')
schema_name = config('SCHEMA_NAME')
table_name = config('TABLE_NAME')
enable_api_docs = config('ENABLE_API_DOCS', cast=bool) enable_api_docs = config('ENABLE_API_DOCS', cast=bool)