mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
Fix tests
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
"""Employee model"""
|
||||
from sqlalchemy import Column, Integer, String, DateTime
|
||||
from sqlalchemy.sql import func
|
||||
from sqlalchemy import Column, Integer, String, Boolean, DateTime
|
||||
from sqlalchemy.orm import relationship
|
||||
from .base import Base
|
||||
from datetime import datetime
|
||||
|
||||
from ..database import Base
|
||||
|
||||
class Employee(Base):
|
||||
"""Employee model"""
|
||||
__tablename__ = "employees"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
@@ -13,7 +15,8 @@ class Employee(Base):
|
||||
department = Column(String, nullable=False)
|
||||
office = Column(String, nullable=False)
|
||||
hashed_password = Column(String, nullable=False)
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
is_active = Column(Boolean, default=True)
|
||||
is_admin = Column(Boolean, default=False)
|
||||
created_at = Column(DateTime, nullable=False, default=datetime.utcnow)
|
||||
|
||||
# Определяем отношение к Request
|
||||
requests = relationship("Request", back_populates="employee", cascade="all, delete-orphan")
|
||||
requests = relationship("Request", back_populates="employee")
|
||||
Reference in New Issue
Block a user