"""Updated page and committee module for dual languge

Revision ID: aeceb6e193
Revises: 16bc3324d30
Create Date: 2015-07-19 18:24:35.633000

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = 'aeceb6e193'
down_revision = '16bc3324d30'


def upgrade():
    # commands auto generated by Alembic - please adjust! ###
    op.alter_column('committee_revision', 'description',
                    new_column_name='nl_description',
                    existing_type=sa.Text())
    op.alter_column('committee_revision', 'title',
                    new_column_name='nl_title',
                    existing_type=sa.String(length=128))

    op.add_column('committee_revision',
                  sa.Column('en_description', sa.Text(), nullable=True))
    op.add_column('committee_revision',
                  sa.Column('en_title', sa.String(length=128), nullable=True))

    op.alter_column('page_revision', 'content',
                    new_column_name='nl_content',
                    existing_type=sa.Text())
    op.alter_column('page_revision', 'title',
                    new_column_name='nl_title',
                    existing_type=sa.String(length=128))

    op.add_column('page_revision',
                  sa.Column('en_content', sa.Text(), nullable=True))
    op.add_column('page_revision',
                  sa.Column('en_title', sa.String(length=128), nullable=True))
    # end Alembic commands ###


def downgrade():
    # commands auto generated by Alembic - please adjust! ###
    op.alter_column('page_revision', 'nl_content',
                    new_column_name='content',
                    existing_type=sa.Text())
    op.alter_column('page_revision', 'nl_title',
                    new_column_name='title',
                    existing_type=sa.String(length=128))

    op.drop_column('page_revision', 'en_title')
    op.drop_column('page_revision', 'en_content')

    op.alter_column('committee_revision', 'nl_description',
                    new_column_name='description',
                    existing_type=sa.Text())
    op.alter_column('committee_revision', 'nl_title',
                    new_column_name='title',
                    existing_type=sa.String(length=128))

    op.drop_column('committee_revision', 'en_title')
    op.drop_column('committee_revision', 'en_description')
    # end Alembic commands ###
