"""Don't use default_fkey ondelete/onupdate settings for spam filtering columns.

Opt for the PostgreSQL defaults of NO ACTION.

Revision ID: fb60c8528489
Revises: 6f71a90cff21
Create Date: 2019-09-16 23:18:35.892342

"""

# revision identifiers, used by Alembic.
revision = 'fb60c8528489'
down_revision = '6f71a90cff21'

from alembic import op   # lgtm[py/unused-import]
import sqlalchemy as sa  # lgtm[py/unused-import]


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(u'journal_user_agent_id_fkey', 'journal', type_='foreignkey')
    op.create_foreign_key('journal_user_agent_id_fkey', 'journal', 'user_agents', ['submitter_user_agent_id'], ['user_agent_id'])
    op.drop_constraint(u'submission_agent_id_fkey', 'submission', type_='foreignkey')
    op.create_foreign_key('submission_agent_id_fkey', 'submission', 'user_agents', ['submitter_user_agent_id'], ['user_agent_id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('submission_agent_id_fkey', 'submission', type_='foreignkey')
    op.create_foreign_key(u'submission_agent_id_fkey', 'submission', 'user_agents', ['submitter_user_agent_id'], ['user_agent_id'], onupdate=u'CASCADE', ondelete=u'SET NULL')
    op.drop_constraint('journal_user_agent_id_fkey', 'journal', type_='foreignkey')
    op.create_foreign_key(u'journal_user_agent_id_fkey', 'journal', 'user_agents', ['submitter_user_agent_id'], ['user_agent_id'], onupdate=u'CASCADE', ondelete=u'SET NULL')
    # ### end Alembic commands ###
