aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/migrations/versions/85f2b226ec99_add_webmention_retry_backoff.py
blob: d5ad4dcbf84e5b3477df9e08a37752a9039490dc (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
32
33
34
35
36
37
38
39
40
41
# SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me>
#
# SPDX-License-Identifier: BSD-3-Clause

"""Add Webmention retry backoff.

Revision ID: 85f2b226ec99
Revises: 408fc2eca9ce
Create Date: 2026-10-30 13:08:17.340631
"""

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "85f2b226ec99"
down_revision = "408fc2eca9ce"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("sent_webmentions", schema=None) as batch_op:
        batch_op.add_column(
            sa.Column("attempt_count", sa.Integer(), nullable=False, server_default="0")
        )
        batch_op.add_column(
            sa.Column("next_retry_at", sa.DateTime(timezone=True), nullable=True)
        )

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("sent_webmentions", schema=None) as batch_op:
        batch_op.drop_column("next_retry_at")
        batch_op.drop_column("attempt_count")

    # ### end Alembic commands ###