This package is abandoned and no longer maintained. The author suggests using the reddogs-at/reddogs-migrations package instead.

Module specific doctrine migrations

1.0.0 2016-10-25 05:50 UTC

This package is not auto-updated.

Last update: 2019-02-20 19:04:44 UTC


Build Status Coverage Status Scrutinizer Code Quality Code Climate

Module specific doctrine migrations


composer require reddogs-at/reddogs-doctrine-migrations


I recommend Building Modular Applications with Zend Expressive

Create a file ModuleConfig.php in your module source path. (e.g. module/YourModule/src) or add config key reddogs_doctrine_migrations to existing configuration:


namespace YourModule;

class ModuleConfig
    public function __invoke()
        return [
            'doctrine' => [
                'reddogs_doctrine_migrations' => [
                    'your_module' => [
                        'namespace' => 'YourModule',
                        'directory' => dirname(__DIR__) . '/data/migrations',
                        'table_name' => 'your_module_migrations'

Configuration Options

(see section Custom Configuration of Doctrine Migrations documentation)

  • namespace: your module namespace
  • directory: path to migration classes
  • table_name: name of the module migration table


Execute single module migration up or down

  • Simple: /path/to/script.php mogrations:execute <moduleName> [--version=]
  • All paramenters: /path/to/script.php mogrations:execute <moduleName> [--version=] [--write-sql] [--dry-run] [--up] [--down] [--query-time] [--quiet|-q] [--no-interaction|-n] [--verbose|-v|-vv|-vvv]

Generate new blank module migration class

  • Simple: /path/to/script.php mogrations:generate <moduleName>
  • All parameters: mogrations:generate <moduleName> [--quiet|-q] [--no-interaction|-n] [--verbose|-v|-vv|-vvv]

Output the latest module migration version number

  • All parameters: /path/to/script.php mogrations:latest <moduleName>

Execute a module migration to a specified version or the latest available version

  • Simple: /path/to/script.php mogrations:migrate <moduleName>
  • All parameters: mogrations:migrate <moduleName> [--version=] [--dry-run] [--write-sql] [--query-time] [--quiet|-q] [--no-interaction|-n] [--verbose|-v|-vv|-vvv]

Migrate all registered module migrations

  • All parameters: mogrations:migrate-all

View the status of a set of module migrations

  • All Parameters: mogrations:status <moduleName>