Error deleting badge

I guess this is another corrupt index issue? The only non-standard plugin is https://github.com/gdpelican/retort.git.

Started DELETE "/admin/badges/118" for 107.77.237.138 at 2020-05-14 16:41:57 +0000
Processing by Admin::BadgesController#destroy as */*
  Parameters: {"id"=>"118"}
  Rendering categories/index.html.erb within layouts/application
  Rendered categories/index.html.erb within layouts/application (Duration: 1.8ms | Allocations: 883)
  Rendered layouts/_head.html.erb (Duration: 1.2ms | Allocations: 220)
  Rendered common/_discourse_stylesheet.html.erb (Duration: 1.3ms | Allocations: 431)
  Rendered application/_header.html.erb (Duration: 0.2ms | Allocations: 63)
Completed 200 OK in 307ms (Views: 17.9ms | ActiveRecord: 0.0ms | Allocations: 69013)
  Rendering topics/show.html.erb within layouts/application
  Rendered topics/show.html.erb within layouts/application (Duration: 2.9ms | Allocations: 1052)
  Rendered layouts/_head.html.erb (Duration: 1.6ms | Allocations: 238)
  Rendered common/_discourse_stylesheet.html.erb (Duration: 2.4ms | Allocations: 474)
  Rendered application/_header.html.erb (Duration: 0.1ms | Allocations: 57)
Completed 200 OK in 465ms (Views: 84.4ms | ActiveRecord: 0.0ms | Allocations: 89326)
Started GET "/manifest.webmanifest" for 209.23.49.27 at 2020-05-14 16:41:57 +0000
Processing by MetadataController#manifest as */*
Completed 200 OK in 7ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 1733)
Completed 500 Internal Server Error in 297ms (ActiveRecord: 0.0ms | Allocations: 16403)
ActiveRecord::InvalidForeignKey (PG::ForeignKeyViolation: ERROR:  update or delete on table "badges" violates foreign key constrai
nt "fk_rails_38ea484ed4" on table "user_profiles"
DETAIL:  Key (id)=(118) is still referenced from table "user_profiles".