<commit_before>using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Reflection;
using EventFeedback.Domain.Membership;
using System.Linq;

namespace EventFeedback.Domain.Migrations
{
    using System;
    using System.Data.Entity.Migrations;

    internal sealed class Configuration : DbMigrationsConfiguration<DataContext>
    {
        private readonly TraceSource _traceSource = new TraceSource(Assembly.GetExecutingAssembly().GetName().Name);

        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
            AutomaticMigrationDataLossAllowed = false;
        }

        /// <summary>
        /// Seeds the specified context.
        /// This method will be called after migrating to the latest version.
        /// </summary>
        /// <param name="context">The context.</param>
        protected override void Seed(DataContext context)
        {
            _traceSource.TraceInformation("seeding database");

            context.UserProfiles.AddOrUpdate(
                p => p.UserName,
                new UserProfile
                    {
                        UserName = "admin", // 1
                        Active = true
                    },
                new UserProfile
                    {
                        UserName = "user", // 2
                        Active = true
                    });
            context.Users.AddOrUpdate(
                p => p.Id,
                new User
                    {
                        Id = 1, // admin
                        CreateDate = DateTime.Now,
                        Password = "<PASSWORD>==", // admin
                        IsConfirmed = true,
                        PasswordFailuresSinceLastSuccess = 0,
                        Roles = new Collection<Role>
                            {
                                new Role
                                    {
                                        Active = true,
                                        RoleName = "Administrator"
                                    }
                            }
                    },
                new User
                    {
                        Id = 2, // user
                        CreateDate = DateTime.Now,
                        Password = "<PASSWORD>==", // admin
                        IsConfirmed = true,
                        PasswordFailuresSinceLastSuccess = 0
                    });
            context.UserRoles.AddOrUpdate(p => p.UserId, new UserRole{UserId = 1, RoleId = 1}); // admin Administrator role

            if(!context.ResourceTexts.Any())
            {
                context.ResourceTexts.AddOrUpdate(
                    p => p.Key,
                    new ResourceText {Key = "Title_Home", Value = "Home", Language = "en-US"},
                    new ResourceText {Key = "Title_About", Value = "About", Language = "en-US"},
                    new ResourceText {Key = "Title_Events", Value = "Events", Language = "en-US"},
                    new ResourceText {Key = "Title_Sessions", Value = "Sessions", Language = "en-US"},
                    new ResourceText {Key = "Title_SignIn", Value = "Sign-in", Language = "en-US"},
                    new ResourceText {Key = "Title_Debug", Value = "Debug", Language = "en-US"},
                    new ResourceText {Key = "Title_Home", Value = "Heim", Language = "de-DE"},
                    new ResourceText {Key = "Title_About", Value = "ber", Language = "de-DE"},
                    new ResourceText {Key = "Title_Events", Value = "Veranstaltungen", Language = "de-DE"},
                    new ResourceText {Key = "Title_Sessions", Value = "Sessionen", Language = "de-DE"},
                    new ResourceText {Key = "Title_SignIn", Value = "Einloggen", Language = "de-DE"},
                    new ResourceText { Key = "Title_Debug", Value = "Debug", Language = "de-DE" },
                    new ResourceText { Key = "Question1_Title", Value = "Vortragsstil", Language = "de-DE" },
                    new ResourceText { Key = "Question1_Description", Value = "Dein Kommentar zum Vortragstil und dem Transport von Inhalten", Language = "de-DE" },
                    new ResourceText { Key = "Question2_Title", Value = "Folien", Language = "de-DE" },
                    new ResourceText { Key = "Question2_Description", Value = "Dein Kommentar zu den Folien", Language = "de-DE" },
                    new ResourceText { Key = "Question3_Title", Value = "Transport von Inhalten", Language = "de-DE" },
                    new ResourceText {Key = "Question3_Description", Value = "", Language = "de-DE"},
                    new ResourceText { Key = "Question4_Title", Value = "Dein Kommentar zum Vortragstil und dem Transport von Inhalten", Language = "de-DE" },
                    new ResourceText { Key = "Question5_Title", Value = "Dein Kommentar zu den Folien", Language = "de-DE" },
                    new ResourceText { Key = "Question6_Title", Value = "Dein Kommentar zum Thema", Language = "de-DE" }<commit_msg>resource texts<commit_after>using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Reflection;
using EventFeedback.Domain.Membership;
using System.Linq;

namespace EventFeedback.Domain.Migrations
{
    using System;
    using System.Data.Entity.Migrations;

    internal sealed class Configuration : DbMigrationsConfiguration<DataContext>
    {
        private readonly TraceSource _traceSource = new TraceSource(Assembly.GetExecutingAssembly().GetName().Name);

        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
            AutomaticMigrationDataLossAllowed = false;
        }

        /// <summary>
        /// Seeds the specified context.
        /// This method will be called after migrating to the latest version.
        /// </summary>
        /// <param name="context">The context.</param>
        protected override void Seed(DataContext context)
        {
            _traceSource.TraceInformation("seeding database");

            context.UserProfiles.AddOrUpdate(
                p => p.UserName,
                new UserProfile
                    {
                        UserName = "admin", // 1
                        Active = true
                    },
                new UserProfile
                    {
                        UserName = "user", // 2
                        Active = true
                    });
            context.Users.AddOrUpdate(
                p => p.Id,
                new User
                    {
                        Id = 1, // admin
                        CreateDate = DateTime.Now,
                        Password = "<PASSWORD>==", // <PASSWORD>
                        IsConfirmed = true,
                        PasswordFailuresSinceLastSuccess = 0,
                        Roles = new Collection<Role>
                            {
                                new Role
                                    {
                                        Active = true,
                                        RoleName = "Administrator"
                                    }
                            }
                    },
                new User
                    {
                        Id = 2, // user
                        CreateDate = DateTime.Now,
                        Password = "<PASSWORD>==", // <PASSWORD>
                        IsConfirmed = true,
                        PasswordFailuresSinceLastSuccess = 0
                    });
            context.UserRoles.AddOrUpdate(p => p.UserId, new UserRole{UserId = 1, RoleId = 1}); // admin Administrator role

            if(!context.ResourceTexts.Any())
            {
                context.ResourceTexts.AddOrUpdate(
                    p => p.Key,
                    new ResourceText {Key = "Title_Home", Value = "Home", Language = "en-US"},
                    new ResourceText {Key = "Title_About", Value = "About", Language = "en-US"},
                    new ResourceText {Key = "Title_Events", Value = "Events", Language = "en-US"},
                    new ResourceText {Key = "Title_Sessions", Value = "Sessions", Language = "en-US"},
                    new ResourceText {Key = "Title_SignIn", Value = "Sign-in", Language = "en-US"},
                    new ResourceText {Key = "Title_Debug", Value = "Debug", Language = "en-US"},
                    new ResourceText {Key = "Title_Home", Value = "Home", Language = "de-DE"},
                    new ResourceText {Key = "Title_About", Value = "ber", Language = "de-DE"},
                    new ResourceText {Key = "Title_Events", Value = "Veranstaltungen", Language = "de-DE"},
                    new ResourceText {Key = "Title_Sessions", Value = "Sessions", Language = "de-DE"},
                    new ResourceText {Key = "Title_SignIn", Value = "Einloggen", Language = "de-DE"},
                    new ResourceText { Key = "Title_Debug", Value = "Debug", Language = "de-DE" },
                    new ResourceText { Key = "Question1_Title", Value = "Vortragsstil", Language = "de-DE" },
                    new ResourceText { Key = "Question1_Description", Value = "Dein Kommentar zum Vortragstil und dem Transport von Inhalten", Language = "de-DE" },
                    new ResourceText { Key = "Question2_Title", Value = "Folien", Language = "de-DE" },
                    new ResourceText { Key = "Question2_Description", Value = "Dein Kommentar zu den Folien", Language = "de-DE" },
                    new ResourceText { Key = "Question3_Title", Value = "Transport von Inhalten", Language = "de-DE" },
                    new ResourceText {Key = "Question3_Description", Value = "", Language = "de-DE"},
                    new ResourceText { Key = "Question4_Title", Value = "Dein Kommentar zum Vortragstil und dem Transport von Inhalten", Language = "de-DE" },
                    new ResourceText { Key = "Question5_Title", Value = "Dein Kommentar zu den Folien", Language = "de-DE" },
                    new ResourceText { Key = "Question6_Title", Value = "Dein Kommentar zum Thema", Language = "de-DE" }
{'fraction_non_alphanumeric': 0.10425699645250296, 'fraction_numerical': 0.0033504138746551044, 'mean_word_length': 1.4490830115830116, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7466780', 'n_tokens_mistral': 2509, 'n_tokens_neox': 2372, 'n_words': 655}