PhoenixLiveCalendar.Store.Ecto.Migrations (PhoenixLiveCalendar v0.1.0)

Copy Markdown View Source

Versioned migrations for PhoenixLiveCalendar's Ecto persistence layer.

Follows the Oban pattern: consumers generate a migration that delegates to this module, allowing PhoenixLiveCalendar to manage schema changes across versions without consumers modifying their migrations.

Usage

Generate a migration:

mix ecto.gen.migration add_phoenix_live_calendar

Then edit it:

defmodule MyApp.Repo.Migrations.AddPhoenixLiveCalendar do
  use Ecto.Migration

  def up, do: PhoenixLiveCalendar.Store.Ecto.Migrations.up(version: 1)
  def down, do: PhoenixLiveCalendar.Store.Ecto.Migrations.down(version: 1)
end

Options

  • :version — Target migration version (default: latest)
  • :prefix — PostgreSQL schema prefix for multi-tenant (default: "public")

Summary

Functions

Returns the current migration version.

Rolls back migrations down to the specified version.

Runs migrations up to the specified version.

Functions

current_version()

Returns the current migration version.

down(opts \\ [])

Rolls back migrations down to the specified version.

up(opts \\ [])

Runs migrations up to the specified version.