DripDrop.MixHelpers (DripDrop v0.1.0)

Copy Markdown View Source

Shared helpers for DripDrop Mix tasks.

Summary

Functions

Returns the migrations directory for a repo.

Returns the repo priv path, defaulting to priv/repo.

Resolves the Ecto repo supplied to a Mix task or configured for the app.

Checks whether a DripDrop setup migration already exists.

Returns a UTC migration timestamp.

Functions

migrations_dir(repo)

@spec migrations_dir(module()) :: String.t()

Returns the migrations directory for a repo.

priv_path(repo)

@spec priv_path(module()) :: String.t()

Returns the repo priv path, defaulting to priv/repo.

resolve_repo(repo_string)

@spec resolve_repo(String.t() | nil) :: module()

Resolves the Ecto repo supplied to a Mix task or configured for the app.

setup_migration_exists?(migrations_dir)

@spec setup_migration_exists?(String.t()) :: boolean()

Checks whether a DripDrop setup migration already exists.

timestamp()

@spec timestamp() :: String.t()

Returns a UTC migration timestamp.