"""cleanup_card_attributes_json_nulls

Revision ID: 0251
Revises: 0250
Create Date: 2023-05-05 21:20:02.408801

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


# revision identifiers, used by Alembic.
revision = '0251'
down_revision = '0250'
branch_labels = None
depends_on = None


def upgrade():
    op.execute("""
        DELETE FROM card_attributes
        WHERE (value IS NULL OR value = 'null'::jsonb) AND unindexed_value IS NULL
    """)


def downgrade():
    pass
