You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After installing symfony/lock and configuring it with DoctrineDbalStore, I noticed that invoking doctrine:migrations:diff command would generate a migration issuing a DROP of the autogenerated lock_keys table.
After investigating, I found out the issue is line 33 of the listener. The $stores property receives a RewindableGenerator, which is then passed directly to an ArrayIterator. This produces an invalid iterator, skipping the whole following while loop.
How to reproduce
Configure symfony/lock with a DoctrineDbalStore.
Generate the lock_keys table, either by using the LockFactory or by any other means mentioned in the docs.
Run the doctrine:migrations:diff command.
See that the the schema for the table is not properly configured, resulting in a migration instead of the expected No changes detected in your mapping information. message.
Possible Solution
Since the $stores property is already typed as iterable, it would seem replacing the loop with a foreach iterating directly on the property would be the best solution.
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Symfony version(s) affected
6.4.4
Description
After installing
symfony/lock
and configuring it withDoctrineDbalStore
, I noticed that invokingdoctrine:migrations:diff
command would generate a migration issuing aDROP
of the autogeneratedlock_keys
table.After investigating, I found out the issue is line 33 of the listener. The
$stores
property receives aRewindableGenerator
, which is then passed directly to anArrayIterator
. This produces an invalid iterator, skipping the whole followingwhile
loop.How to reproduce
symfony/lock
with aDoctrineDbalStore
.lock_keys
table, either by using theLockFactory
or by any other means mentioned in the docs.doctrine:migrations:diff
command.No changes detected in your mapping information.
message.Possible Solution
Since the
$stores
property is already typed asiterable
, it would seem replacing the loop with aforeach
iterating directly on the property would be the best solution.Additional Context
No response
The text was updated successfully, but these errors were encountered: