"""CHG replace lecture notes number with post_time

Revision ID: 65be3bf01dae
Revises: c9f4c87534a5
Create Date: 2021-06-30 00:03:49.376357

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

# revision identifiers, used by Alembic.
revision = "65be3bf01dae"
down_revision = "c9f4c87534a5"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column("lecture_notes", sa.Column("post_time", sa.DateTime(), nullable=True))
    op.drop_column("lecture_notes", "number")
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "lecture_notes",
        sa.Column(
            "number",
            mysql.INTEGER(display_width=11),
            autoincrement=False,
            nullable=True,
        ),
    )
    op.drop_column("lecture_notes", "post_time")
    # ### end Alembic commands ###
