View Source Mix.ArangoXEcto (ArangoX Ecto v1.3.1)
Migration task helper functions
Link to this section Summary
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
@type version() :: String.t() | Integer.t()
Specifies a migration version type
Link to this section Functions
@spec create_base_database() :: {:ok, String.t()} | {:error, Integer.t()}
Creates the database specified in the config
Creates a new database of name
@spec 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.
@spec create_migrations() :: :ok | {:error, Integer.t()}
Creates the migrations collection
Creates an empty system collection to store migrations.
@spec get_database_name!() :: String.t()
Gets the default repo's database name
@spec get_default_repo!() :: Ecto.Repo.t()
Gets the default repo
The first in the list of running repos is used.
Gets all the migrated versions
@spec 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.
Removes a version from the migrations collection
@spec timestamp() :: String.t()
Creates a timestamp for the migration file
Updates the migrated versions in the migration collection