-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
26 lines (20 loc) · 733 Bytes
/
Copy pathmodels.py
File metadata and controls
26 lines (20 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from sqlalchemy import Column, Integer, String, Text, DateTime, Float
from datetime import datetime
from database import Base
class RawData(Base):
__tablename__ = "raw_data"
id = Column(Integer, primary_key=True, index=True)
source = Column(String)
title = Column(String)
content = Column(Text)
tags = Column(String)
created_at = Column(DateTime, default=datetime.utcnow)
class Trend(Base):
__tablename__ = "trends"
id = Column(Integer, primary_key=True, index=True)
topic = Column(String, index=True)
mentions = Column(Integer)
growth_rate = Column(Float)
source_count = Column(Integer)
stage = Column(String)
last_updated = Column(DateTime, default=datetime.utcnow)