| 15 | |
| 16 | |
| 17 | class Subscription(Base): |
| 18 | __tablename__ = "feeds" |
| 19 | |
| 20 | id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True) |
| 21 | url: Mapped[str] = mapped_column(nullable=False, unique=True, index=True) |
| 22 | title: Mapped[str] = mapped_column(nullable=False) |
| 23 | tag: Mapped[Optional[str]] |
| 24 | link: Mapped[str] = mapped_column(nullable=False) |
| 25 | updated_at: Mapped[datetime] = mapped_column(nullable=False, default=datetime.now) |
| 26 | |
| 27 | def __repr__(self) -> str: |
| 28 | return f"Feed(id={self.id!r}, url={self.url!r},title={self.title},tag={self.tag!r},link={self.link!r})" |
| 29 | |
| 30 | |
| 31 | Base.metadata.create_all(bind=engine) |