akeneo / pim-community-dev

[Community Development Repository] The open source Product Information Management (PIM)
http://www.akeneo.com
Other
956 stars 517 forks source link

Akeneo 4.0.8 Doctrine:schema:validate fails after update #11718

Open Pacolu opened 4 years ago

Pacolu commented 4 years ago

Hello Akeneo Team,

I am running an Akeneo 4.0.8 with Mysql 8.0.19 and a PHP Image, using your PHP Image akeneo/pim-php-dev:4.0.

I run bin/console doctrine:schema:validate to check, if my cron can start working, because if the result shows, that the Database and the mapping files are in sync. This command however results every time this: [ERROR] The database schema is not in sync with the current mapping file.

If I run bin/console doctrine:schema:update --force --dump-sql it says, it runs 2 SQL queries:

ALTER TABLE pim_catalog_product CHANGE raw_values raw_values JSON NOT NULL;
ALTER TABLE pim_catalog_product_model CHANGE raw_values raw_values JSON NOT NULL;

But even after this command, the next time I run validate, it still tells me, that the database and mapping files are not in sync.

After searching a bit, I found this article, which looks like its about a similar thing: https://github.com/doctrine/orm/issues/3810#issuecomment-162365312

If this would be true, it would probably mean, that Mysql cannot comprehend the json type correctly and tries to change it.

Do you have an idea, what the problem or solution might be?

Thank you very much.

jmleroux commented 4 years ago

Hello @Pacolu ,

It seems that Doctrine doesn't like empty comment, and we fixed it #10599. I'll check why it happens on a fresh install.

grimabe commented 4 years ago

I noticed I have the same issue. I am on 4.0.30. Mysql version 8.0.20

jotalops commented 3 years ago

In another projects with symfony it happens with doctrine and json attributes , not only with akeneo