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

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


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

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

    users = relationship('User', back_populates='role')
