Files
cms_thermo_active/Step.Database/Migrations/Configuration.cs
T
Lucio Maranta f0a48aa8d5 + Added user info API
+ Added new nc error management
2018-01-11 12:43:28 +01:00

39 lines
1.7 KiB
C#

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<Step.Database.DatabaseContext>
{
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"))
);
}
}
}