aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/models.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--webmentions_ssg/models.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/webmentions_ssg/models.py b/webmentions_ssg/models.py
index 4f688e5..58f95bc 100644
--- a/webmentions_ssg/models.py
+++ b/webmentions_ssg/models.py
@@ -17,6 +17,7 @@ from sqlalchemy import (
DateTime,
Enum,
ForeignKey,
+ Index,
Integer,
String,
Text,
@@ -116,6 +117,7 @@ class ReceivedWebmention(Base):
__table_args__ = (
UniqueConstraint("source", "target", name="uq_webmention_source_target"),
+ Index("ix_received_webmentions_status_updated_at", "status", "updated_at"),
)
def __repr__(self) -> str:
@@ -246,9 +248,7 @@ class SentWebmention(Base):
status_url: Mapped[str | None] = mapped_column(Text(), nullable=True, default=None)
# Retry state belongs to the desired revision, not to the target forever.
- attempt_count: Mapped[int] = mapped_column(
- Integer(), nullable=False, default=0
- )
+ attempt_count: Mapped[int] = mapped_column(Integer(), nullable=False, default=0)
next_retry_at: Mapped[datetime | None] = mapped_column(
DateTime(timezone=True), nullable=True, default=None
)