mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
Создание чата
This commit is contained in:
19
backend/app/models/user.py
Normal file
19
backend/app/models/user.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from sqlalchemy import Boolean, Column, Integer, String
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from app.database import Base
|
||||
|
||||
class User(Base):
|
||||
__tablename__ = "users"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
email = Column(String, unique=True, index=True)
|
||||
full_name = Column(String)
|
||||
hashed_password = Column(String)
|
||||
is_active = Column(Boolean, default=True)
|
||||
is_admin = Column(Boolean, default=False)
|
||||
|
||||
# Отношения для чата
|
||||
employee_chats = relationship("Chat", foreign_keys="[Chat.employee_id]", back_populates="employee")
|
||||
admin_chats = relationship("Chat", foreign_keys="[Chat.admin_id]", back_populates="admin")
|
||||
sent_messages = relationship("Message", back_populates="sender")
|
||||
Reference in New Issue
Block a user