PhoenixKit 1.7.183: Migrations fixed for installs in their own schema
PhoenixKit 1.7.183 fixes migrations for sites that install PhoenixKit into its own database schema with --prefix. No change for sites in the default schema.
Some migrations created indexes with a schema in the index name, which Postgres refuses, so the migration stopped. Index names are now plain, as Postgres expects. Several other migrations checked whether a constraint or column already existed by its name alone. If a table in another schema had the same name, the check said yes and the constraint or column was silently skipped. Those checks now look only at the install’s own table.
Upgrading
Update and run mix phoenix_kit.update. Run it again on a prefixed install where it stopped on one of these migrations.
Full release notes: PhoenixKit 1.7.183
1.7.183 · 11 July 2026
Fixed
- Prefixed (
--prefix) installs could fail to migrate.CREATE INDEXwas being called with a schema-qualified index name (CREATE INDEX prefix.name ON ...), which Postgres rejects outright — an index always lands in its table’s schema, so only the table reference may be qualified. Affectedadd_uuid_unique_indexes/drop_uuid_unique_indexes(uuid_fk_columns.ex),V56,V57, andV95’s media-folder unique index. (#628) - Cross-schema false-positive existence checks on prefixed installs. Several
idempotency guards (
pg_constraintlookups inV35,V102,V113,V115,V118,V119; aninformation_schema.columnslookup inV95) matched on constraint/column name alone, so an identically-named constraint or column already present in a different schema’s table made the guard think it existed in the current schema too — silently skipping theADD CONSTRAINT/ADD COLUMN. Fixed by anchoring each check to the target relation (conrelid = '<prefix>. <table>'::regclass/table_schema = '<prefix>'). Added an integration test that runs the full versioned migration chain into a named schema and asserts every index and column lands correctly. (#628)
PhoenixKit 1.7.183. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.