Skip to content

Customer Support 0.4.0: The module takes over its own tables

Customer Support 0.4.0 gives the ticket module its own migrations for its four tables, shows ticket counts on the admin Modules page, and catches over-long values in the form instead of the database.

Its own migration chain

The tickets, comments, attachments and status history tables are still created by PhoenixKit core. From this release the module adopts them through its own migration, V1, and marks the tickets table with its version. V1 makes one real change: the “changed by” user on a status history entry may now be empty. That matches what the database already does when that user is deleted. On sites installed from PhoenixKit 2.0’s baseline the column was required, so V1 relaxes it; on older sites nothing changes.

Ticket counts on the Modules page

The module’s card on the admin Modules page now shows Total, Open and In Progress ticket counts.

Clearer errors on long values

The title, status and slug of a ticket, and the statuses in a history entry, are now checked against the column widths before saving. An over-long status no longer fails in the database; it comes back as a form error.

Upgrading

Run mix phoenix_kit.update to apply the module’s V1 migration. It needs PhoenixKit 2.4 or later, as before. The README now explains how to remove the module and its data by hand. There is no automatic uninstall, and dropping the tables is not final while core still expects them: mix phoenix_kit.repair creates them again, empty.

Full release notes: Customer Support 0.4.0

0.4.0 · 16 September 2026

Added

  • PhoenixKitCustomerSupport.Migrations — this module now owns and versions the future shape of its 4 tables (phoenix_kit_tickets, phoenix_kit_ticket_comments, phoenix_kit_ticket_attachments, phoenix_kit_ticket_status_history) via its own migration chain, the same pattern already shipped for phoenix_kit_posts, phoenix_kit_dashboards and phoenix_kit_warehouse. V1 adopts core’s current V135/V168 shape and stamps a pkcs_schema:1 marker on phoenix_kit_tickets. One real change: changed_by_uuid on phoenix_kit_ticket_status_history is made nullable (its FK is ON DELETE SET NULL, which core’s NOT NULL baseline contradicts and V164 documents without fixing) — a no-op on hosts that already carry it nullable, an ALTER COLUMN … DROP NOT NULL on hosts installed from the squashed baseline. Any legacy descriptive COMMENT on phoenix_kit_tickets is replaced by the marker.

Fixed

  • Ticket.changeset/2 and TicketStatusHistory.changeset/2 now validate against column_widths/0, the same widths V1’s DDL uses, instead of a hard-coded 255. from_status/to_status were not length-checked at all, so an over-long value raised at Postgres instead of returning a changeset error.
  • README “Removing this module”: DROP TABLE is not final while core’s manifest still requires these tables (mix phoenix_kit.repair recreates them empty), and clearing the version marker does nothing because the next mix phoenix_kit.update re-stamps it. SQL is now schema-qualified.
  • Typespecs: Ticket.user_uuid and TicketStatusHistory.changed_by_uuid can be nil (both FKs are ON DELETE SET NULL).

Customer Support 0.4.0. Install or update: {:phoenix_kit_customer_support, "~> 0.4"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.