Fix username field migration script to correct index syntax
This commit is contained in:
parent
da59077885
commit
2e92746b97
@ -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')
|
Loading…
x
Reference in New Issue
Block a user