From 2e92746b97c71cedecd9c1b5d8c8fbd9794aeb4b Mon Sep 17 00:00:00 2001 From: Automated Action Date: Mon, 26 May 2025 13:35:24 +0000 Subject: [PATCH] Fix username field migration script to correct index syntax --- migrations/versions/2a3b4c5d6e7f_add_username_field.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migrations/versions/2a3b4c5d6e7f_add_username_field.py b/migrations/versions/2a3b4c5d6e7f_add_username_field.py index bc46334..0bf25ab 100644 --- a/migrations/versions/2a3b4c5d6e7f_add_username_field.py +++ b/migrations/versions/2a3b4c5d6e7f_add_username_field.py @@ -20,7 +20,7 @@ def upgrade() -> None: # Add username column to user table with op.batch_alter_table('user') as batch_op: batch_op.add_column(sa.Column('username', sa.String(), nullable=True)) - batch_op.create_index(op.f('ix_user_username'), 'username', unique=True) + batch_op.create_index('ix_user_username', ['username'], unique=True) # For existing users, initialize username from email # This is just SQL template code - in a real migration with existing data, @@ -38,5 +38,5 @@ def upgrade() -> None: def downgrade() -> None: # Remove username column from user table with op.batch_alter_table('user') as batch_op: - batch_op.drop_index(op.f('ix_user_username')) + batch_op.drop_index('ix_user_username') batch_op.drop_column('username') \ No newline at end of file