42 lines
1.5 KiB
Python
42 lines
1.5 KiB
Python
"""init
|
|
|
|
Revision ID: 00ce87deada6
|
|
Revises:
|
|
Create Date: 2025-08-08 11:20:06.424809+00:00
|
|
"""
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '00ce87deada6'
|
|
down_revision = None
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('match_pairs',
|
|
sa.Column('id', sa.UUID(), nullable=False),
|
|
sa.Column('user_id_a', sa.UUID(), nullable=False),
|
|
sa.Column('user_id_b', sa.UUID(), nullable=False),
|
|
sa.Column('status', sa.String(length=16), nullable=False),
|
|
sa.Column('score', sa.Float(), nullable=True),
|
|
sa.Column('notes', sa.String(length=1000), nullable=True),
|
|
sa.Column('created_by', sa.UUID(), nullable=True),
|
|
sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=False),
|
|
sa.Column('updated_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=False),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.create_index(op.f('ix_match_pairs_user_id_a'), 'match_pairs', ['user_id_a'], unique=False)
|
|
op.create_index(op.f('ix_match_pairs_user_id_b'), 'match_pairs', ['user_id_b'], unique=False)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_index(op.f('ix_match_pairs_user_id_b'), table_name='match_pairs')
|
|
op.drop_index(op.f('ix_match_pairs_user_id_a'), table_name='match_pairs')
|
|
op.drop_table('match_pairs')
|
|
# ### end Alembic commands ###
|