17 lines
429 B
Python
17 lines
429 B
Python
from sqlalchemy import Column, String
|
|
from sqlalchemy.dialects.mysql import INTEGER
|
|
from sqlalchemy.orm import relationship
|
|
from .base_model import Base
|
|
|
|
|
|
class UserRole(Base):
|
|
__tablename__ = 'user_role'
|
|
|
|
id = Column(INTEGER(unsigned=True), primary_key=True, autoincrement=True)
|
|
name = Column(String(45), nullable=False, unique=True)
|
|
|
|
users = relationship("User", back_populates="role")
|
|
|
|
|
|
__all__ = ["UserRole"]
|