You are browsing documentation for a version that has not yet been released.
Edit

Custom Integration

If you don't want to use the ./vendor/bin/doctrine-migrations script that comes with the project, you can always setup your own custom integration.

In the root of your project, create a file named migrations and make it executable:

$ chmod +x migrations

Now place the following code in the migrations file:

1#!/usr/bin/env php <?php require_once __DIR__.'/vendor/autoload.php'; use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper; use Doctrine\Migrations\Tools\Console\Command; use Symfony\Component\Console\Application; use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Helper\QuestionHelper; $dbParams = [ 'dbname' => 'migrations_test', 'user' => 'root', 'password' => '', 'host' => 'localhost', 'driver' => 'pdo_mysql', ]; $connection = DriverManager::getConnection($dbParams); $helperSet = new HelperSet(); $helperSet->set(new QuestionHelper(), 'question'); $helperSet->set(new ConnectionHelper($connection), 'db'); $cli = new Application('Doctrine Migrations'); $cli->setCatchExceptions(true); $cli->setHelperSet($helperSet); $cli->addCommands(array( new Command\DumpSchemaCommand(), new Command\ExecuteCommand(), new Command\GenerateCommand(), new Command\LatestCommand(), new Command\MigrateCommand(), new Command\RollupCommand(), new Command\StatusCommand(), new Command\VersionCommand() )); $cli->run();
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

Now you can execute the migrations console application like this:

$ ./migrations