aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/migrations/versions/e62b1a7c4d90_cap_received_verification_recoveries.py
blob: c516636e11a277b8023122191e410fecaf80da2e (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
24
25
26
27
28
29
30
31
# SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me>
#
# SPDX-License-Identifier: BSD-3-Clause

"""Cap stale received Webmention verification recovery per row.

Revision ID: e62b1a7c4d90
Revises: d845aa7fbc19
"""

import sqlalchemy as sa
from alembic import op

revision = "e62b1a7c4d90"
down_revision = "d845aa7fbc19"
branch_labels = None
depends_on = None


def upgrade():
    with op.batch_alter_table("received_webmentions") as batch_op:
        batch_op.add_column(
            sa.Column(
                "recovery_attempts", sa.Integer(), nullable=False, server_default="0"
            )
        )


def downgrade():
    with op.batch_alter_table("received_webmentions") as batch_op:
        batch_op.drop_column("recovery_attempts")