Arcadic.MigrationSource (Arcadic v4.0.1)

Copy Markdown View Source

Loads trusted migration files from a directory at runtime, including in a release.

Load files from the build's application assets, such as a directory under :code.priv_dir/1. Each .exs file must define at least one migration. Auxiliary modules in the same file are allowed. Files are loaded in filename order, then migrations are returned in version order. A loaded file is immutable for the lifetime of the VM. Deploy a new release to change loaded migrations.

Summary

Functions

Load immediate .exs children and return their migration modules.

Types

duplicate_error()

@type duplicate_error() :: {:duplicate_migration_versions, [pos_integer()]}

Functions

load(dir)

@spec load(Path.t()) ::
  {:ok, [module()]}
  | {:error, File.posix() | :invalid_migration_file | duplicate_error()}

Load immediate .exs children and return their migration modules.