PhoenixKit 1.7.211: Database support for newsletter attachments
PhoenixKit 1.7.211 prepares the database for attachments on newsletter broadcasts. Migration V158 adds an attachments list to the broadcasts table, holding the Media files to send with every email of a broadcast.
The column only stores references. A file later deleted from Media is skipped at send time instead of blocking the delete. Attaching files is done in the Newsletters module; core adds no screen for it. The release also updates bandit and plug_crypto.
Upgrading
Run mix phoenix_kit.update to apply V158. Rolling V158 back should go together with rolling back the Newsletters release that writes the column.
Full release notes: PhoenixKit 1.7.211
1.7.211 · 25 July 2026
Added
- Migration V158 —
attachments JSONB NOT NULL DEFAULT '[]'onphoenix_kit_newsletters_broadcasts: an ordered list of Storage file uuids attached to every email of a broadcast, guarded by aphoenix_kit_newsletters_broadcasts_attachments_is_arrayCHECK (jsonb_typeof = 'array'). Soft references, no FK intophoenix_kit_files— same precedent as this table’scrm_list_uuid(V152) andsource_params(V155), so a file later deleted from Media degrades to skipped-at-send rather than blocking the delete. Element-level validation (uuid-ness, count cap) lives in thephoenix_kit_newslettersBroadcastchangeset.@current_versionbumped 157 → 158 (PR #661).
Changed
bandit1.12.0 → 1.12.1,plug_crypto2.1.1 → 2.2.0.
Fixed
- Post-merge review of PR #661 (
dev_docs/pull_requests/2026/661-broadcast-attachments-v158/):v158_test.exs’sinformation_schema.columnslookup now anchorstable_schema = 'public'—prefix_migration_test.exsbuilds the same table in a scratch schema on the same database, so an interrupted run could leave two matching rows and fail the suite with an unrelatedCaseClauseError. Added a CHECK-rejection test for a JSON scalar (the object case alone covered one of the five non-arrayjsonb_typeofresults), and a## down/1moduledoc section recording that V158 must roll back together with the newsletters release that writes the column.
PhoenixKit 1.7.211. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.