I've got a table with two columns, body and id. The body is a string field and id an auto incrementing integer.
For example:
body | id
test 1
test2 2
hello 3
hi 4
What I'd like to do is understand how to fix any gaps within the auto-increment if a record is deleted. For example if I deleted id 2, I'd like the other id fields to shift. So id 3 becomes id 2, 4 becomes 3, etc. That way my id field is still sequential with no missing numbers.
Does sql offer a method to fixing this problem? I've found conflicting information on this potentially being a bad idea, but having no gaps would make what I'm building much easier to navigate.
Thank you!