"""make events user_id nullable

Revision ID: make_events_user_id_nullable
Revises: f18735338888
Create Date: 2024-03-19 10:00:00.000000

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = 'make_events_user_id_nullable'
down_revision = 'f18735338888'  # This should be the latest migration
branch_labels = None
depends_on = None

def upgrade():
    # Make user_id nullable in events table
    op.alter_column('events', 'user_id',
               existing_type=sa.Integer(),
               nullable=True)

def downgrade():
    # Make user_id non-nullable again
    op.alter_column('events', 'user_id',
               existing_type=sa.Integer(),
               nullable=False) 