fix: commit migration role assumption
All checks were successful
Build and Publish Container Image / build-and-push (push) Successful in 41s
All checks were successful
Build and Publish Container Image / build-and-push (push) Successful in 41s
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a02b22-9638-76d2-bbff-b7ea1770b118
This commit is contained in:
parent
9751927d38
commit
b1fd3ec131
4 changed files with 32 additions and 3 deletions
|
|
@ -6,7 +6,7 @@ from alembic import context
|
|||
from sqlalchemy import engine_from_config, pool
|
||||
|
||||
from sbom_nexus.config import database_target, migration_role
|
||||
from sbom_nexus.database import database_url, metadata
|
||||
from sbom_nexus.database import assume_migration_role, database_url, metadata
|
||||
|
||||
config = context.config
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ def run_migrations_online() -> None:
|
|||
if role and connection.dialect.name != "postgresql":
|
||||
raise RuntimeError("SBOM_NEXUS_MIGRATION_ROLE requires PostgreSQL")
|
||||
if role:
|
||||
connection.exec_driver_sql(f'SET ROLE "{role}"')
|
||||
assume_migration_role(connection, role)
|
||||
context.configure(
|
||||
connection=connection,
|
||||
target_metadata=target_metadata,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue