"""support infinite length submission and comment bodies

Revision ID: 85458909736a
Revises: ba8a214736eb
Create Date: 2023-02-17 03:03:40.358958+00:00

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '85458909736a'
down_revision = 'ba8a214736eb'
branch_labels = None
depends_on = None


def upgrade():
	# ### commands auto generated by Alembic - please adjust! ###
	op.alter_column('comments', 'body',
			   existing_type=sa.VARCHAR(length=40000),
			   type_=sa.Text(),
			   existing_nullable=True)
	op.alter_column('comments', 'body_html',
			   existing_type=sa.VARCHAR(length=40000),
			   type_=sa.Text(),
			   nullable=False)
	op.alter_column('submissions', 'body',
			   existing_type=sa.VARCHAR(length=40000),
			   type_=sa.Text(),
			   existing_nullable=True)
	op.alter_column('submissions', 'body_html',
			   existing_type=sa.VARCHAR(length=40000),
			   type_=sa.Text(),
			   existing_nullable=True)
	# ### end Alembic commands ###


def downgrade():
	# ### commands auto generated by Alembic - please adjust! ###
	op.alter_column('submissions', 'body_html',
			   existing_type=sa.Text(),
			   type_=sa.VARCHAR(length=40000),
			   existing_nullable=True)
	op.alter_column('submissions', 'body',
			   existing_type=sa.Text(),
			   type_=sa.VARCHAR(length=40000),
			   existing_nullable=True)
	op.alter_column('oauth_apps', 'redirect_uri',
			   existing_type=sa.String(length=50),
			   type_=sa.VARCHAR(length=4096),
			   existing_nullable=False)
	op.alter_column('oauth_apps', 'client_id',
			   existing_type=sa.String(),
			   type_=sa.CHAR(length=64),
			   existing_nullable=True)
	op.alter_column('comments', 'body_html',
			   existing_type=sa.Text(),
			   type_=sa.VARCHAR(length=40000),
			   nullable=True)
	op.alter_column('comments', 'body',
			   existing_type=sa.Text(),
			   type_=sa.VARCHAR(length=40000),
			   existing_nullable=True)
	# ### end Alembic commands ###
