Skip to content

Commit b7bbc17

Browse files
committed
feat: use VERSION_TABLE constant for alembic version table name in migrations
1 parent a041116 commit b7bbc17

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/a2a/migrations/env.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
# add your model's MetaData object here for 'autogenerate' support
4343
target_metadata = Base.metadata
4444

45+
# Version table name to avoid conflicts with existing alembic_version tables in the database.
46+
# This ensures that the migration history for A2A is tracked separately.
47+
VERSION_TABLE = 'a2a_alembic_version'
48+
4549

4650
def run_migrations_offline() -> None:
4751
"""Run migrations in 'offline' mode.
@@ -61,6 +65,7 @@ def run_migrations_offline() -> None:
6165
target_metadata=target_metadata,
6266
literal_binds=True,
6367
dialect_opts={'paramstyle': 'named'},
68+
version_table=VERSION_TABLE,
6469
)
6570

6671
with context.begin_transaction():
@@ -80,7 +85,7 @@ def do_run_migrations(connection: Connection) -> None:
8085
context.configure(
8186
connection=connection,
8287
target_metadata=target_metadata,
83-
version_table='a2a_alembic_version',
88+
version_table=VERSION_TABLE,
8489
)
8590

8691
with context.begin_transaction():

0 commit comments

Comments
 (0)