I am trying an experimental Rails project and destroyed record 3 (ID == 3), so now there is record 1, 2, 4, and 5.
Is there a way to repopulate this table with record ID from 1 to 5? (this is using mysql)
I can use
if Item.exists?(i)
item = Item.find(i)
else
item = Item.new
end
# set some values
item.name = "haha" + i
item.save
Item.new()
is to create new records with new autoincrement record IDs (6 in this case), but what about the ones that were deleted earlier?