Skip to content

Commit 6b16944

Browse files
committed
minor #17299 [Doctrine] Restore tip regarding schema filtering during migrations (natewiebe13)
This PR was merged into the 5.4 branch. Discussion ---------- [Doctrine] Restore tip regarding schema filtering during migrations Restores the tip regarding how to disable doctrine from trying to remove messages table when creating a migration. I couldn't pinpoint exactly why the tip was removed, and looking at symfony/symfony#37626 they were unsure here as well. Commits ------- 54fa0bf Restore tip regarding schema filtering during migrations
2 parents 6d5ab31 + 54fa0bf commit 6b16944

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

messenger.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,6 +1450,36 @@ a table named ``messenger_messages``.
14501450
Or, to create the table yourself, set the ``auto_setup`` option to ``false`` and
14511451
:ref:`generate a migration <doctrine-creating-the-database-tables-schema>`.
14521452

1453+
.. tip::
1454+
1455+
To avoid tools like Doctrine Migrations from trying to remove this table because
1456+
it's not part of your normal schema, you can set the ``schema_filter`` option:
1457+
1458+
.. configuration-block::
1459+
1460+
.. code-block:: yaml
1461+
1462+
# config/packages/doctrine.yaml
1463+
doctrine:
1464+
dbal:
1465+
schema_filter: '~^(?!messenger_messages)~'
1466+
1467+
.. code-block:: xml
1468+
1469+
# config/packages/doctrine.xml
1470+
<doctrine:dbal schema-filter="~^(?!messenger_messages)~"/>
1471+
1472+
.. code-block:: php
1473+
1474+
# config/packages/doctrine.php
1475+
$container->loadFromExtension('doctrine', [
1476+
'dbal' => [
1477+
'schema_filter' => '~^(?!messenger_messages)~',
1478+
// ...
1479+
],
1480+
// ...
1481+
]);
1482+
14531483
.. caution::
14541484

14551485
The datetime property of the messages stored in the database uses the

0 commit comments

Comments
 (0)