"""CAS ticket model

Revision ID: 5e5b6527827
Revises: 3cd7518e6d87
Create Date: 2015-03-08 17:13:45.538359

"""

# revision identifiers, used by Alembic.
revision = '5e5b6527827'
down_revision = '3cd7518e6d87'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('tickets',
    sa.Column('ticket', sa.Unicode(length=255), nullable=False),
    sa.Column('user_id', sqlalchemy_utils.types.uuid.UUIDType(binary=False), nullable=False),
    sa.Column('expires', sa.DateTime(), nullable=False),
    sa.Column('consumed', sa.DateTime(), nullable=True),
    sa.Column('service', sa.Unicode(length=255), nullable=False),
    sa.Column('primary', sa.Boolean(), nullable=False),
    sa.ForeignKeyConstraint(['user_id'], ['users.uuid'], ),
    sa.PrimaryKeyConstraint('ticket')
    )
    ### end Alembic commands ###


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