"""empty message

Revision ID: 91735d7b7c10
Revises: ef1575c1536f
Create Date: 2017-11-28 20:49:13.112519

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

# revision identifiers, used by Alembic.
revision = '91735d7b7c10'
down_revision = 'ef1575c1536f'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('comments', 'content',
               existing_type=mysql.VARCHAR(length=4096),
               nullable=False)
    op.add_column('users', sa.Column('birth_date', sa.String(length=128), nullable=False))
    op.add_column('users', sa.Column('first_name', sa.String(length=128), nullable=True))
    op.add_column('users', sa.Column('last_name', sa.String(length=128), nullable=True))
    op.alter_column('users', 'email',
               existing_type=mysql.VARCHAR(length=128),
               nullable=False)
    op.alter_column('users', 'password_hash',
               existing_type=mysql.VARCHAR(length=128),
               nullable=False)
    op.alter_column('users', 'username',
               existing_type=mysql.VARCHAR(length=128),
               nullable=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('users', 'username',
               existing_type=mysql.VARCHAR(length=128),
               nullable=True)
    op.alter_column('users', 'password_hash',
               existing_type=mysql.VARCHAR(length=128),
               nullable=True)
    op.alter_column('users', 'email',
               existing_type=mysql.VARCHAR(length=128),
               nullable=True)
    op.drop_column('users', 'last_name')
    op.drop_column('users', 'first_name')
    op.drop_column('users', 'birth_date')
    op.alter_column('comments', 'content',
               existing_type=mysql.VARCHAR(length=4096),
               nullable=True)
    # ### end Alembic commands ###
