21 lines
739 B
Python
21 lines
739 B
Python
from sqlalchemy import Column, String, Boolean, JSON
|
|
from app.db.database import Base
|
|
import uuid
|
|
|
|
class Game(Base):
|
|
__tablename__ = "games"
|
|
|
|
id = Column(String, primary_key=True, default=lambda: f"gv-{uuid.uuid4().hex[:8]}")
|
|
title = Column(String, index=True, nullable=False)
|
|
slug = Column(String, unique=True, index=True, nullable=False)
|
|
description = Column(String)
|
|
developer = Column(String)
|
|
active = Column(Boolean, default=True)
|
|
|
|
# Usando JSON para simplificar arrays no MVP conforme os requisitos.
|
|
# Em um banco relacional robusto, genres e platforms seriam tabelas M:N.
|
|
genres = Column(JSON)
|
|
platforms = Column(JSON)
|
|
images = Column(JSON)
|
|
system_requirements = Column(JSON)
|