You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
918 B
Python

"""
Overlay raw event models — headline events from the Yahoo RSS adapter.
"""
from sqlalchemy import Column, String, Index, JSON, Text
from sqlalchemy.dialects.postgresql import UUID, TIMESTAMP
from datetime import datetime, timezone
import uuid
from app.core.database import Base
class OverlayHeadlineEvent(Base):
__tablename__ = "overlay_headline_events"
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
article_guid = Column(String(500), unique=True, nullable=False)
title = Column(Text, nullable=False)
publisher = Column(String(255), nullable=True)
published_at = Column(TIMESTAMP(timezone=True), nullable=False)
matched_symbols = Column(JSON, default=list)
created_at = Column(
TIMESTAMP(timezone=True), default=lambda: datetime.now(timezone.utc)
)
__table_args__ = (
Index("idx_headline_published_at", "published_at"),
)