Mix.Tenex (Tenex v1.0.4)

View Source

Useful functions for any tenex mix task.

Here is the list of tasks we have for now:

Summary

Functions

Ensures the given repository is started and running.

Ensures the migrations path exists for the given repo.

Restarts the app if there was any migration command.

Runs the tenant migrations with the given args and using migrator function.

Returns the private repository path relative to the source.

Functions

ensure_started(repo, opts)

@spec ensure_started(Mix.Ecto.Repo.t(), Keyword.t()) :: {:ok, pid() | nil, [atom()]}

Ensures the given repository is started and running.

ensure_tenant_migrations_path(repo)

Ensures the migrations path exists for the given repo.

Returns the path for the repo tenant migrations folder if succeeds or Mix.raise's if it fails.

restart_apps_if_migrated(apps, list)

@spec restart_apps_if_migrated([atom()], list()) :: :ok

Restarts the app if there was any migration command.

run_tenant_migrations(args, direction, migrator \\ &Migrator.run/4)

Runs the tenant migrations with the given args and using migrator function.

source_repo_priv(repo)

Returns the private repository path relative to the source.