gstt / laravel-achievements

Achievements for Laravel 5.3+
MIT License
296 stars 37 forks source link

uuid on progress_details table #16

Closed ghost closed 6 years ago

ghost commented 7 years ago

Hi

Im trying to understand why the id of table achievement_progress uses a unique identifier:

Uuid::uuid4()->toString();

Wouldnt a regular incremented integer suffice?

Thanks

gabs-simon commented 7 years ago

Hi!

A regular incremented integer would indeed suffice, but choosing uuid was a design decision in order to make the implementation similar to Laravel Notifications.

ghost commented 7 years ago

Thanks Gabriel-simonetti!

I guess it makes sense when achievements/notifications are removed from the folder while simultaneously updating the database. Eventually regular incremented integers from the progress table might mistakenly point to to the new achievement id in the details table of which the id formerly belonged to the removed achievement.

Great work. Thanks ever so much!