"""Add l10n support to participant model

Revision ID: 840cf95b27b5
Revises: a919f7537e33
Create Date: 2019-01-20 07:53:52.448881

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '840cf95b27b5'
down_revision = 'a919f7537e33'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('participant_translation',
    sa.Column('id', sa.Integer(), autoincrement=False, nullable=False),
    sa.Column('locale', sa.String(length=10), nullable=False),
    sa.Column('name', sa.Unicode(length=255), nullable=True),
    sa.ForeignKeyConstraint(['id'], ['participant.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id', 'locale')
    )
    op.drop_column('participant', 'name')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('participant', sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=True))
    op.drop_table('participant_translation')
    # ### end Alembic commands ###
