A free and open-source book on ZF3 for beginners


13.2. Configuring Migrations

Before you can use migrations, you'll need to provide the configuration describing what database connection to use, in which table to store migration history, where to store migration classes, etc. To do that, add the following lines to your config/autoload/global.php file:

<?php
return [    
    'doctrine' => [        
        // migrations configuration
        'migrations_configuration' => [
            'orm_default' => [
                'directory' => 'data/Migrations',
                'name'      => 'Doctrine Database Migrations',
                'namespace' => 'Migrations',
                'table'     => 'migrations',
            ],
        ],
    ],
    // ...
];

As you can see, we have the doctrine key and its migrations_configuration subkey (line 5). Under this subkey we provide the configuration for migrations:


Top