<commit_before>namespace SpeedHero.Data.Migrations
{
    using System.Data.Entity.Migrations;
    using System.Linq;

    using Microsoft.AspNet.Identity;
    using Microsoft.AspNet.Identity.EntityFramework;

    using SpeedHero.Common;
    using SpeedHero.Data.Models;

    public sealed class Configuration : DbMigrationsConfiguration<SpeedHeroDbContext>
    {
        public Configuration()
        {
            this.AutomaticMigrationsEnabled = true;

            // TODO: Remove in production
            this.AutomaticMigrationDataLossAllowed = true;
        }

        protected override void Seed(SpeedHeroDbContext context)
        {
            // This method will be called after migrating to the latest version.

            // You can use the DbSet<T>.AddOrUpdate() helper extension method 
            // to avoid creating duplicate seed data. E.g.
            //
            //   context.People.AddOrUpdate(
            //     p => p.FullName,
            //     new Person { FullName = "<NAME>" },
            //     new Person { FullName = "<NAME>" },
            //     new Person { FullName = "<NAME>" }
            //   );

            this.SeedRoles(context);
            this.SeedUsersWithRoles(context);
        }

        protected void SeedRoles(SpeedHeroDbContext context)
        {
            context.Roles.AddOrUpdate(r => r.Name, new IdentityRole(GlobalConstants.AdministratorRoleName));
        }

        protected void SeedUsersWithRoles(SpeedHeroDbContext context)
        {
            var userStore = new UserStore<User>(context);
            var userManager = new UserManager<User>(userStore); // to access user table but in different way than context

            if (!context.Users.Any(u => u.UserName == "<EMAIL>"))
            {
                var user = new User { UserName = "<EMAIL>", Email = "<EMAIL>" };
                userManager.Create(user, "123456");
                userManager.AddToRole(user.Id, GlobalConstants.AdministratorRoleName);
            }
        }
    }
}<commit_msg>New username for administrator in seed method<commit_after>namespace SpeedHero.Data.Migrations
{
    using System.Data.Entity.Migrations;
    using System.Linq;

    using Microsoft.AspNet.Identity;
    using Microsoft.AspNet.Identity.EntityFramework;

    using SpeedHero.Common;
    using SpeedHero.Data.Models;

    public sealed class Configuration : DbMigrationsConfiguration<SpeedHeroDbContext>
    {
        public Configuration()
        {
            this.AutomaticMigrationsEnabled = true;

            // TODO: Remove in production
            this.AutomaticMigrationDataLossAllowed = true;
        }

        protected override void Seed(SpeedHeroDbContext context)
        {
            // This method will be called after migrating to the latest version.

            // You can use the DbSet<T>.AddOrUpdate() helper extension method 
            // to avoid creating duplicate seed data. E.g.
            //
            //   context.People.AddOrUpdate(
            //     p => p.FullName,
            //     new Person { FullName = "<NAME>" },
            //     new Person { FullName = "<NAME>" },
            //     new Person { FullName = "<NAME>" }
            //   );

            this.SeedRoles(context);
            this.SeedUsersWithRoles(context);
        }

        protected void SeedRoles(SpeedHeroDbContext context)
        {
            context.Roles.AddOrUpdate(r => r.Name, new IdentityRole(GlobalConstants.AdministratorRoleName));
        }

        protected void SeedUsersWithRoles(SpeedHeroDbContext context)
        {
            const string AdminUserName = "admin";
            const string AdminEmail = "<EMAIL>";
            var userStore = new UserStore<User>(context);
            var userManager = new UserManager<User>(userStore); // to access user table but in different way than context

            if (!context.Users.Any(u => u.UserName == AdminUserName))
            {
                var user = new User { UserName = AdminUserName, Email = AdminEmail };
                userManager.Create(user, "123456");
                userManager.AddToRole(user.Id, GlobalConstants.AdministratorRoleName);
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.09315589353612168, 'fraction_numerical': 0.0028517110266159697, 'mean_word_length': 1.9371946964410327, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2647904', 'n_tokens_mistral': 1111, 'n_tokens_neox': 1064, 'n_words': 260}