Problem with mapper #5657

Open
opened 2026-01-22 15:13:56 +01:00 by admin · 9 comments
Owner

Originally created by @tasselchof on GitHub (Aug 29, 2017).

Hello!

Somehow mapper is duplicating queries on orm:schema-tool:update --dump-sql command with latest PostgreSQL.

I have repeatedly for each jsonb field queries:

ALTER TABLE table ALTER jsonb TYPE JSONB;
ALTER TABLE table ALTER jsonb DROP DEFAULT;

Originally created by @tasselchof on GitHub (Aug 29, 2017). Hello! Somehow mapper is duplicating queries on orm:schema-tool:update --dump-sql command with latest PostgreSQL. I have repeatedly for each jsonb field queries: ALTER TABLE table ALTER jsonb TYPE JSONB; ALTER TABLE table ALTER jsonb DROP DEFAULT;
Author
Owner

@lcobucci commented on GitHub (Aug 29, 2017):

@tasselchof can it be somehow related to https://github.com/doctrine/dbal/pull/2782#issuecomment-322246167? If so, we should keep it only on dbal.

I haven't had the time to take a look on the options (rather than just reverting that specific commit) but if would be really nice to have some help over there.

@lcobucci commented on GitHub (Aug 29, 2017): @tasselchof can it be somehow related to https://github.com/doctrine/dbal/pull/2782#issuecomment-322246167? If so, we should keep it only on dbal. I haven't had the time to take a look on the options (rather than just reverting that specific commit) but if would be really nice to have some help over there.
Author
Owner

@stof commented on GitHub (Sep 7, 2017):

@lcobucci this is indeed the DBAL issue.

@stof commented on GitHub (Sep 7, 2017): @lcobucci this is indeed the DBAL issue.
Author
Owner

@lcobucci commented on GitHub (Sep 7, 2017):

@stof thanks! I'm in Brazil right now and am not really being able to work on this but I'll go back home in this weekend 😉

@lcobucci commented on GitHub (Sep 7, 2017): @stof thanks! I'm in Brazil right now and am not really being able to work on this but I'll go back home in this weekend :wink:
Author
Owner

@lcobucci commented on GitHub (Sep 11, 2017):

@tasselchof being fixed on https://github.com/doctrine/dbal/pull/2855

@lcobucci commented on GitHub (Sep 11, 2017): @tasselchof being fixed on https://github.com/doctrine/dbal/pull/2855
Author
Owner

@tasselchof commented on GitHub (Sep 14, 2017):

The same thing happening with indexes with cases:

DROP INDEX si_type_unique_idx;
CREATE UNIQUE INDEX si_type_unique_idx ON storage_items (warehouse_id, sku) WHERE state IS NOT NULL AND state = 'unique';

@tasselchof commented on GitHub (Sep 14, 2017): The same thing happening with indexes with cases: DROP INDEX si_type_unique_idx; CREATE UNIQUE INDEX si_type_unique_idx ON storage_items (warehouse_id, sku) WHERE state IS NOT NULL AND state = 'unique';
Author
Owner

@lcobucci commented on GitHub (Nov 19, 2017):

@tasselchof https://github.com/doctrine/dbal/releases/tag/v2.6.3 has just been released, can you please check if things are working fine now?

@lcobucci commented on GitHub (Nov 19, 2017): @tasselchof https://github.com/doctrine/dbal/releases/tag/v2.6.3 has just been released, can you please check if things are working fine now?
Author
Owner

@tasselchof commented on GitHub (Nov 19, 2017):

Yes, I saw this, but it didn't helped, still:

DROP INDEX si_type_unique_idx;
CREATE UNIQUE INDEX si_type_unique_idx ON storage_items (warehouse_id, sku) WHERE state IS NOT NULL AND state = 'unique';

@tasselchof commented on GitHub (Nov 19, 2017): Yes, I saw this, but it didn't helped, still: DROP INDEX si_type_unique_idx; CREATE UNIQUE INDEX si_type_unique_idx ON storage_items (warehouse_id, sku) WHERE state IS NOT NULL AND state = 'unique';
Author
Owner

@lcobucci commented on GitHub (Nov 19, 2017):

@tasselchof humm, can you try to submit a PR on DBAL with a test that reproduces it? You can use this as example:

8c1e513693/tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php (L1206-L1336)

@lcobucci commented on GitHub (Nov 19, 2017): @tasselchof humm, can you try to submit a PR on DBAL with a test that reproduces it? You can use this as example: https://github.com/doctrine/dbal/blob/8c1e5136939311121d1e1f75d2f6bcd4ec9e5862/tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php#L1206-L1336
Author
Owner

@tasselchof commented on GitHub (Nov 19, 2017):

I'll do it in the middle of the week.

Actually, I opened an issue about indexes here: https://github.com/doctrine/dbal/issues/2913.

This one was at first place about jsonb field, which is ok now.

@tasselchof commented on GitHub (Nov 19, 2017): I'll do it in the middle of the week. Actually, I opened an issue about indexes here: https://github.com/doctrine/dbal/issues/2913. This one was at first place about jsonb field, which is ok now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5657