PhoenixKitSync.Migration (PhoenixKitSync v0.1.3)

Copy Markdown View Source

Creates the sync tables if they don't already exist.

PhoenixKit's core migration system (V37, V44, V56, V58, V74) normally manages these tables. This module provides a fallback for installations where the tables haven't been created yet — every operation uses IF NOT EXISTS so it's safe to run even when tables already exist.

Usage

# In a migration file:
def up do
  PhoenixKitSync.Migration.up()
end

# Or with a schema prefix:
def up do
  PhoenixKitSync.Migration.up(prefix: "my_schema")
end

Tables Created

  • phoenix_kit_sync_connections — permanent token-based connections
  • phoenix_kit_sync_transfers — transfer history and approval workflow

Summary

Functions

Drops sync tables if they exist.

Creates sync tables and indexes if they don't already exist.

Functions

down(opts \\ [])

Drops sync tables if they exist.

up(opts \\ [])

Creates sync tables and indexes if they don't already exist.

Options:

  • :prefix — schema prefix (default: nil for public schema)