Skip to content

Fix legacy PostgreSQL JSON columns - #542

Open
amanjain wants to merge 1 commit into
ui:masterfrom
amanjain:fix/legacy-postgres-json
Open

amanjain wants to merge 1 commit into
ui:masterfrom
amanjain:fix/legacy-postgres-json

Conversation

@amanjain

Copy link
Copy Markdown
Contributor

Convert legacy text-backed Email.headers, Email.context and Attachment.headers columns to jsonb. Leave existing jsonb columns and custom non-JSON context serializers unchanged.

Invalid JSON fails atomically with an error naming the affected table and attempted columns. Includes PostgreSQL tests, CI coverage and an upgrade note covering locks, table rewrites and maintenance planning.

Fixes #514. Split from #539 as requested.

Validation: full suites and PostgreSQL migration tests passed on Django 4.2.30 and 6.1.2; formatting checks passed.

@selwin ready for review.
@jacobmaster your upgrade-note and error-message suggestions are included.
@N1K1TAS95 could you verify this against your reported case?

…t storage

Convert legacy text-backed Email headers/context and Attachment headers
to jsonb on PostgreSQL, grouping conversions per table and leaving custom
context serializers unchanged. Preserve empty values and atomic failure
on invalid JSON; report the affected table and attempted columns.

Document exclusive locking, table rewrites, retention-based cleanup,
maintenance planning and manually applied conversions. Add PostgreSQL
regression tests and CI coverage.
Fixes ui#514.

Validation: full suites and PostgreSQL migration tests on Django 4.2.30
and 6.1.2; formatting check.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing migration for Attachment.headers TEXT to JSONB conversion

1 participant