"""Added sessions and previously recommended

Revision ID: a1141f87ae27
Revises: fbe394223913
Create Date: 2020-03-24 15:31:21.331654

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'a1141f87ae27'
down_revision = 'fbe394223913'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('previously_recommended',
    sa.Column('profile_id', sa.String(length=255), nullable=False),
    sa.Column('product_id', sa.String(length=255), nullable=True),
    sa.ForeignKeyConstraint(['product_id'], ['products.product_id'], ),
    sa.ForeignKeyConstraint(['profile_id'], ['profiles.profile_id'], ),
    sa.PrimaryKeyConstraint('profile_id')
    )
    op.create_table('sessions',
    sa.Column('session_id', sa.String(length=255), nullable=False),
    sa.Column('profile_id', sa.String(length=255), nullable=True),
    sa.ForeignKeyConstraint(['profile_id'], ['profiles.profile_id'], ),
    sa.PrimaryKeyConstraint('session_id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('sessions')
    op.drop_table('previously_recommended')
    # ### end Alembic commands ###
