"""create glorys table Revision ID: a2b3c4d5e6f7 Revises: Create Date: 2024-01-01 12:00:00.000000 """ from alembic import op import sqlalchemy as sa from sqlalchemy.sql import func import uuid # revision identifiers revision = 'a2b3c4d5e6f7' down_revision = None branch_labels = None depends_on = None def upgrade(): op.create_table( 'glorys', sa.Column('id', sa.String(), primary_key=True, default=lambda: str(uuid.uuid4())), sa.Column('team_name', sa.String(), nullable=False, unique=True), sa.Column('league', sa.String(), nullable=False), sa.Column('points', sa.Integer(), default=0), sa.Column('matches_played', sa.Integer(), default=0), sa.Column('wins', sa.Integer(), default=0), sa.Column('draws', sa.Integer(), default=0), sa.Column('losses', sa.Integer(), default=0), sa.Column('goals_for', sa.Integer(), default=0), sa.Column('goals_against', sa.Integer(), default=0), sa.Column('goal_difference', sa.Integer(), default=0), sa.Column('position', sa.Integer()), sa.Column('is_active', sa.Boolean(), default=True), sa.Column('season', sa.String(), nullable=False), sa.Column('created_at', sa.DateTime(), server_default=sa.func.now()), sa.Column('updated_at', sa.DateTime(), server_default=sa.func.now(), onupdate=sa.func.now()), sa.PrimaryKeyConstraint('id') ) op.create_index('ix_glorys_team_name', 'glorys', ['team_name'], unique=True) def downgrade(): op.drop_index('ix_glorys_team_name', 'glorys') op.drop_table('glorys')