18 lines
619 B
Python
18 lines
619 B
Python
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"),
|
|
)
|