Repository
==========

Service Name: :php:const:`Services::REPOSITORY`

The repository service must implement ``Baleen\Migrations\Repository\RepositoryInterface``, and we recommend that it
additionally extends ``Baleen\Migrations\Repository\AbstractRepository``. For more information on how to implement
``RepositoryInterface`` refer to the Baleen Migrations documentation.

The ``RepositoryProvider`` must also provide the :php:const:`Services::REPOSITORY_FILESYSTEM` and
:php:const`Services::MIGRATION_FACTORY` services.

The default implementation for this service is ``Baleen\Migrations\Repository\DirectoryRepository``. And unless you need
to load migrations for another source other than the filesystem, or from multiple folders at a time, the default
implementation should cover the needs of most migration libraries.

Repository Filesystem
---------------------

Service Name: :php:const:`Services::REPOSITORY_FILESYSTEM`

This service must be a instance of ``League\Flysystem\FilesystemInterface`` and is used both to load the migrations and
also to create them (the latter with the **migrations:create** command). Its root must therefore point to the folder
where those migrations will be located.

By default the repository's folder can be customized by end-users by using the configuration option
"migrations.directory".

Migration Factory
-----------------

Service Name: :php:const:`Services::MIGRATION_FACTORY`

This service must implement ``Baleen\Migrations\Migration\Factory\FactoryInterface``. It's used to instantiate all
migrations that are loaded by the repository, which is useful for example if the migration class needs certain
dependencies to be injected.

The default implementation used for this service is ``Baleen\Migrations\Migration\Factory\SimpleFactory``.
