from sqlalchemy import Column, Integer, VARCHAR
from sqlalchemy.orm import relationship

from app.domain.models.base import BaseModel
from app.settings import settings


class Set(BaseModel):
    __tablename__ = 'sets'
    __table_args__ = {"schema": settings.SCHEMA}

    title = Column(VARCHAR(150), nullable=False, unique=True)

    contents = relationship('SetContent', back_populates='set')
