query:
UPDATE "table_name"
SET properties = properties || jsonb_build_object('$ip', ip)
WHERE ip IS NOT NULL;
I am running a Django migration, I need the reverse sql that undo the results of executing this query and restores the table in the previous state.
Because when I run the django migration test for the following operation:
operations = [
# migrations.RunPython(migrate_event_ip_to_property, rollback),
migrations.RunSQL(
"""
UPDATE "table_name"
SET properties = properties || jsonb_build_object('$ip', ip)
WHERE ip IS NOT NULL;
""",
None
)
]
I get IrreversibleError. I think if I provide the reverse sql, instead of None, it might work