From 97b0c7d7842ac39a913774b8a3bdca4071c935b9 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 20 Jun 2024 17:55:42 +0200 Subject: [PATCH] Update index.rst: Minor improvements at "Manual Tables" 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 e2fb02b..16716df 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' @@ -314,6 +316,7 @@ for Doctrine's ORM: .. code-block:: php-annotations // src/Entity/User.php + namespace App\Entity; use Doctrine\ORM\Mapping as ORM; @@ -339,6 +342,7 @@ for Doctrine's ORM: .. code-block:: yaml # config/doctrine/User.orm.yaml + App\Entity\User: type: entity table: user @@ -355,6 +359,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.