"""tcg prices again 2

Revision ID: 493b2cb724d0
Revises: 2fcce9c8883a
Create Date: 2025-04-17 23:05:11.919652

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision: str = '493b2cb724d0'
down_revision: Union[str, None] = '2fcce9c8883a'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_tcgplayer_prices_date', table_name='tcgplayer_prices')
    op.drop_index('ix_tcgplayer_prices_id', table_name='tcgplayer_prices')
    op.drop_index('ix_tcgplayer_prices_product_id', table_name='tcgplayer_prices')
    op.drop_table('tcgplayer_prices')
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('tcgplayer_prices',
    sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('product_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('date', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
    sa.Column('low_price', sa.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True),
    sa.Column('mid_price', sa.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True),
    sa.Column('high_price', sa.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True),
    sa.Column('market_price', sa.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True),
    sa.Column('direct_low_price', sa.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True),
    sa.Column('sub_type_name', sa.VARCHAR(), autoincrement=False, nullable=True),
    sa.Column('created_at', postgresql.TIMESTAMP(timezone=True), server_default=sa.text('now()'), autoincrement=False, nullable=True),
    sa.Column('updated_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='tcgplayer_prices_pkey')
    )
    op.create_index('ix_tcgplayer_prices_product_id', 'tcgplayer_prices', ['product_id'], unique=False)
    op.create_index('ix_tcgplayer_prices_id', 'tcgplayer_prices', ['id'], unique=False)
    op.create_index('ix_tcgplayer_prices_date', 'tcgplayer_prices', ['date'], unique=False)
    # ### end Alembic commands ###
