"""empty message

Revision ID: 158d296b23b8
Revises: 514a36eb1161
Create Date: 2018-08-19 10:13:52.714023

"""
import sqlalchemy as sa
import sqlalchemy_utils
from alembic import op

# revision identifiers, used by Alembic.
revision = '158d296b23b8'
down_revision = '514a36eb1161'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('language_identifier',
    sa.Column('resource_id', sa.Integer(), nullable=True),
    sa.Column('language_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['language_id'], ['language.id'], ),
    sa.ForeignKeyConstraint(['resource_id'], ['resource.id'], )
    )
    op.create_unique_constraint(None, 'language', ['name'])
    op.drop_constraint('resource_languages_id_fkey', 'resource', type_='foreignkey')
    op.drop_column('resource', 'languages_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('resource', sa.Column('languages_id', sa.INTEGER(), autoincrement=False, nullable=True))
    op.create_foreign_key('resource_languages_id_fkey', 'resource', 'language', ['languages_id'], ['id'])
    op.drop_constraint(None, 'language', type_='unique')
    op.drop_table('language_identifier')
    # ### end Alembic commands ###
