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