aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/migrations/versions
diff options
context:
space:
mode:
Diffstat (limited to 'webmentions_ssg/migrations/versions')
-rw-r--r--webmentions_ssg/migrations/versions/408fc2eca9ce_track_webmention_digest_notifications.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/webmentions_ssg/migrations/versions/408fc2eca9ce_track_webmention_digest_notifications.py b/webmentions_ssg/migrations/versions/408fc2eca9ce_track_webmention_digest_notifications.py
new file mode 100644
index 0000000..905b2c2
--- /dev/null
+++ b/webmentions_ssg/migrations/versions/408fc2eca9ce_track_webmention_digest_notifications.py
@@ -0,0 +1,36 @@
+"""Track webmention digest notifications
+
+Revision ID: 408fc2eca9ce
+Revises: be6e229d6a3d
+Create Date: 2026-10-29 20:24:42.008723
+
+"""
+
+import sqlalchemy as sa
+from alembic import op
+
+# revision identifiers, used by Alembic.
+revision = "408fc2eca9ce"
+down_revision = "be6e229d6a3d"
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+ # ### commands auto generated by Alembic - please adjust! ###
+ with op.batch_alter_table("received_webmentions", schema=None) as batch_op:
+ batch_op.add_column(
+ sa.Column("notification_sent_at", sa.DateTime(timezone=True), nullable=True)
+ )
+ op.execute(
+ "UPDATE received_webmentions SET notification_sent_at = CURRENT_TIMESTAMP"
+ )
+ # ### end Alembic commands ###
+
+
+def downgrade():
+ # ### commands auto generated by Alembic - please adjust! ###
+ with op.batch_alter_table("received_webmentions", schema=None) as batch_op:
+ batch_op.drop_column("notification_sent_at")
+
+ # ### end Alembic commands ###