diff --git a/src/Ombi.Store/Context/OmbiContext.cs b/src/Ombi.Store/Context/OmbiContext.cs index e93cc89ba..2fdbaa996 100644 --- a/src/Ombi.Store/Context/OmbiContext.cs +++ b/src/Ombi.Store/Context/OmbiContext.cs @@ -120,8 +120,8 @@ namespace Ombi.Store.Context Database.ExecuteSqlCommand("VACUUM;"); // Make sure we have the roles - var roles = Roles.Where(x => x.Name == OmbiRoles.ReceivesNewsletter); - if (!roles.Any()) + var newsletterRole = Roles.Where(x => x.Name == OmbiRoles.ReceivesNewsletter); + if (!newsletterRole.Any()) { Roles.Add(new IdentityRole(OmbiRoles.ReceivesNewsletter) { @@ -129,6 +129,19 @@ namespace Ombi.Store.Context }); SaveChanges(); } + var requestMusicRole = Roles.Where(x => x.Name == OmbiRoles.RequestMusic); + if (!requestMusicRole.Any()) + { + Roles.Add(new IdentityRole(OmbiRoles.RequestMusic) + { + NormalizedName = OmbiRoles.RequestMusic.ToUpper() + }); + Roles.Add(new IdentityRole(OmbiRoles.AutoApproveMusic) + { + NormalizedName = OmbiRoles.AutoApproveMusic.ToUpper() + }); + SaveChanges(); + } // Make sure we have the API User var apiUserExists = Users.Any(x => x.UserName.Equals("Api", StringComparison.CurrentCultureIgnoreCase));