refactor: add gateway_id to agents and remove main_session_key from gateways
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
"""sync agent gateway linkage schema
|
||||
|
||||
Revision ID: b308f2876359
|
||||
Revises: a1e6b0d62f0c
|
||||
Create Date: 2026-02-10 15:49:54.395003
|
||||
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'b308f2876359'
|
||||
down_revision = 'a1e6b0d62f0c'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('agents', sa.Column('gateway_id', sa.Uuid(), nullable=False))
|
||||
op.create_index(op.f('ix_agents_gateway_id'), 'agents', ['gateway_id'], unique=False)
|
||||
op.create_foreign_key(None, 'agents', 'gateways', ['gateway_id'], ['id'])
|
||||
op.drop_column('gateways', 'main_session_key')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('gateways', sa.Column('main_session_key', sa.VARCHAR(), autoincrement=False, nullable=False))
|
||||
op.drop_constraint(None, 'agents', type_='foreignkey')
|
||||
op.drop_index(op.f('ix_agents_gateway_id'), table_name='agents')
|
||||
op.drop_column('agents', 'gateway_id')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user