20 lines
1.1 KiB
Python
20 lines
1.1 KiB
Python
from sqlalchemy import Column, Integer, String, DateTime, Text, JSON
|
|
from datetime import datetime
|
|
|
|
from sqlalchemy.orm import declarative_base
|
|
Base = declarative_base()
|
|
|
|
class JiraAnalysis(Base):
|
|
__tablename__ = "jira_analyses"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
issue_key = Column(String, index=True, nullable=False)
|
|
project_key = Column(String, index=True, nullable=False)
|
|
status = Column(String, default="pending", nullable=False) # pending, processing, completed, failed
|
|
issue_summary = Column(Text, nullable=False)
|
|
request_payload = Column(JSON, nullable=False) # Store the original Jira webhook payload
|
|
analysis_result = Column(JSON, nullable=True) # Store the structured LLM output
|
|
created_at = Column(DateTime, default=datetime.utcnow, nullable=False)
|
|
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, nullable=False)
|
|
error_message = Column(Text, nullable=True) # To store any error messages
|
|
raw_response = Column(JSON, nullable=True) # Store raw LLM response before validation |