"""empty message

Revision ID: 39cc0296ee01
Revises: 9d4ca0314f07
Create Date: 2020-01-31 12:07:28.635996

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "39cc0296ee01"
down_revision = "9d4ca0314f07"
branch_labels = None
depends_on = None

enum_values = ("FREE", "PAID")
enum_type = sa.Enum(*enum_values, name="rate_type")


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    enum_type.create(op.get_bind(), checkfirst=False)
    op.add_column(
        "orders",
        sa.Column(
            "rate",
            sa.Enum("FREE", "PAID", name="rate_type"),
            server_default="PAID",
            nullable=False,
        ),
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("orders", "rate")
    enum_type.drop(op.get_bind(), checkfirst=False)
    # ### end Alembic commands ###
