From 62d099d0f3d588bd5e2868cd8fc17818843f673e Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Tue, 10 Sep 2024 16:33:38 +0100 Subject: [PATCH] Add migration for content_hash field --- .../versions/a192a8d3282c_add_content_hash.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 alembic/versions/a192a8d3282c_add_content_hash.py diff --git a/alembic/versions/a192a8d3282c_add_content_hash.py b/alembic/versions/a192a8d3282c_add_content_hash.py new file mode 100644 index 0000000..1d9c7c1 --- /dev/null +++ b/alembic/versions/a192a8d3282c_add_content_hash.py @@ -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 + +""" +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=True)) + + +def downgrade() -> None: + """Revert the current migration.""" + op.drop_column("messages", "content_hash")