"""session_info model

Revision ID: f0c1aa4b2657
Revises: 8ff7642a7c59
Create Date: 2017-08-13 00:07:54.003071

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "f0c1aa4b2657"
down_revision = "8ff7642a7c59"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "session_info",
        sa.Column("ip_timestamp", sa.String(length=50), nullable=False),
        sa.Column("ip", sa.String(length=16), nullable=False),
        sa.Column("timestamp", sa.Numeric(), nullable=False),
        sa.Column("route_rule", sa.String(length=100), nullable=False),
        sa.PrimaryKeyConstraint("ip_timestamp"),
    )
    op.create_unique_constraint("episode_video", "videos", ["video_id", "episode_id"])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint("episode_video", "videos", type_="unique")
    op.drop_table("session_info")
    # ### end Alembic commands ###
