From 8acbbaf1b3b94b773a5df36ea0873fd0be72c95c Mon Sep 17 00:00:00 2001 From: thegentlemanphysicist Date: Mon, 29 Jul 2024 17:05:27 -0700 Subject: [PATCH] chore: perform migration to allow null entries in table (#45) --- ...2818cb32_allow_null_in_offline_sessions.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 aggregator/alembic/versions/7c002818cb32_allow_null_in_offline_sessions.py diff --git a/aggregator/alembic/versions/7c002818cb32_allow_null_in_offline_sessions.py b/aggregator/alembic/versions/7c002818cb32_allow_null_in_offline_sessions.py new file mode 100644 index 0000000..ffab95e --- /dev/null +++ b/aggregator/alembic/versions/7c002818cb32_allow_null_in_offline_sessions.py @@ -0,0 +1,24 @@ +"""allow null in offline sessions + +Revision ID: 7c002818cb32 +Revises: 5bfc2a71a71f +Create Date: 2024-07-29 16:29:07.464223 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '7c002818cb32' +down_revision = '5bfc2a71a71f' +branch_labels = None +depends_on = None + + +def upgrade() -> None: + op.alter_column('client_sessions','offline_sessions', existing_type=sa.INTEGER(), nullable=True) + + +def downgrade() -> None: + op.alter_column('client_sessions','offline_sessions', existing_type=sa.INTEGER(), nullable=False)