Skip to content

Commit 94a42de

Browse files
thePanzgreg0ire
andcommitted
Mention the server-version for migrations
Mention to specify the server-version to avoid issues with the doctrine:migrations:migrate command. Co-authored-by: Grégoire Paris <[email protected]>
1 parent 52e3b82 commit 94a42de

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Resources/doc/index.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,23 @@ This ignores the tables, and any named objects such as sequences, on the DBAL le
436436
Note that if you have multiple connections configured then the ``schema_filter`` configuration
437437
will need to be placed per-connection.
438438

439+
Troubleshooting out of sync metadata storage issue
440+
--------------------------------------------------
441+
``doctrine/migrations`` relies on a properly configured Database server version in the connection string to manage the table storing the
442+
migrations, also known as the metadata storage.
443+
444+
If you encounter the error ``The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue.``
445+
when running the command ``doctrine:migrations:migrate`` or the suggested command itself ``doctrine:migrations:sync-metadata-storage`` please
446+
check the database connection string, and make sure that the proper server version is defined. If you are running a MariaDB database,
447+
you should prefix the server version with ``mariadb-`` (ex: ``mariadb-10.2.12``). See the `configuring_database`_ section.
448+
449+
Example connection string for MariaDB:
450+
451+
.. code-block:: terminal
452+
DATABASE_URL=mysql://root:@127.0.0.1:3306/testtest?serverVersion=mariadb-10.4.11
453+
439454
.. _documentation: https://www.doctrine-project.org/projects/doctrine-migrations/en/current/index.html
455+
.. _configuring_database: https://symfony.com/doc/current/doctrine.html#configuring-the-database
440456
.. _DoctrineMigrationsBundle: https://github.com/doctrine/DoctrineMigrationsBundle
441457
.. _`Doctrine Database Migrations`: https://github.com/doctrine/migrations
442458
.. _`Symfony Flex`: https://symfony.com/doc/current/setup/flex.html

0 commit comments

Comments
 (0)