"""empty message

Revision ID: d654130ad5fe
Revises: None
Create Date: 2016-10-27 06:43:16.671110

"""

# revision identifiers, used by Alembic.
revision = 'd654130ad5fe'
down_revision = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('gametable',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('table', sa.String(), nullable=False),
    sa.Column('author', sa.String(), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id'),
    sa.UniqueConstraint('table', 'author', name='_author_table')
    )
    op.create_table('role',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=80), nullable=True),
    sa.Column('description', sa.String(length=255), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.create_table('user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('email', sa.String(), nullable=True),
    sa.Column('password', sa.String(), nullable=True),
    sa.Column('name', sa.String(), nullable=True),
    sa.Column('active', sa.Boolean(), nullable=True),
    sa.Column('confirmed_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('email'),
    sa.UniqueConstraint('id')
    )
    op.create_table('gamedata',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('game_table_id', sa.Integer(), nullable=True),
    sa.Column('base', sa.String(), nullable=True),
    sa.Column('combination', sa.String(), nullable=True),
    sa.Column('result', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['game_table_id'], ['gametable.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('base', 'combination', name='_base_combination'),
    sa.UniqueConstraint('id')
    )
    op.create_table('roles_users',
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('role_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['role_id'], ['role.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], )
    )
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('roles_users')
    op.drop_table('gamedata')
    op.drop_table('user')
    op.drop_table('role')
    op.drop_table('gametable')
    ### end Alembic commands ###
