from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy.sql import func
from app.db.database import Base

class MTGJSONCard(Base):
    __tablename__ = "mtgjson_cards"

    id = Column(Integer, primary_key=True, index=True)
    card_id = Column(String, unique=True, index=True)
    name = Column(String)
    set_code = Column(String)
    uuid = Column(String)
    
    # Identifiers
    abu_id = Column(String, nullable=True)
    card_kingdom_etched_id = Column(String, nullable=True)
    card_kingdom_foil_id = Column(String, nullable=True)
    card_kingdom_id = Column(String, nullable=True)
    cardsphere_id = Column(String, nullable=True)
    cardsphere_foil_id = Column(String, nullable=True)
    cardtrader_id = Column(String, nullable=True)
    csi_id = Column(String, nullable=True)
    mcm_id = Column(String, nullable=True)
    mcm_meta_id = Column(String, nullable=True)
    miniaturemarket_id = Column(String, nullable=True)
    mtg_arena_id = Column(String, nullable=True)
    mtgjson_foil_version_id = Column(String, nullable=True)
    mtgjson_non_foil_version_id = Column(String, nullable=True)
    mtgjson_v4_id = Column(String, nullable=True)
    mtgo_foil_id = Column(String, nullable=True)
    mtgo_id = Column(String, nullable=True)
    multiverse_id = Column(String, nullable=True)
    scg_id = Column(String, nullable=True)
    scryfall_id = Column(String, nullable=True)
    scryfall_card_back_id = Column(String, nullable=True)
    scryfall_oracle_id = Column(String, nullable=True)
    scryfall_illustration_id = Column(String, nullable=True)
    tcgplayer_product_id = Column(String, nullable=True)
    tcgplayer_etched_product_id = Column(String, nullable=True)
    tnt_id = Column(String, nullable=True)
    
    created_at = Column(DateTime(timezone=True), server_default=func.current_timestamp())
    updated_at = Column(DateTime(timezone=True), onupdate=func.current_timestamp()) 