title: Should the primary key of my MySQL database change when I update my row?
body: <p>I have a spring boot website project I am working on and I've created a react.js app for the front end. When I submit a PUT command from the app and change the column "position", my primary key updates along with the row to a new unique value. Is this the way PUT operations should work or did I build my backend API incorrectly? Here is the code for the Restful API:</p>
  
  <pre class="lang-java prettyprint-override"><code>// Update @CrossOrigin(origins = "http://localhost:3000") @RequestMapping(value = "/images/{id}", method = RequestMethod.PUT) public ResponseEntity
  &lt;Object&gt; updateImage(@PathVariable("id") Long id, @RequestBody ImageModel image) {
          imageRepository.deleteById(id);
          image.setId(id);
          imageRepository.save(image);
          return new ResponseEntity&lt;&gt;("Image is updated successsfully", HttpStatus.OK);
      }
  </code></pre>
  
  <p>Just want to make sure I didn't make anything that would break my database later on.</p>