|
@@ -19,7 +19,8 @@ use Symfony\Component\Console\Output\Output;
|
|
|
use Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand;
|
|
|
|
|
|
/**
|
|
|
- * Command to update the database schema for a set of classes based on their mappings.
|
|
|
+ * Command to generate the SQL needed to update the database schema to match
|
|
|
+ * the current mapping information.
|
|
|
*
|
|
|
* @author Fabien Potencier <fabien@symfony.com>
|
|
|
* @author Jonathan H. Wage <jonwage@gmail.com>
|
|
@@ -32,15 +33,23 @@ class UpdateSchemaDoctrineCommand extends UpdateCommand
|
|
|
|
|
|
$this
|
|
|
->setName('doctrine:schema:update')
|
|
|
+ ->setDescription('Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata.')
|
|
|
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
|
|
|
->setHelp(<<<EOT
|
|
|
-The <info>doctrine:schema:update</info> command updates the default entity
|
|
|
-managers schema:
|
|
|
+The <info>doctrine:schema:update</info> command generates the SQL needed to
|
|
|
+synchronize the database schema with the current mapping metadata of the
|
|
|
+default entity manager.
|
|
|
|
|
|
-<info>./app/console doctrine:schema:update</info>
|
|
|
+For example, if you add metadata for a new column to an entity, this command
|
|
|
+would generate and output the SQL needed to add the new column to the database:
|
|
|
|
|
|
-You can also optionally specify the name of a entity manager to update the
|
|
|
-schema for:
|
|
|
+<info>./app/console doctrine:schema:update --dump-sql</info>
|
|
|
+
|
|
|
+Alternatively, you can execute the generated queries:
|
|
|
+
|
|
|
+<info>./app/console doctrine:schema:update --force</info>
|
|
|
+
|
|
|
+You can also update the database schema for a specific entity manager:
|
|
|
|
|
|
<info>./app/console doctrine:schema:update --em=default</info>
|
|
|
EOT
|