diff --git a/backend/alembic/versions/fa53e635f410_drop_unique_constraint_on_players_name.py b/backend/alembic/versions/fa53e635f410_drop_unique_constraint_on_players_name.py new file mode 100644 index 00000000..2f3618a2 --- /dev/null +++ b/backend/alembic/versions/fa53e635f410_drop_unique_constraint_on_players_name.py @@ -0,0 +1,30 @@ +"""drop unique constraint on players.name + +Revision ID: fa53e635f410 +Revises: 8bae62f80db7 +Create Date: 2023-11-25 11:16:18.683799 + +""" + + +from alembic import op + +# revision identifiers, used by Alembic. +revision: str | None = 'fa53e635f410' +down_revision: str | None = '8bae62f80db7' +branch_labels: str | None = None +depends_on: str | None = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_index('ix_players_name', table_name='players') + op.create_index(op.f('ix_players_name'), 'players', ['name'], unique=False) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_index(op.f('ix_players_name'), table_name='players') + op.create_index('ix_players_name', 'players', ['name'], unique=False) + # ### end Alembic commands ### diff --git a/backend/bracket/schema.py b/backend/bracket/schema.py index 0424478d..842c7e7f 100644 --- a/backend/bracket/schema.py +++ b/backend/bracket/schema.py @@ -134,7 +134,7 @@ players = Table( 'players', metadata, Column('id', BigInteger, primary_key=True, index=True), - Column('name', String, nullable=False, index=True, unique=True), + Column('name', String, nullable=False, index=True), Column('created', DateTimeTZ, nullable=False), Column('tournament_id', BigInteger, ForeignKey('tournaments.id'), index=True, nullable=False), Column('elo_score', Float, nullable=False),