"""activity_user_id

Revision: 0213
Revision ID: 8db3ad545942
Revises: 44a1660b8ce7
Create Date: 2021-06-01 22:37:30.858194

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql


# revision identifiers, used by Alembic.
revision = '8db3ad545942'
down_revision = '44a1660b8ce7'
branch_labels = None
depends_on = None


def upgrade():
    op.add_column('activities', sa.Column('user_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'activities', 'users', ['user_id'], ['id'], ondelete='CASCADE')
    op.create_index(None, 'activities', ['user_id'], unique=False)


def downgrade():
    op.drop_column('activities', 'user_id')
