"""empty message

Revision ID: b776720ccd82
Revises: 
Create Date: 2019-08-12 07:47:36.571049

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

# revision identifiers, used by Alembic.
revision = "b776720ccd82"
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("users")
    op.add_column("user", sa.Column("admin", sa.Boolean(), nullable=False))
    op.add_column(
        "user", sa.Column("password_hash", sa.String(length=100), nullable=True)
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("user", "password_hash")
    op.drop_column("user", "admin")
    op.create_table(
        "users",
        sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False),
        sa.Column(
            "username", sa.VARCHAR(length=128), autoincrement=False, nullable=False
        ),
        sa.Column("email", sa.VARCHAR(length=128), autoincrement=False, nullable=False),
        sa.Column("active", sa.BOOLEAN(), autoincrement=False, nullable=False),
        sa.Column(
            "created_date", postgresql.TIMESTAMP(), autoincrement=False, nullable=False
        ),
        sa.PrimaryKeyConstraint("id", name="users_pkey"),
    )
    # ### end Alembic commands ###
