35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
"""Add availability index
|
|
|
|
Revision ID: 47f0722b02b0
|
|
Revises: 7361c978e53d
|
|
Create Date: 2024-11-21 13:10:45.098947
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '47f0722b02b0'
|
|
down_revision = '7361c978e53d'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('players_teams_availability', schema=None) as batch_op:
|
|
batch_op.create_index(batch_op.f('ix_players_teams_availability_end_time'), ['end_time'], unique=False)
|
|
batch_op.create_index(batch_op.f('ix_players_teams_availability_start_time'), ['start_time'], unique=False)
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('players_teams_availability', schema=None) as batch_op:
|
|
batch_op.drop_index(batch_op.f('ix_players_teams_availability_start_time'))
|
|
batch_op.drop_index(batch_op.f('ix_players_teams_availability_end_time'))
|
|
|
|
# ### end Alembic commands ###
|