Fix alter_column missing existing_type for MySQL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mguschin
2026-03-09 17:26:32 +03:00
parent c8beeaf1b1
commit 3f4bbcbb0d

View File

@@ -41,11 +41,13 @@ def upgrade() -> None:
op.create_index('ix_evotor_connections_evotor_user_id', op.create_index('ix_evotor_connections_evotor_user_id',
'evotor_connections', ['evotor_user_id']) 'evotor_connections', ['evotor_user_id'])
op.alter_column('evotor_connections', 'user_id', nullable=True) op.alter_column('evotor_connections', 'user_id',
existing_type=sa.Integer(), nullable=True)
def downgrade() -> None: def downgrade() -> None:
op.alter_column('evotor_connections', 'user_id', nullable=False) op.alter_column('evotor_connections', 'user_id',
existing_type=sa.Integer(), nullable=False)
op.drop_index('ix_evotor_connections_evotor_user_id', 'evotor_connections') op.drop_index('ix_evotor_connections_evotor_user_id', 'evotor_connections')
op.drop_constraint('uq_evotor_connections_evotor_user_id', 'evotor_connections') op.drop_constraint('uq_evotor_connections_evotor_user_id', 'evotor_connections')
op.drop_column('evotor_connections', 'evotor_user_id') op.drop_column('evotor_connections', 'evotor_user_id')