"""Make Users columns non-nullable

Revision ID: 8dac73be3ac9
Revises: 5f15fa23a553
Create Date: 2019-10-02 21:53:29.447754

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '8dac73be3ac9'
down_revision = '5f15fa23a553'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('Users', 'email',
               existing_type=sa.VARCHAR(length=255),
               nullable=False)
    op.alter_column('Users', 'password_hash',
               existing_type=sa.VARCHAR(length=128),
               nullable=False)
    op.alter_column('Users', 'username',
               existing_type=sa.VARCHAR(length=64),
               nullable=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('Users', 'username',
               existing_type=sa.VARCHAR(length=64),
               nullable=True)
    op.alter_column('Users', 'password_hash',
               existing_type=sa.VARCHAR(length=128),
               nullable=True)
    op.alter_column('Users', 'email',
               existing_type=sa.VARCHAR(length=255),
               nullable=True)
    # ### end Alembic commands ###
