"""empty message

Revision ID: 2b767cb617f
Revises: 26e69577923
Create Date: 2017-03-10 20:15:56.605789

"""

# revision identifiers, used by Alembic.
revision = '2b767cb617f'
down_revision = '26e69577923'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('service',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(length=64), nullable=True),
    sa.Column('description', sa.Text(), nullable=True),
    sa.Column('visible', sa.Boolean(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index('ix_service_username', 'service', ['username'], unique=True)
    op.create_table('media',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(length=64), nullable=True),
    sa.Column('description', sa.Text(), nullable=True),
    sa.Column('visible', sa.Boolean(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index('ix_media_username', 'media', ['username'], unique=True)
    op.create_table('service_offered',
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('service_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['service_id'], ['service.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], )
    )
    op.create_table('media_offered',
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('media_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['media_id'], ['media.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], )
    )
    op.add_column('group', sa.Column('group_type', sa.Integer(), nullable=True))
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('group', 'group_type')
    op.drop_table('media_offered')
    op.drop_table('service_offered')
    op.drop_index('ix_media_username', 'media')
    op.drop_table('media')
    op.drop_index('ix_service_username', 'service')
    op.drop_table('service')
    ### end Alembic commands ###
