|
|
"""
|
|
|
Project Model - Workspaces for organizing investigations
|
|
|
"""
|
|
|
from sqlalchemy import Column, String, Text, DateTime
|
|
|
from datetime import datetime
|
|
|
import uuid
|
|
|
|
|
|
from app.core.database import Base
|
|
|
|
|
|
|
|
|
def generate_uuid():
|
|
|
return str(uuid.uuid4())
|
|
|
|
|
|
|
|
|
class Project(Base):
|
|
|
"""
|
|
|
Projeto/Workspace - agrupa entidades e relacionamentos por investigação
|
|
|
"""
|
|
|
__tablename__ = "projects"
|
|
|
|
|
|
id = Column(String(36), primary_key=True, default=generate_uuid)
|
|
|
name = Column(String(255), nullable=False)
|
|
|
description = Column(Text, nullable=True)
|
|
|
color = Column(String(7), default="#00d4ff")
|
|
|
icon = Column(String(50), default="folder")
|
|
|
|
|
|
|
|
|
created_at = Column(DateTime, default=datetime.utcnow)
|
|
|
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
|
|
|
|