title: Delete not working
body: <p>Why can't I remove record from mysql database using <code>.Delete()</code>?</p>
  
  <p>Here is an example:</p>
  
  <pre><code>tx := db.Begin()
  if err := tx.Delete(&amp;User{}, id).Error; err != nil {
    fmt.Print(err)
    tx.Rollback()
  } else {
    fmt.Print("Rows affected: %d", tx.RowsAffected) // Always returns 0
    tx.Commit()
  }
  </code></pre>
  
  <p>Using <code>tx.First(&amp;user, id)</code> works and return user correctly  </p>
  
  <p>I tried:<br>
  <code>tx.Unscoped().Delete(...)</code> also not working<br>
  <code>tx.Exec("delete from users where (id = ?)", id)</code> RowsAffected = 0<br>
  <code>tx.First(&amp;user, id); tx.Delete(&amp;user)</code> not working  </p>
  
  <p>p.s. User with id <code>id</code> exists in database</p>