diff options
| author | Dennis Fink | 2026-08-19 19:52:28 +0200 |
|---|---|---|
| committer | Dennis Fink | 2026-08-19 19:52:28 +0200 |
| commit | dfce52067fdbe1c7f59764ef4cd3fb2bfc056cc4 (patch) | |
| tree | 9699b70466fdaec4375c396a08b85aa385d2b2c9 /migrations/versions/f63641044cc1_initial_database_schema.py | |
| parent | d0e245d63e014d268310976fc45429f08d2cbbe9 (diff) | |
| download | webmentions-ssg-dfce52067fdbe1c7f59764ef4cd3fb2bfc056cc4.tar.gz webmentions-ssg-dfce52067fdbe1c7f59764ef4cd3fb2bfc056cc4.zip | |
chore(core): format database migrations
Apply the project formatting rules to the Alembic environment and
existing migration files.
Give the Webmention sender migration a descriptive filename and message.
Diffstat (limited to '')
| -rw-r--r-- | migrations/versions/f63641044cc1_initial_database_schema.py | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/migrations/versions/f63641044cc1_initial_database_schema.py b/migrations/versions/f63641044cc1_initial_database_schema.py index a3f0e40..c65af21 100644 --- a/migrations/versions/f63641044cc1_initial_database_schema.py +++ b/migrations/versions/f63641044cc1_initial_database_schema.py @@ -1,16 +1,16 @@ """Initial database schema Revision ID: f63641044cc1 -Revises: +Revises: Create Date: 2026-08-09 11:18:10.051888 """ -from alembic import op -import sqlalchemy as sa +import sqlalchemy as sa +from alembic import op # revision identifiers, used by Alembic. -revision = 'f63641044cc1' +revision = "f63641044cc1" down_revision = None branch_labels = None depends_on = None @@ -18,33 +18,37 @@ 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( + "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') + 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) + 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')) + 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') + op.drop_table("users") + op.drop_table("received_webmentions") # ### end Alembic commands ### |
