ci(migrations): enforce graph + reversible cycle checks; fix FK downgrade naming
This commit is contained in:
@@ -22,7 +22,7 @@ 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.create_foreign_key('fk_agents_gateway_id_gateways', 'agents', 'gateways', ['gateway_id'], ['id'])
|
||||
op.drop_column('gateways', 'main_session_key')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
@@ -30,7 +30,7 @@ def upgrade() -> None:
|
||||
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_constraint('fk_agents_gateway_id_gateways', '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