php-enqueue / enqueue-dev

Message Queue, Job Queue, Broadcasting, WebSockets packages for PHP, Symfony, Laravel, Magento. DEVELOPMENT REPOSITORY - provided by Forma-Pro
https://enqueue.forma-pro.com/
MIT License
2.17k stars 430 forks source link

Replaced `json_array` with `json` due to Doctrine Dbal 3.0 #1294

Closed NovakHonza closed 1 year ago

NovakHonza commented 1 year ago

This should be a fix for #1293

makasim commented 1 year ago

Is it backward compatible ?

Steveb-p commented 1 year ago

Is it backward compatible ?

Doctrine team recommended this change for years, and both types are present in dbal 2.x.

NovakHonza commented 1 year ago

As I think about it, there might be a need for migration for existing installations? Because of the need to change the comment on the data column (DC2Type:json_array) to (DC2Type:json)?

Steveb-p commented 1 year ago

As I think about it, there might be a need for migration for existing installations? Because of the need to change the comment on the data column (DC2Type:json_array) to (DC2Type:json)?

Comment on column type is not used by Doctrine ORM code itself. It is generated so that reverse-engineering tools can properly recover schema in cases where a custom type (like json or json_array) is used.

See https://symfony.com/doc/6.3/doctrine/reverse_engineering.html

The doctrine:mapping:import command used to generate Doctrine entities from existing databases was deprecated by Doctrine in 2019 and there's no replacement for it.

See https://www.doctrine-project.org/projects/doctrine-orm/en/2.14/reference/tools.html#reverse-engineering

Reverse Engineering is a one-time process that can get you started with a project. Converting an existing database schema into mapping files only detects about 70-80% of the necessary mapping information. Additionally the detection from an existing database cannot detect inverse associations, inheritance types, entities with foreign keys as primary keys and many of the semantical operations on associations such as cascade.