Self-hosted US Congress monitoring platform with AI policy briefs, bill/member/topic follows, ntfy + RSS + email notifications, alignment scoring, collections, and draft-letter generator. Authored by: Jack Levy
34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
from sqlalchemy import Column, Integer, String, Date, ForeignKey, Index
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.database import Base
|
|
|
|
|
|
class Committee(Base):
|
|
__tablename__ = "committees"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
committee_code = Column(String(20), unique=True, nullable=False)
|
|
name = Column(String(500))
|
|
chamber = Column(String(10))
|
|
committee_type = Column(String(50)) # Standing, Select, Joint, etc.
|
|
|
|
committee_bills = relationship("CommitteeBill", back_populates="committee")
|
|
|
|
|
|
class CommitteeBill(Base):
|
|
__tablename__ = "committee_bills"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
committee_id = Column(Integer, ForeignKey("committees.id", ondelete="CASCADE"), nullable=False)
|
|
bill_id = Column(String, ForeignKey("bills.bill_id", ondelete="CASCADE"), nullable=False)
|
|
referral_date = Column(Date)
|
|
|
|
committee = relationship("Committee", back_populates="committee_bills")
|
|
bill = relationship("Bill", back_populates="committee_bills")
|
|
|
|
__table_args__ = (
|
|
Index("ix_committee_bills_bill_id", "bill_id"),
|
|
Index("ix_committee_bills_committee_id", "committee_id"),
|
|
)
|