"""add role.display_name

Revision ID: c19ae79d2521
Revises: 359caaf8c5f1
Create Date: 2018-09-24 14:02:59.533928

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

# revision identifiers, used by Alembic.
revision = "c19ae79d2521"
down_revision = "359caaf8c5f1"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "request_status_events",
        "time_created",
        existing_type=postgresql.TIMESTAMP(timezone=True),
        nullable=True,
        existing_server_default=sa.text("now()"),
    )
    op.add_column(
        "roles",
        sa.Column("display_name", sa.String(), nullable=False, server_default=""),
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("roles", "display_name")
    op.alter_column(
        "request_status_events",
        "time_created",
        existing_type=postgresql.TIMESTAMP(timezone=True),
        nullable=True,
        existing_server_default=sa.text("now()"),
    )
    # ### end Alembic commands ###
