Added function to restore auto_incremented fields