"""empty message

Revision ID: 17b55467346e
Revises: cc9cfa8c158e
Create Date: 2022-05-30 18:41:10.419837

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '17b55467346e'
down_revision = 'cc9cfa8c158e'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('post', 'body',
               existing_type=sa.VARCHAR(length=255),
               nullable=False)
    op.drop_constraint('post_author_fkey', 'post', type_='foreignkey')
    op.create_foreign_key(None, 'post', 'user', ['author'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'post', type_='foreignkey')
    op.create_foreign_key('post_author_fkey', 'post', 'user', ['author'], ['username'])
    op.alter_column('post', 'body',
               existing_type=sa.VARCHAR(length=255),
               nullable=True)
    # ### end Alembic commands ###
