Skip to content

Commit 54fa0bf

Browse files
committed
Restore tip regarding schema filtering during migrations
1 parent 185d4ca commit 54fa0bf

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
@@ -1439,6 +1439,36 @@ a table named ``messenger_messages``.
14391439
Or, to create the table yourself, set the ``auto_setup`` option to ``false`` and
14401440
:ref:`generate a migration <doctrine-creating-the-database-tables-schema>`.
14411441

1442+
.. tip::
1443+
1444+
To avoid tools like Doctrine Migrations from trying to remove this table because
1445+
it's not part of your normal schema, you can set the ``schema_filter`` option:
1446+
1447+
.. configuration-block::
1448+
1449+
.. code-block:: yaml
1450+
1451+
# config/packages/doctrine.yaml
1452+
doctrine:
1453+
dbal:
1454+
schema_filter: '~^(?!messenger_messages)~'
1455+
1456+
.. code-block:: xml
1457+
1458+
# config/packages/doctrine.xml
1459+
<doctrine:dbal schema-filter="~^(?!messenger_messages)~"/>
1460+
1461+
.. code-block:: php
1462+
1463+
# config/packages/doctrine.php
1464+
$container->loadFromExtension('doctrine', [
1465+
'dbal' => [
1466+
'schema_filter' => '~^(?!messenger_messages)~',
1467+
// ...
1468+
],
1469+
// ...
1470+
]);
1471+
14421472
.. caution::
14431473

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

0 commit comments

Comments
 (0)