"""empty message

Revision ID: 29ca8250bd4a
Revises: d2c96bebc596
Create Date: 2019-02-03 14:45:18.339043

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '29ca8250bd4a'
down_revision = 'd2c96bebc596'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('group_privilege',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('gid', sa.Integer(), nullable=True),
    sa.Column('priv', sa.String(length=64), nullable=True),
    sa.ForeignKeyConstraint(['gid'], ['group.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_group_privilege_gid'), 'group_privilege', ['gid'], unique=False)
    op.create_table('group_user',
    sa.Column('gid', sa.Integer(), nullable=True),
    sa.Column('uid', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['gid'], ['group.id'], ),
    sa.ForeignKeyConstraint(['uid'], ['user.id'], )
    )
    op.create_table('special_privilege',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('uid', sa.Integer(), nullable=True),
    sa.Column('priv', sa.String(length=64), nullable=True),
    sa.ForeignKeyConstraint(['uid'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_special_privilege_uid'), 'special_privilege', ['uid'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_special_privilege_uid'), table_name='special_privilege')
    op.drop_table('special_privilege')
    op.drop_table('group_user')
    op.drop_index(op.f('ix_group_privilege_gid'), table_name='group_privilege')
    op.drop_table('group_privilege')
    # ### end Alembic commands ###
