Skip to content

Commit

Permalink
Add migration for content_hash field
Browse files Browse the repository at this point in the history
  • Loading branch information
jb3 committed Sep 10, 2024
1 parent e507004 commit 6fc204b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions alembic/versions/a192a8d3282c_add_content_hash.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""
Add content_hash field to messages model
Revision ID: a192a8d3282c
Revises: 01b101590e74
Create Date: 2024-09-10 16:32:46.593911
"""

Check failure on line 8 in alembic/versions/a192a8d3282c_add_content_hash.py

View workflow job for this annotation

GitHub Actions / lint / lint

Ruff (D400)

alembic/versions/a192a8d3282c_add_content_hash.py:1:1: D400 First line should end with a period

Check failure on line 8 in alembic/versions/a192a8d3282c_add_content_hash.py

View workflow job for this annotation

GitHub Actions / lint / lint

Ruff (D415)

alembic/versions/a192a8d3282c_add_content_hash.py:1:1: D415 First line should end with a period, question mark, or exclamation point
import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision = "a192a8d3282c"
down_revision = "01b101590e74"
branch_labels = None
depends_on = None


def upgrade() -> None:
"""Apply the current migration."""
op.add_column("messages", sa.Column("content_hash", sa.String(), nullable=False))


def downgrade() -> None:
"""Revert the current migration."""
op.drop_column("messages", "content_hash")

0 comments on commit 6fc204b

Please sign in to comment.