"""no orphaned tweets, accounts

Revision ID: 329bdefc3b47
Revises: 1b2f89225efc
Create Date: 2020-12-18 18:44:36.732767

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '329bdefc3b47'
down_revision = '1b2f89225efc'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('accounts_user_id_fkey', 'accounts', type_='foreignkey')
    op.create_foreign_key(None, 'accounts', 'users', ['user_id'], ['id'], ondelete='CASCADE')
    op.drop_constraint('tweets_author_id_fkey', 'tweets', type_='foreignkey')
    op.create_foreign_key(None, 'tweets', 'users', ['author_id'], ['id'], ondelete='CASCADE')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'tweets', type_='foreignkey')
    op.create_foreign_key('tweets_author_id_fkey', 'tweets', 'users', ['author_id'], ['id'])
    op.drop_constraint(None, 'accounts', type_='foreignkey')
    op.create_foreign_key('accounts_user_id_fkey', 'accounts', 'users', ['user_id'], ['id'])
    # ### end Alembic commands ###
