From 6c8b6f05f838ffd7a6139b2eeb93d91aabaa2ad8 Mon Sep 17 00:00:00 2001
From: Dean Herbert <pe@ppy.sh>
Date: Wed, 8 Jul 2020 15:24:26 +0900
Subject: [PATCH] Fix key bindings switching order at random on consecutive
 "reset to defaults"

---
 osu.Game/Input/KeyBindingStore.cs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/osu.Game/Input/KeyBindingStore.cs b/osu.Game/Input/KeyBindingStore.cs
index 74b3134964..198ab6883d 100644
--- a/osu.Game/Input/KeyBindingStore.cs
+++ b/osu.Game/Input/KeyBindingStore.cs
@@ -55,6 +55,9 @@ namespace osu.Game.Input
                             RulesetID = rulesetId,
                             Variant = variant
                         });
+
+                        // required to ensure stable insert order (https://github.com/dotnet/efcore/issues/11686)
+                        usage.Context.SaveChanges();
                     }
                 }
             }