Skip to content

Entities 0.4.10: The module takes over its own migrations

Entities 0.4.10 gives the module its own migration chain, so future changes to its two tables can ship with the module instead of waiting for a PhoenixKit release. Nothing in the schema changes.

mix phoenix_kit.status and mix phoenix_kit.update now list the module’s migrations. The first one adopts phoenix_kit_entities and phoenix_kit_entity_data, which PhoenixKit created and still creates. Every statement only creates what is missing, under the same names as core’s, and the one new thing is a version marker in a comment on the table. Rolling it back only removes the marker; it never drops a table or a row. mix phoenix_kit.status also no longer reports the module as errored when the database cannot be reached.

The Update and Return and Create and Return buttons of the entity form send you back to the admin page you came from. That page is now checked with PhoenixKit’s own admin-path test when the core provides it, so the buttons keep their destination on a site that renamed its admin area, and pages such as /administrators no longer count as admin pages.

Upgrading

Run mix phoenix_kit.update to apply the module’s first migration. It changes no data.

Full release notes: Entities 0.4.10

0.4.10 · 5 September 2026

Added

  • A module-owned migration chain (PhoenixKitEntities.Migrations), registered through migration_module/0 and discovered by mix phoenix_kit.status / mix phoenix_kit.update. V1 is purely adoptive: phoenix_kit_entities and phoenix_kit_entity_data were created by core and still ship in its squashed baseline, so every statement is IF NOT EXISTS-guarded and name-identical to core’s objects, and the only new object is the pkn_schema:1 marker stamped as a COMMENT ON TABLE. Nothing about the schema changes; what changes is that this package now owns the two tables’ future shape instead of waiting on a core release. down/1 only unstamps the marker — it never drops a table or a row (#42).

Fixed

  • A map-shaped down/1 rolled back to the wrong version. The target was read only from a keyword list, while the prefix was read from either a keyword list or a map (the shape core’s own migrator threads through its chain), so down(%{prefix: "public", version: 1}) validated its prefix, discarded its version and unstamped to 0 (#42).
  • migrated_version_runtime/1 survives a dead connection pool. It guarded against exceptions only, but an unreachable database exits rather than raising on a dead or unstarted pool, which reported this module as errored to mix phoenix_kit.status where every sibling module reports “not installed”. An unusable prefix still raises, deliberately: “not installed” and “I cannot query that prefix” must not look alike to the update task (#42).

Changed

  • The test suite now runs the migration chain it ships. Schema setup applies core’s versioned migrations and then this module’s own chain through PhoenixKitEntities.Test.Migration — the checked-in equivalent of the migration mix phoenix_kit.update generates in a host app — so the suite exercises exactly the DDL an install gets rather than asserting on statement strings that no database has ever parsed (#42).
  • The adopted object inventory is pinned to core’s own manifest. A new test derives what V1 must contain from PhoenixKit.Migrations.ExpectedSchema (43 required objects across the two tables) instead of a hand-copied list, so an object core adds and this chain misses fails the suite (#42).

Entities 0.4.10. Install or update: {:phoenix_kit_entities, "~> 0.4"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.