"""removed foreign key constraints

Revision ID: 27ea9ee62713
Revises: f74a290ab2ba
Create Date: 2021-09-14 09:20:45.766552

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '27ea9ee62713'
down_revision = 'f74a290ab2ba'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('comment_events_user_id_fkey', 'comment_events', type_='foreignkey')
    op.drop_constraint('comments_author_id_fkey', 'comments', type_='foreignkey')
    op.drop_constraint('comments_post_id_fkey', 'comments', type_='foreignkey')
    op.drop_constraint('post_events_user_id_fkey', 'post_events', type_='foreignkey')
    op.drop_constraint('posts_author_id_fkey', 'posts', type_='foreignkey')
    op.drop_constraint('posts_site_id_fkey', 'posts', type_='foreignkey')
    op.drop_constraint('user_site_admins_user_id_fkey', 'user_site_admins', type_='foreignkey')
    op.drop_constraint('user_site_admins_site_id_fkey', 'user_site_admins', type_='foreignkey')
    op.drop_constraint('user_site_follows_user_id_fkey', 'user_site_follows', type_='foreignkey')
    op.drop_constraint('user_site_follows_site_id_fkey', 'user_site_follows', type_='foreignkey')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_foreign_key('user_site_follows_site_id_fkey', 'user_site_follows', 'sites', ['site_id'], ['id'])
    op.create_foreign_key('user_site_follows_user_id_fkey', 'user_site_follows', 'users', ['user_id'], ['id'])
    op.create_foreign_key('user_site_admins_site_id_fkey', 'user_site_admins', 'sites', ['site_id'], ['id'])
    op.create_foreign_key('user_site_admins_user_id_fkey', 'user_site_admins', 'users', ['user_id'], ['id'])
    op.create_foreign_key('posts_site_id_fkey', 'posts', 'sites', ['site_id'], ['id'])
    op.create_foreign_key('posts_author_id_fkey', 'posts', 'users', ['author_id'], ['id'])
    op.create_foreign_key('post_events_user_id_fkey', 'post_events', 'users', ['user_id'], ['id'])
    op.create_foreign_key('comments_post_id_fkey', 'comments', 'posts', ['post_id'], ['id'])
    op.create_foreign_key('comments_author_id_fkey', 'comments', 'users', ['author_id'], ['id'])
    op.create_foreign_key('comment_events_user_id_fkey', 'comment_events', 'users', ['user_id'], ['id'])
    # ### end Alembic commands ###
