aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/models/scan_state.py
blob: 924c15d640703fd2653c58f704666755ca59886b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me>
#
# SPDX-License-Identifier: BSD-3-Clause

"""Persist the last completed source scan for this single-site service."""

from datetime import datetime

from sqlalchemy import DateTime, Integer
from sqlalchemy.orm import Mapped, mapped_column

from ..extensions import Base


class ScanState(Base):
    """The single row tracking the most recent successful source scan."""

    __tablename__ = "scan_state"

    id: Mapped[int] = mapped_column(Integer, primary_key=True)
    last_completed_at: Mapped[datetime] = mapped_column(
        DateTime(timezone=True), nullable=False
    )