namespace Step.Database.Migrations { using Step.Database.Controllers; using Step.Model.DatabaseModels; using System; using System.Data.Entity; using System.Data.Entity.Migrations; using System.Globalization; using System.Linq; public sealed class Configuration : DbMigrationsConfiguration { public Configuration() { AutomaticMigrationsEnabled = true; } protected override void Seed(DatabaseContext context) { // This method will be called after migrating to the latest version. context.Roles.AddOrUpdate( new RoleModel() { RoleId = 1, Level = 10, Name = "Admin" }, new RoleModel() { RoleId = 2, Level = 1, Name = "Guest" } ); context.FunctionsAccess.AddOrUpdate( new FunctionAccessModel() { FunctionAccessId = 1, Name = "test", Area = "production", Enabled = true, WriteLevelMin = 7, ReadLevelMin = 1 }, new FunctionAccessModel() { FunctionAccessId = 2, Name = "userData", Area = "production", Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1 }, new FunctionAccessModel() { FunctionAccessId = 3, Name = "ncData", Area = "production", Enabled = true, WriteLevelMin = 100, ReadLevelMin = 1 }, new FunctionAccessModel() { FunctionAccessId = 4, Name = "functionAccess", Area = "production", Enabled = true, WriteLevelMin = 100, ReadLevelMin = 1 } ); context.Users.AddOrUpdate ( UsersController.CreateUserModel(1, "cms", "cms", "cms", "cms", 1, new CultureInfo("en")) ); } } }