ExTenant.Actions (ExTenant v0.2.1) View Source

Run the tenanted migrations

Link to this section Summary

Functions

Apply tenant migrations to a tenant with given strategy, in given direction.

Restarts the app if there was any migration command.

Link to this section Functions

Link to this function

ensure_started(repo, opts)

View Source

Specs

ensure_started(Mix.Ecto.Repo.t(), Keyword.t()) :: {:ok, pid() | nil, [atom()]}
Link to this function

migrate_tenanted(args, direction)

View Source

Apply tenant migrations to a tenant with given strategy, in given direction.

A direction can be given, as the third parameter, which defaults to :up A strategy can be given as an option, and defaults to :all

Paramaters

  • direction: defaults to :up

Options

  • :all - runs all available if true
  • :step - runs the specific number of migrations
  • :to - runs all until the supplied version is reached
  • :log - the level to use for logging. Defaults to :info. Can be any of Logger.level/0 values or false.
Link to this function

restart_apps_if_migrated(apps)

View Source

Specs

restart_apps_if_migrated([atom()]) :: :ok

Restarts the app if there was any migration command.