-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
22 lines (19 loc) · 950 Bytes
/
Copy pathmodels.py
File metadata and controls
22 lines (19 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from sqlalchemy import Column, Integer, String, DateTime, Text, func
from database import Base
class Subscriber(Base):
__tablename__ = "subscribers"
id = Column(Integer, primary_key=True, index=True)
email = Column(String, unique=True, index=True, nullable=False)
created_at = Column(DateTime(timezone=True), server_default=func.now(), nullable=False)
class NewsletterTopic(Base):
__tablename__ = "newsletter_topics"
id = Column(Integer, primary_key=True, index=True)
week = Column(String, unique=True, index=True)
topics_json = Column(Text)
created_at = Column(DateTime(timezone=True), server_default=func.now(), nullable=False)
class Newsletter(Base):
__tablename__ = "newsletters"
id = Column(Integer, primary_key=True, index=True)
week = Column(String, unique=True, index=True)
html = Column(Text)
created_at = Column(DateTime(timezone=True), server_default=func.now(), nullable=False)