"""empty message

Revision ID: dd71851b79ec
Revises: dce02c094a91
Create Date: 2020-10-30 17:13:06.427616

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = 'dd71851b79ec'
down_revision = 'dce02c094a91'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('administrateur', sa.Column('email', sa.String(length=60), nullable=True))
    op.create_index(op.f('ix_administrateur_email'), 'administrateur', ['email'], unique=True)
    op.drop_index('ix_administrateur_email_admin', table_name='administrateur')
    op.drop_column('administrateur', 'email_admin')
    op.add_column('etudiant', sa.Column('email', sa.String(length=60), nullable=True))
    op.create_index(op.f('ix_etudiant_email'), 'etudiant', ['email'], unique=True)
    op.drop_index('ix_etudiant_email_etud', table_name='etudiant')
    op.drop_column('etudiant', 'email_etud')
    op.add_column('professeur', sa.Column('email', sa.String(length=60), nullable=True))
    op.create_index(op.f('ix_professeur_email'), 'professeur', ['email'], unique=True)
    op.drop_index('ix_professeur_email_prof', table_name='professeur')
    op.drop_column('professeur', 'email_prof')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('professeur', sa.Column('email_prof', mysql.VARCHAR(length=60), nullable=True))
    op.create_index('ix_professeur_email_prof', 'professeur', ['email_prof'], unique=True)
    op.drop_index(op.f('ix_professeur_email'), table_name='professeur')
    op.drop_column('professeur', 'email')
    op.add_column('etudiant', sa.Column('email_etud', mysql.VARCHAR(length=60), nullable=True))
    op.create_index('ix_etudiant_email_etud', 'etudiant', ['email_etud'], unique=True)
    op.drop_index(op.f('ix_etudiant_email'), table_name='etudiant')
    op.drop_column('etudiant', 'email')
    op.add_column('administrateur', sa.Column('email_admin', mysql.VARCHAR(length=60), nullable=True))
    op.create_index('ix_administrateur_email_admin', 'administrateur', ['email_admin'], unique=True)
    op.drop_index(op.f('ix_administrateur_email'), table_name='administrateur')
    op.drop_column('administrateur', 'email')
    # ### end Alembic commands ###
