first commit
This commit is contained in:
23
app/models/sentiment.py
Normal file
23
app/models/sentiment.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import DateTime, ForeignKey, Integer, String
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from app.database import Base
|
||||
|
||||
|
||||
class SentimentScore(Base):
|
||||
__tablename__ = "sentiment_scores"
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
ticker_id: Mapped[int] = mapped_column(
|
||||
ForeignKey("tickers.id", ondelete="CASCADE"), nullable=False
|
||||
)
|
||||
classification: Mapped[str] = mapped_column(String(20), nullable=False)
|
||||
confidence: Mapped[int] = mapped_column(Integer, nullable=False)
|
||||
source: Mapped[str] = mapped_column(String(100), nullable=False)
|
||||
timestamp: Mapped[datetime] = mapped_column(
|
||||
DateTime(timezone=True), nullable=False
|
||||
)
|
||||
|
||||
ticker = relationship("Ticker", back_populates="sentiment_scores")
|
||||
Reference in New Issue
Block a user