Skip to content

Commit 336c57d

Browse files
committed
[DoctrineBundle] Refactoring doctrine:schema:* command descriptions
I found the language to be a bit technical, and therefore not totally obvious what these tasks do to the layman. The language here tries to talk more about "generating/executing SQL" so that people know that these are the commands that handle DB table changes.
1 parent 9e407d7 commit 336c57d

File tree

3 files changed

+33
-14
lines changed

3 files changed

+33
-14
lines changed

src/Symfony/Bundle/DoctrineBundle/Command/Proxy/CreateSchemaDoctrineCommand.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
use Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand;
2020

2121
/**
22-
* Command to create the database schema for a set of classes based on their mappings.
22+
* Command to execute the SQL needed to generate the database schema for
23+
* a given entity manager.
2324
*
2425
* @author Fabien Potencier <fabien@symfony.com>
2526
* @author Jonathan H. Wage <jonwage@gmail.com>
@@ -32,17 +33,21 @@ protected function configure()
3233

3334
$this
3435
->setName('doctrine:schema:create')
36+
->setDescription('Executes (or dumps) the SQL needed to generate the database schema.')
3537
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
3638
->setHelp(<<<EOT
37-
The <info>doctrine:schema:create</info> command creates the default entity
38-
managers schema:
39+
The <info>doctrine:schema:create</info> command executes the SQL needed to
40+
generate the database schema for the default entity manager:
3941
4042
<info>./app/console doctrine:schema:create</info>
4143
42-
You can also optionally specify the name of a entity manager to create the
43-
schema for:
44+
You can also generate the database schema for a specific entity manager:
4445
4546
<info>./app/console doctrine:schema:create --em=default</info>
47+
48+
Finally, instead of executing the SQL, you can output the SQL:
49+
50+
<info>./app/console doctrine:schema:create --dump-sql</info>
4651
EOT
4752
);
4853
}

src/Symfony/Bundle/DoctrineBundle/Command/Proxy/DropSchemaDoctrineCommand.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,17 @@ protected function configure()
3232

3333
$this
3434
->setName('doctrine:schema:drop')
35+
->setDescription('Executes (or dumps) the SQL needed to drop the current database schema.')
3536
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
3637
->setHelp(<<<EOT
37-
The <info>doctrine:schema:drop</info> command drops the default entity
38-
managers schema:
38+
The <info>doctrine:schema:drop</info> command generates the SQL needed to
39+
drop the database schema of the default entity manager:
3940
40-
<info>./app/console doctrine:schema:drop</info>
41+
<info>./app/console doctrine:schema:drop --dump-sql</info>
42+
43+
Alternatively, you can execute the generated queries:
44+
45+
<info>./app/console doctrine:schema:drop --force</info>
4146
4247
You can also optionally specify the name of a entity manager to drop the
4348
schema for:

src/Symfony/Bundle/DoctrineBundle/Command/Proxy/UpdateSchemaDoctrineCommand.php

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
use Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand;
2020

2121
/**
22-
* Command to update the database schema for a set of classes based on their mappings.
22+
* Command to generate the SQL needed to update the database schema to match
23+
* the current mapping information.
2324
*
2425
* @author Fabien Potencier <fabien@symfony.com>
2526
* @author Jonathan H. Wage <jonwage@gmail.com>
@@ -32,15 +33,23 @@ protected function configure()
3233

3334
$this
3435
->setName('doctrine:schema:update')
36+
->setDescription('Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata.')
3537
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
3638
->setHelp(<<<EOT
37-
The <info>doctrine:schema:update</info> command updates the default entity
38-
managers schema:
39+
The <info>doctrine:schema:update</info> command generates the SQL needed to
40+
synchronize the database schema with the current mapping metadata of the
41+
default entity manager.
3942
40-
<info>./app/console doctrine:schema:update</info>
43+
For example, if you add metadata for a new column to an entity, this command
44+
would generate and output the SQL needed to add the new column to the database:
4145
42-
You can also optionally specify the name of a entity manager to update the
43-
schema for:
46+
<info>./app/console doctrine:schema:update --dump-sql</info>
47+
48+
Alternatively, you can execute the generated queries:
49+
50+
<info>./app/console doctrine:schema:update --force</info>
51+
52+
You can also update the database schema for a specific entity manager:
4453
4554
<info>./app/console doctrine:schema:update --em=default</info>
4655
EOT

0 commit comments

Comments
 (0)