Mix.ArangoXEcto (ArangoX Ecto v1.0.0) View Source

Migration task helper functions

Link to this section Summary

Types

Specifies a migration version type

Functions

Creates the database specified in the config

Creates a new database of name

Creates a document to store migrations

Creates the migrations collection

Gets the default repo's database name

Gets the default repo

Gets all the migrated versions

Gets the path to the priv repo folder

Removes a version from the migrations collection

Creates a timestamp for the migration file

Updates the migrated versions in the migration collection

Link to this section Types

Specs

version() :: String.t() | Integer.t()

Specifies a migration version type

Link to this section Functions

Specs

create_base_database() :: {:ok, String.t()} | {:error, Integer.t()}

Creates the database specified in the config

Specs

create_database(String.t()) :: {:ok, String.t()} | {:error, Integer.t()}

Creates a new database of name

Link to this function

create_migration_document()

View Source

Specs

create_migration_document() :: :ok | {:error, Integer.t()}

Creates a document to store migrations

Creates a document with key of the database name. Seperating the migrations into seperate documents allow for more organisation and better debugging.

Specs

create_migrations() :: :ok | {:error, Integer.t()}

Creates the migrations collection

Creates an empty system collection to store migrations.

Specs

get_database_name!() :: String.t()

Gets the default repo's database name

Specs

get_default_repo!() :: Ecto.Repo.t()

Gets the default repo

The first in the list of running repos is used.

Link to this function

migrated_versions(db_name)

View Source

Specs

migrated_versions(String.t()) :: [String.t() | Integer.t()]

Gets all the migrated versions

Specs

path_to_priv_repo(Ecto.Repo.t()) :: String.t()

Gets the path to the priv repo folder

Will return a full file path to the priv/repo folder.

Link to this function

remove_version(version, db_name)

View Source

Specs

remove_version(version(), String.t()) :: [version()]

Removes a version from the migrations collection

Specs

timestamp() :: String.t()

Creates a timestamp for the migration file

Link to this function

update_versions(version, db_name)

View Source

Specs

update_versions(version(), String.t()) :: [version()]

Updates the migrated versions in the migration collection