eloquent-driver icon indicating copy to clipboard operation
eloquent-driver copied to clipboard

Uuid model database migration does not place unique constraint on id column

Open Ririshi opened this issue 4 years ago • 0 comments

As the title says. Ironically enough, the migration does not make the first id column unique, which means multiple entries could exist with the same Uuid. In most cases, that wouldn't be an issue as the same Uuid wouldn't be generated twice, but I stumbled upon it while browsing the database in phpMyAdmin. The following warning is shown there: image I cannot edit any entries directly in the database browser, because there is no single column uniquely identifying the entry.

Simple fix would be to add ->primary(); at the end of the id column definition in the UuidEntryModel migration, although that will not fix existing installations.

Ririshi avatar Nov 09 '21 11:11 Ririshi