"""fix_billing_foreign_key

Revision: 0199
Revision ID: 259d870ba064
Revises: 291bfbf7ca71
Create Date: 2020-11-23 10:27:35.181512

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql


# revision identifiers, used by Alembic.
revision = '259d870ba064'
down_revision = '291bfbf7ca71'
branch_labels = None
depends_on = None


def upgrade():
    op.drop_constraint('organizations_billing_account_id_fkey', 'organizations')
    op.create_foreign_key('organizations_billing_account_id_fkey', 'organizations', 'billing_accounts', ['billing_account_id'], ['id'], ondelete='SET NULL')


def downgrade():
    pass
