A
A
Alexey Sklyarov2019-01-22 18:35:56
Laravel
Alexey Sklyarov, 2019-01-22 18:35:56

How, after deleting data from a table, set new IDs for records and update auto increment?

There is a table that receives data every minute, I created a service with methods for cleaning various tables according to conditions, and the following task arose: when deleting, I have about 1.5k records left, I want to update the ID of these records starting from 1, and then set auto increment equal to (number of records + 1), are there any tools for this? And do I really need an idea? The task is caused by the fear of overflowing the record ID after a certain period of time.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Wells, 2019-01-22
@0example

No, you don't need to update anything. If you have millions of records per day in one table, use uuid.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question