Automated Action 27c9268a6a Implement HR platform backend with FastAPI and SQLite
- Set up project structure with FastAPI framework
- Create database models for users, employees, departments, and job titles
- Implement JWT authentication and authorization system
- Set up SQLite database with SQLAlchemy ORM
- Add Alembic migrations for database versioning
- Create CRUD API endpoints for employee management
- Implement category-based search functionality
- Add OpenAPI documentation and health check endpoint
- Update README with comprehensive setup and usage instructions
2025-06-03 01:18:41 +00:00

13 lines
513 B
Python

from sqlalchemy import Column, String, DateTime, Text
from sqlalchemy.sql import func
from uuid import uuid4
from app.db.base_class import Base
class Department(Base):
id = Column(String, primary_key=True, index=True, default=lambda: str(uuid4()))
name = Column(String, index=True, nullable=False, unique=True)
description = Column(Text, nullable=True)
created_at = Column(DateTime(timezone=True), server_default=func.now())
updated_at = Column(DateTime(timezone=True), onupdate=func.now())