Skip to content

Dashboards 0.6.0: The module takes over its own database migrations

Dashboards 0.6.0 gives the dashboards module its own database migrations, so future changes to its table come from this package instead of PhoenixKit core. Nothing changes in the admin or on a running site.

Its own migration chain

Until now the phoenix_kit_dashboards table came only from core PhoenixKit’s migrations. The module now has a migration chain of its own. Its first step adopts the table as core already creates it: it checks the existing shape, changes nothing, and records the version pkd_schema:1 on the table. No column, index or saved dashboard is touched, and no core release is needed for this step.

Rolling the module’s migrations back never drops the table or deletes rows, because the table holds every user’s saved dashboards. There is no automatic uninstall. The README’s new “Removing this module” section gives the SQL for removing the table by hand, and warns that mix phoenix_kit.repair recreates it empty while core still lists it as required.

Upgrading

Update the dependency and run mix phoenix_kit.update. It generates a migration for the module that only records the marker. Sites without this module, and new installs, see no difference. The requirement stays at PhoenixKit 2.15 or later.

Full release notes: Dashboards 0.6.0

0.6.0 · 15 September 2026

Changed

  • phoenix_kit_dashboards’ future shape now belongs to a module-owned migration chain, PhoenixKitDashboards.Migrations, marker pkd_schema:<N>, following the canonical dual-reader protocol documented by phoenix_kit_hello_world and used by phoenix_kit_boards/ phoenix_kit_web_analytics (migrated_version/1 for migration context, migrated_version_runtime/1 for mix phoenix_kit.update; up/1 re-reads the version before changing anything). Widths (title/slug/scope) are sourced from PhoenixKitDashboards.Schemas.Dashboard.column_widths/0 — the single shape authority — never restated as a second number.

    Ownership unfolds in three phases:

    • Phase 0 (this release) — V1 is an adoption, not a create: core’s V133/V139 baseline still creates the table (and its config column) on every install, and V1 re-asserts that exact shape idempotently and stamps the marker. Because no shape changes, core’s ExpectedSchema stays accurate — no core release is required and there is no release-ordering hazard.
    • Phase 1 (a future V2+) — the first real shape change requires first adding the altered objects to core’s manifest generator’s @excluded_exact and regenerating ExpectedSchema, then raising this package’s core floor to that release.
    • Phase 2 (a future core baseline squash) — once core stops creating this table for fresh installs, V1’s CREATE TABLE becomes the only thing that ever creates it from scratch, which is why up/1 already ensures uuid_generate_v7() (and its pgcrypto extension) exist rather than assuming core’s chain provided them.

    down/1 can never drop the table, for any target including 0. It unstamps (or re-stamps) the marker and nothing else: the rows are every user’s saved dashboard layouts, and on most installs the table is core-created. Test-pinned — no statement in either direction may match DROP/TRUNCATE/DELETE. There is deliberately no automated uninstall path; README.md’s new “Removing this module” section gives the operator manual SQL instead.

    Existing hosts: upgrade, then mix phoenix_kit.update; it generates a dashboards_update_v00_to_v01.exs migration that stamps pkd_schema:1 and nothing else changes. New hosts and hosts without this module: unchanged.

    This is the first of a planned series of similar module-owned-migration adoptions across phoenix_kit_* packages that today rely entirely on core’s versioned chain for their own tables.

Fixed

  • README “Removing this module” no longer promises what core undoes. While core still owns this table’s creation, its ExpectedSchema marks the table required, so mix phoenix_kit.repair recreates a dropped phoenix_kit_dashboards (empty). The guide now says so, qualifies the SQL with the schema prefix, and drops the “clear the marker to stop tracking” advice — the next mix phoenix_kit.update simply re-stamps it.
  • Corrected core-version citations (every adopted index/constraint is core V133, not V135) and two misleading comments in the migration tests.
  • migrated_version_runtime/1 is now covered against a real database for a foreign table comment, malformed pkd_schema: markers, an absent table, and an invalid prefix (re-raised, never reported as 0).

Dashboards 0.6.0. Install or update: {:phoenix_kit_dashboards, "~> 0.6"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.