aboutsummaryrefslogtreecommitdiff
path: root/migrations/versions
diff options
context:
space:
mode:
Diffstat (limited to 'migrations/versions')
-rw-r--r--migrations/versions/681a2a9a1bc0_webmention_sender.py86
-rw-r--r--migrations/versions/be6e229d6a3d_do_not_limit_username_and_password_hash_.py58
-rw-r--r--migrations/versions/f63641044cc1_initial_database_schema.py58
3 files changed, 0 insertions, 202 deletions
diff --git a/migrations/versions/681a2a9a1bc0_webmention_sender.py b/migrations/versions/681a2a9a1bc0_webmention_sender.py
deleted file mode 100644
index 23bf2dd..0000000
--- a/migrations/versions/681a2a9a1bc0_webmention_sender.py
+++ /dev/null
@@ -1,86 +0,0 @@
-# SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me>
-#
-# SPDX-License-Identifier: BSD-3-Clause
-
-"""Webmention sender
-
-Revision ID: 681a2a9a1bc0
-Revises: f63641044cc1
-Create Date: 2026-08-14 13:40:55.149604
-
-"""
-
-import sqlalchemy as sa
-from alembic import op
-
-# revision identifiers, used by Alembic.
-revision = "681a2a9a1bc0"
-down_revision = "f63641044cc1"
-branch_labels = None
-depends_on = None
-
-
-def upgrade():
- # ### commands auto generated by Alembic - please adjust! ###
- op.create_table(
- "sources",
- sa.Column("uuid", sa.Uuid(), nullable=False),
- sa.Column("path", sa.Text(), nullable=False),
- sa.Column("url", sa.Text(), nullable=False),
- sa.Column("content_hash", sa.String(length=32), nullable=False),
- sa.Column("revision", sa.Integer(), nullable=False),
- sa.Column("last_seen_at", sa.DateTime(timezone=True), nullable=False),
- sa.Column("revised_at", sa.DateTime(timezone=True), nullable=False),
- sa.Column("deleted_at", sa.DateTime(timezone=True), nullable=True),
- sa.PrimaryKeyConstraint("uuid"),
- sa.UniqueConstraint("path"),
- sa.UniqueConstraint("url"),
- )
- op.create_table(
- "sent_webmentions",
- sa.Column("uuid", sa.Uuid(), nullable=False),
- sa.Column("source_id", sa.Uuid(), nullable=False),
- sa.Column("target", sa.Text(), nullable=False),
- sa.Column("active", sa.Boolean(), nullable=False),
- sa.Column("desired_revision", sa.Integer(), nullable=False),
- sa.Column("processed_revision", sa.Integer(), nullable=True),
- sa.Column("sent_revision", sa.Integer(), nullable=True),
- sa.Column(
- "status",
- sa.Enum(
- "sent",
- "unsupported",
- "failed",
- name="sent_webmention_status",
- native_enum=False,
- ),
- nullable=True,
- ),
- sa.Column("failure_reason", sa.Text(), nullable=True),
- sa.Column("endpoint", sa.Text(), nullable=True),
- sa.Column("response_status", sa.Integer(), nullable=True),
- sa.Column("status_url", sa.Text(), nullable=True),
- sa.Column("last_attempted_at", sa.DateTime(timezone=True), nullable=True),
- sa.Column("last_sent_at", sa.DateTime(timezone=True), nullable=True),
- sa.ForeignKeyConstraint(["source_id"], ["sources.uuid"], ondelete="CASCADE"),
- sa.PrimaryKeyConstraint("uuid"),
- sa.UniqueConstraint(
- "source_id", "target", name="uq_sent_webmention_source_target"
- ),
- )
- with op.batch_alter_table("sent_webmentions", schema=None) as batch_op:
- batch_op.create_index(
- batch_op.f("ix_sent_webmentions_source_id"), ["source_id"], unique=False
- )
-
- # ### 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_index(batch_op.f("ix_sent_webmentions_source_id"))
-
- op.drop_table("sent_webmentions")
- op.drop_table("sources")
- # ### end Alembic commands ###
diff --git a/migrations/versions/be6e229d6a3d_do_not_limit_username_and_password_hash_.py b/migrations/versions/be6e229d6a3d_do_not_limit_username_and_password_hash_.py
deleted file mode 100644
index 4bb7a7c..0000000
--- a/migrations/versions/be6e229d6a3d_do_not_limit_username_and_password_hash_.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me>
-#
-# SPDX-License-Identifier: BSD-3-Clause
-
-"""Do not limit username and password hash length
-
-Revision ID: be6e229d6a3d
-Revises: 681a2a9a1bc0
-Create Date: 2026-08-16 20:38:27.992624
-
-"""
-
-import sqlalchemy as sa
-from alembic import op
-
-# revision identifiers, used by Alembic.
-revision = "be6e229d6a3d"
-down_revision = "681a2a9a1bc0"
-branch_labels = None
-depends_on = None
-
-
-def upgrade():
- # ### commands auto generated by Alembic - please adjust! ###
- with op.batch_alter_table("users", schema=None) as batch_op:
- batch_op.alter_column(
- "username",
- existing_type=sa.VARCHAR(length=64),
- type_=sa.Text(),
- existing_nullable=False,
- )
- batch_op.alter_column(
- "password_hash",
- existing_type=sa.VARCHAR(length=256),
- type_=sa.Text(),
- nullable=False,
- )
-
- # ### end Alembic commands ###
-
-
-def downgrade():
- # ### commands auto generated by Alembic - please adjust! ###
- with op.batch_alter_table("users", schema=None) as batch_op:
- batch_op.alter_column(
- "password_hash",
- existing_type=sa.Text(),
- type_=sa.VARCHAR(length=256),
- nullable=True,
- )
- batch_op.alter_column(
- "username",
- existing_type=sa.Text(),
- type_=sa.VARCHAR(length=64),
- existing_nullable=False,
- )
-
- # ### end Alembic commands ###
diff --git a/migrations/versions/f63641044cc1_initial_database_schema.py b/migrations/versions/f63641044cc1_initial_database_schema.py
deleted file mode 100644
index 5017bc3..0000000
--- a/migrations/versions/f63641044cc1_initial_database_schema.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me>
-#
-# SPDX-License-Identifier: BSD-3-Clause
-
-"""Initial database schema
-
-Revision ID: f63641044cc1
-Revises:
-Create Date: 2026-08-09 11:18:10.051888
-
-"""
-
-import sqlalchemy as sa
-from alembic import op
-
-# revision identifiers, used by Alembic.
-revision = "f63641044cc1"
-down_revision = None
-branch_labels = None
-depends_on = None
-
-
-def upgrade():
- # ### commands auto generated by Alembic - please adjust! ###
- op.create_table(
- "received_webmentions",
- sa.Column("uuid", sa.Uuid(), nullable=False),
- sa.Column("source", sa.Text(), nullable=False),
- sa.Column("target", sa.Text(), nullable=False),
- sa.Column("status", sa.Text(), nullable=False),
- sa.Column("failure_reason", sa.Text(), nullable=True),
- sa.Column("updated_at", sa.DateTime(timezone=True), nullable=False),
- sa.PrimaryKeyConstraint("uuid"),
- sa.UniqueConstraint("source", "target", name="uq_webmention_source_target"),
- )
- op.create_table(
- "users",
- sa.Column("id", sa.Integer(), nullable=False),
- sa.Column("username", sa.String(length=64), nullable=False),
- sa.Column("password_hash", sa.String(length=256), nullable=True),
- sa.PrimaryKeyConstraint("id"),
- )
- with op.batch_alter_table("users", schema=None) as batch_op:
- batch_op.create_index(
- batch_op.f("ix_users_username"), ["username"], unique=True
- )
-
- # ### end Alembic commands ###
-
-
-def downgrade():
- # ### commands auto generated by Alembic - please adjust! ###
- with op.batch_alter_table("users", schema=None) as batch_op:
- batch_op.drop_index(batch_op.f("ix_users_username"))
-
- op.drop_table("users")
- op.drop_table("received_webmentions")
- # ### end Alembic commands ###