"""modifying skills

Revision ID: 20f95f51fbf4
Revises: 466c62396372
Create Date: 2014-12-14 14:10:21.615564

"""

# revision identifiers, used by Alembic.
revision = '20f95f51fbf4'
down_revision = '466c62396372'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('service_skill',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=False),
    sa.Column('inspection', sa.Boolean(), nullable=True),
    sa.Column('service_provider_id', sa.Integer(), nullable=True),
    sa.Column('service_id', sa.Integer(), nullable=True),
    sa.Column('trash', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['service_id'], ['service.id'], ),
    sa.ForeignKeyConstraint(['service_provider_id'], ['service_provider.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.drop_column(u'service_provider', 'skills')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column(u'service_provider', sa.Column('skills', postgresql.ARRAY(postgresql.JSON()), autoincrement=False, nullable=True))
    op.drop_table('service_skill')
    ### end Alembic commands ###
