HomerGaidarski / urlsauce

A web application developed with Laravel 5.4 that creates shortened urls.
0 stars 0 forks source link

deleting urls #16

Open HomerGaidarski opened 7 years ago

HomerGaidarski commented 7 years ago

when a url entry is deleted in the database, the autoincrement does not adjust, so if there are 50 urls created, and i delete urls 49 and 50, instead of the autoincrement starting at 49 it goes to 51.

HomerGaidarski commented 6 years ago

Technically the autoincrement shouldn't adjust because if you delete any entries before the most recent entry, and reset the autoincrement, you will later be overwriting existing urls. Don't adjust the autoincrement, instead if really want to be able to delete entries and repurpose those short links, add them to some queue which will allow newly created urls to get applied to the short links from the queue until the queue runs out, then return to creating short links with new db entries.