Fork me on GitHub

Integration with Nette

Nextras Migrations ship with Nette DI extension and Symfony Console commands. Usage of Symfony Console is optional but recommended and can be integrated with Nette through Contributte Console.

Basic Configuration#

extensions:
    console: Contributte\Console\DI\ConsoleExtension(%consoleMode%)
    migrations: Nextras\Migrations\Bridges\NetteDI\MigrationsExtension

migrations:
    dir: %appDir%/../migrations # migrations base directory
    driver: pgsql               # pgsql or mysql
    dbal: nextras               # nextras, nette, doctrine or dibi
    withDummyData: %debugMode%

Configuration of Custom Groups#

By default Nextras Migrations define 3 groups located in a directory specified by the dir option:

  • structures (always enabled),
  • basic-data (always enabled) and
  • dummy-data (enabled when the withDummyData option is true).

You can optionally overwrite these default groups with the groups options.

migrations:
    ...
    groups:
        customGroup:
            enabled: true
            directory: %appDir%/../migrations/customGroup
            dependencies: [anotherCustomGroup]
            generator: null
        anotherCustomGroup:
            ...

Usage#

See Symfony Commands.