Initial commit
This commit is contained in:
17
backend/app/models/follow.py
Normal file
17
backend/app/models/follow.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from sqlalchemy import Column, Integer, String, DateTime, UniqueConstraint
|
||||
from sqlalchemy.sql import func
|
||||
|
||||
from app.database import Base
|
||||
|
||||
|
||||
class Follow(Base):
|
||||
__tablename__ = "follows"
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
follow_type = Column(String(20), nullable=False) # bill | member | topic
|
||||
follow_value = Column(String, nullable=False) # bill_id | bioguide_id | tag string
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
|
||||
__table_args__ = (
|
||||
UniqueConstraint("follow_type", "follow_value", name="uq_follows_type_value"),
|
||||
)
|
||||
Reference in New Issue
Block a user