first commit
Some checks failed
Deploy / lint (push) Failing after 7s
Deploy / test (push) Has been skipped
Deploy / deploy (push) Has been skipped

This commit is contained in:
Dennis Thiessen
2026-02-20 17:31:01 +01:00
commit 61ab24490d
160 changed files with 17034 additions and 0 deletions

27
app/models/ticker.py Normal file
View File

@@ -0,0 +1,27 @@
from datetime import datetime
from sqlalchemy import String, DateTime
from sqlalchemy.orm import Mapped, mapped_column, relationship
from app.database import Base
class Ticker(Base):
__tablename__ = "tickers"
id: Mapped[int] = mapped_column(primary_key=True)
symbol: Mapped[str] = mapped_column(String(10), unique=True, nullable=False)
created_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True), default=datetime.utcnow, nullable=False
)
# Relationships (cascade deletes)
ohlcv_records = relationship("OHLCVRecord", back_populates="ticker", cascade="all, delete-orphan")
sentiment_scores = relationship("SentimentScore", back_populates="ticker", cascade="all, delete-orphan")
fundamental_data = relationship("FundamentalData", back_populates="ticker", cascade="all, delete-orphan")
sr_levels = relationship("SRLevel", back_populates="ticker", cascade="all, delete-orphan")
dimension_scores = relationship("DimensionScore", back_populates="ticker", cascade="all, delete-orphan")
composite_scores = relationship("CompositeScore", back_populates="ticker", cascade="all, delete-orphan")
trade_setups = relationship("TradeSetup", back_populates="ticker", cascade="all, delete-orphan")
watchlist_entries = relationship("WatchlistEntry", back_populates="ticker", cascade="all, delete-orphan")
ingestion_progress = relationship("IngestionProgress", back_populates="ticker", cascade="all, delete-orphan", uselist=False)