Automated Action e7225e6443 Add Task Management System with FastAPI and SQLite
Features:
- User authentication with JWT tokens
- Task and project CRUD operations
- Task filtering and organization

generated with BackendIM... (backend.im)
2025-05-12 10:14:26 +00:00

22 lines
723 B
Python

from sqlalchemy import Column, Integer, String, ForeignKey, DateTime, Text
from sqlalchemy.orm import relationship
from sqlalchemy.sql import func
from app.database import Base
class Project(Base):
__tablename__ = "projects"
id = Column(Integer, primary_key=True, index=True)
name = Column(String, index=True)
description = Column(Text, nullable=True)
created_at = Column(DateTime, default=func.now())
updated_at = Column(DateTime, default=func.now(), onupdate=func.now())
# Foreign keys
owner_id = Column(Integer, ForeignKey("users.id"))
# Relationships
owner = relationship("User", back_populates="projects")
tasks = relationship("Task", back_populates="project")