doctrine / migrations

Doctrine Database Migrations Library
https://www.doctrine-project.org/projects/migrations.html
MIT License
4.65k stars 386 forks source link

Error `metadata storage is not up to date` #1367

Closed infastra closed 8 months ago

infastra commented 9 months ago

Bug Report

After creating completely new project with symfony 6.3 and doctrine-bundle, I get the error The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue. after migrating one simple table.

Q A
BC Break perhaps
Version 3.6.0

Summary

In Symfony I created an Entity with four parameters and executed on terminal: symfony console make:migration and migrated the created file.

After that I started a check by using: symfony console doctrine:migrations:status and get the message The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue.. An execution of sync-metadata-storage had no effect. (Relation to error report: #1302)

How to reproduce

Maria-DB: 10.6.15 doctrine/migrations-bundle: 3.2.4 doctrine/migrations: 3.6.0 Symfony: 6.3.5

Expected behavior

It should not report an issue with out-of-sync storage

infastra commented 8 months ago

After playing with some other settings ... I'm using the database via docker compose and symfony-cli. Symfony-cli created the database-url automatically with the following parameters: sslmode = disable and charset = utf8mb4. By adding the serverVersion with mariadb-10.6.15 and using the local environment (.env.local with ./bin/console doctrine:migrations:status) it works. After that I changed the serverVersion to mariadb-10.6.15 in config-file doctrine.yaml and reran with symfony console ..., it works as well.

Doctrine expects the complete server version for the database.