"""CHG submission repo nullable 

Revision ID: c19902c1c91d
Revises: f9815c2de14e
Create Date: 2022-12-08 22:07:54.753813

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

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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table(
        "submission", schema=None
    ) as batch_op:
        batch_op.alter_column(
            "assignment_repo_id",
            existing_type=mysql.VARCHAR(charset="utf8mb4", collation="utf8mb4_general_ci", length=36),
            type_=mysql.VARCHAR(charset="utf8mb4", collation="utf8mb4_general_ci", length=36),
            nullable=True,
        )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table(
        "submission", schema=None
    ) as batch_op:
        batch_op.alter_column(
            "assignment_repo_id",
            existing_type=mysql.VARCHAR(charset="utf8mb4", collation="utf8mb4_general_ci", length=36),
            type_=mysql.VARCHAR(charset="utf8mb4", collation="utf8mb4_general_ci", length=36),
            nullable=False,
        )
    # ### end Alembic commands ###
