Skip to content

Sync 0.4.0: The module now owns the migrations of its tables

Sync 0.4.0 takes over the database tables for connections and transfer history from PhoenixKit core. Nothing changes in the admin, and on an existing site the tables stay exactly as they are.

The module’s own migrations

Until now core’s migrations created phoenix_kit_sync_connections and phoenix_kit_sync_transfers. Sync 0.4.0 brings its own versioned migration chain, which mix phoenix_kit.update finds and runs.

Its first version, V1, only adopts the two tables. Each statement checks whether the table, constraint or index is already there, so on an existing install the only new thing is a version marker, pksyn_schema:1, kept as a comment on the connections table. On an install whose core no longer creates these tables, the same statements build them the way core did. From now on, a change to the shape of these tables comes as a new version of this module, not of core.

Rolling the chain back only rewrites the marker. It never drops a table, so your connections and their transfer history stay.

Checked by repair and doctor

The module now describes its tables to core, so mix phoenix_kit.doctor and mix phoenix_kit.repair check the sync tables against what the module expects.

The older PhoenixKitSync.Migration, which a host app could call from its own migration file, is still there for apps that do, but mix phoenix_kit.update never runs it. Its down drops both tables; the new chain’s never does.

Upgrading

Sync 0.4 needs PhoenixKit 2.65.0 or later, and it now also accepts PhoenixKit 3.x. Update the dependency and run mix phoenix_kit.update: it applies the module’s V1, which on an existing site only writes the marker. No data changes, and the admin pages are the same as in 0.3.

 

 


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