Files
warehouse13/app/models/artifact.py
pratik fbb1dfa67b Integrate dark theme styling from main branch with Angular Material
- Apply dark blue color scheme (#0f172a, #1e293b, #334155) throughout UI
- Update header with blue gradient and Obsidian branding
- Add missing toolbar buttons: Auto-refresh, Seed Data, Search filter
- Implement action buttons (Download, Delete) in artifacts table
- Add client-side search/filtering functionality
- Update app to support sim_source_id field in database
- Move quickstart scripts to repository root for easier access
- Apply dark theme to tables, tabs, and all Material components

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 11:42:34 -05:00

40 lines
1.5 KiB
Python

from sqlalchemy import Column, String, Integer, DateTime, JSON, BigInteger, Text
from sqlalchemy.ext.declarative import declarative_base
from datetime import datetime
Base = declarative_base()
class Artifact(Base):
__tablename__ = "artifacts"
id = Column(Integer, primary_key=True, index=True)
filename = Column(String(500), nullable=False, index=True)
file_type = Column(String(50), nullable=False, index=True) # csv, json, binary, pcap
file_size = Column(BigInteger, nullable=False)
storage_path = Column(String(1000), nullable=False)
content_type = Column(String(100))
# Test metadata
test_name = Column(String(500), index=True)
test_suite = Column(String(500), index=True)
test_config = Column(JSON)
test_result = Column(String(50), index=True) # pass, fail, skip, error
sim_source_id = Column(String(500), index=True) # SIM source identifier for grouping
# Additional metadata
custom_metadata = Column(JSON)
description = Column(Text)
tags = Column(JSON) # Array of tags for categorization
# Timestamps
created_at = Column(DateTime, default=datetime.utcnow, index=True)
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
# Versioning
version = Column(String(50))
parent_id = Column(Integer, index=True) # For file versioning
def __repr__(self):
return f"<Artifact(id={self.id}, filename='{self.filename}', test_name='{self.test_name}')>"