Yet another one but for Silex 2 !
Add quazardous/silex-migration to your composer.json and register the service.
$app->register(new Quazardous\Silex\Provider\ConsoleServiceProvider, [
'db.migrations.path' => '/path/to/migrations',
]);
You can customize the provider with parameters :
- db.migrations.namespace
- db.migrations.path
- db.migrations.table_name
- db.migrations.name
See tests/console.php for a full working minimum example.
cd demo
touch demo.db
../vendor/bin/doctrine orm:generate-entities entity/
../vendor/bin/doctrine orm:generate-proxies
php ./console.php migrations:diff
php ./console.php migrations:migrate