View Source migraterl (migraterl v0.1.1)
Library module.
Summary
Functions
A default connection, for local testing or CI.
Creates the required migraterl tables on the Database.
Given a directory, applies only the files not already present on the migration. If the migration table does not yet exist, make sure to create it beforehand.
Types
-type directory() :: file:name_all().
-type options() :: #{repeatable => boolean()}.
-type version() :: non_neg_integer().
Functions
-spec default_connection() -> Result when Reason :: string(), Error :: {error, Reason}, Result :: epgsql:connection() | Error.
A default connection, for local testing or CI.
-spec init(Conn, Options) -> Result when Conn :: epgsql:connection(), Options :: options(), Error :: {error, any(), any()}, Result :: ok | Error.
Creates the required migraterl tables on the Database.
-spec migrate(Conn, Dir, Options) -> Result when Conn :: epgsql:connection(), Dir :: directory(), Options :: options(), Error :: {error, any(), any()}, Result :: ok | Error.
Given a directory, applies only the files not already present on the migration. If the migration table does not yet exist, make sure to create it beforehand.