Skip to content

Commit f9b4c06

Browse files
authored
Add new doctrine current command (#317)
* add new doctrine current command * use migrations master
1 parent 1946f9a commit f9b4c06

File tree

5 files changed

+36
-24
lines changed

5 files changed

+36
-24
lines changed

Resources/config/services.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@
5252
<tag name="console.command" command="doctrine:migrations:list" />
5353
</service>
5454

55+
<service id="doctrine_migrations.current_command" class="Doctrine\Migrations\Tools\Console\Command\CurrentCommand">
56+
57+
<argument type="service" id="doctrine.migrations.dependency_factory"/>
58+
<argument>doctrine:migrations:current</argument>
59+
60+
<tag name="console.command" command="doctrine:migrations:current"/>
61+
</service>
62+
5563
<service id="doctrine_migrations.dump_schema_command" class="Doctrine\Migrations\Tools\Console\Command\DumpSchemaCommand">
5664

5765
<argument type="service" id="doctrine.migrations.dependency_factory"/>

Resources/doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ All of the migrations functionality is contained in a few console commands:
9595
.. code-block:: terminal
9696
9797
doctrine
98+
doctrine:migrations:current [current] Outputs the current version.
9899
doctrine:migrations:diff [diff] Generate a migration by comparing your current database to your mapping information.
99100
doctrine:migrations:dump-schema [dump-schema] Dump the schema for your database to a migration.
100101
doctrine:migrations:execute [execute] Execute a single migration version up or down manually.

Tests/DependencyInjection/DoctrineCommandsTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Doctrine\Bundle\MigrationsBundle\DependencyInjection\CompilerPass\ConfigureDependencyFactoryPass;
88
use Doctrine\Bundle\MigrationsBundle\DependencyInjection\DoctrineMigrationsExtension;
9+
use Doctrine\Migrations\Tools\Console\Command\CurrentCommand;
910
use Doctrine\Migrations\Tools\Console\Command\DiffCommand;
1011
use Doctrine\Migrations\Tools\Console\Command\DumpSchemaCommand;
1112
use Doctrine\Migrations\Tools\Console\Command\ExecuteCommand;
@@ -47,6 +48,7 @@ public function getCommands() : array
4748
{
4849
return [
4950
['doctrine:migrations:diff', DiffCommand::class],
51+
['doctrine:migrations:current', CurrentCommand::class],
5052
['doctrine:migrations:dump-schema', DumpSchemaCommand::class],
5153
['doctrine:migrations:execute', ExecuteCommand::class],
5254
['doctrine:migrations:generate', GenerateCommand::class],

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"php": "^7.2",
2424
"symfony/framework-bundle": "~3.4|~4.0|~5.0",
2525
"doctrine/doctrine-bundle": "~1.0|~2.0",
26-
"doctrine/migrations": "^3.0@dev"
26+
"doctrine/migrations": "dev-master"
2727
},
2828
"require-dev": {
2929
"phpunit/phpunit": "^6.4|^7.0",

composer.lock

Lines changed: 24 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)