From 6ad5ac6740beefb21bc64dde342b85df798b4a3d Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Sun, 12 Jan 2025 15:00:55 +0100 Subject: [PATCH] Update index.rst: Minor improvements at "Manual Tables" (#551) Page: https://symfony.com/bundles/DoctrineMigrationsBundle/current/index.html#manual-tables The most important part is the inclusion of the file path `config/packages/doctrine.yaml`, since it differs from the first code block on that page (`config/packages/doctrine_migrations.yaml`) --- Resources/doc/index.rst | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/Resources/doc/index.rst b/Resources/doc/index.rst index f9a967bd..9e086481 100644 --- a/Resources/doc/index.rst +++ b/Resources/doc/index.rst @@ -24,7 +24,7 @@ If you don't use `Symfony Flex`_, you must enable the bundle manually in the app .. code-block:: php // config/bundles.php - // in older Symfony apps, enable the bundle in app/AppKernel.php + return [ // ... Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], @@ -245,11 +245,13 @@ Here is an example on how to inject the service container into your migrations: .. code-block:: yaml # config/packages/doctrine_migrations.yaml + doctrine_migrations: services: 'Doctrine\Migrations\Version\MigrationFactory': 'App\Migrations\Factory\MigrationFactoryDecorator' # config/services.yaml + services: App\Migrations\Factory\MigrationFactoryDecorator: decorates: 'doctrine.migrations.migrations_factory' @@ -339,6 +341,7 @@ for Doctrine's ORM: .. code-block:: php-annotations // src/Entity/User.php + namespace App\Entity; use Doctrine\ORM\Mapping as ORM; @@ -364,6 +367,7 @@ for Doctrine's ORM: .. code-block:: yaml # config/doctrine/User.orm.yaml + App\Entity\User: type: entity table: user @@ -380,6 +384,7 @@ for Doctrine's ORM: .. code-block:: xml + .. code-block:: php + // config/packages/doctrine.php + $container->loadFromExtension('doctrine', array( - 'dbal' => array( - 'schema_filter' => '~^(?!t_)~', + 'dbal' => [ + 'schema_filter' => '~^(?!t_)~', // Ignore all tables prefixed by `t_` // ... - ), + ], // ... )); -This ignores the tables, and any named objects such as sequences, on the DBAL level and they will be ignored by the diff command. +This ignores the tables, and any named objects such as sequences, on the DBAL level and they will be ignored by the ``diff`` command. Note that if you have multiple connections configured then the ``schema_filter`` configuration will need to be placed per-connection.