14 lines
603 B
Python
14 lines
603 B
Python
from sqlalchemy import Column, String, Boolean, DateTime
|
|
from sqlalchemy.sql import func
|
|
from app.core.database.db_session import Base
|
|
|
|
class Department(Base):
|
|
__tablename__ = "departments"
|
|
|
|
department_id = Column(String(26), primary_key=True)
|
|
name = Column(String(100), unique=True, nullable=False)
|
|
description = Column(String(255), nullable=True)
|
|
is_active = Column(Boolean, default=True)
|
|
created_at = Column(DateTime, server_default=func.now())
|
|
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
|
|
deleted_at = Column(DateTime, nullable=True)
|