Replies: 3 comments 8 replies
-
I don’t see how it could happen 🤔 could you provide a reproducer? BTW UUID can be generated client-side, which avoids declaring your identifier nullable, which is better. |
Beta Was this translation helpful? Give feedback.
-
The work-around is to not use the auto-generation in the entity: #[ORM\Id]
#[ORM\Column(type: UuidType::NAME, unique: true)]
private ?Uuid $id = null;
public function __construct()
{
$this->id = Uuid::v7();
} It works fine with no problems. |
Beta Was this translation helpful? Give feedback.
-
Seeing that this impacts many people I spent some time investigating what’s going on. First, using the DoctrineBridge
If you don’t care about those issues, you need to register So, for the final answer: services:
Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator: ~ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
My UUID config is as follows:
./bin/console debug:config framework uid
outputs:My entity has:
The auto-generated entity ID UUIDs are V6, not V7.
If I inspect any of the UUID primary keys in the database with:
./bin/console uuid:inspect 1eea7e0f-d006-64a2-9024-6b5706aaf847
It outputs:
Question
How does one configure the Doctrine Bridge UUID generator to generate V7 UUIDs?
Beta Was this translation helpful? Give feedback.
All reactions