forked from ddrilling/AsbCloudServer
962d6e15b6
Replace DateTime to DateTimeOffset in models
467 lines
26 KiB
C#
467 lines
26 KiB
C#
using Microsoft.EntityFrameworkCore;
|
||
using System.Collections.Generic;
|
||
|
||
#nullable disable
|
||
|
||
namespace AsbCloudDb.Model
|
||
{
|
||
//Scaffold-DbContext "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True" Npgsql.EntityFrameworkCore.PostgreSQL -OutputDir Model -DataAnnotations
|
||
public partial class AsbCloudDbContext : DbContext, IAsbCloudDbContext
|
||
{
|
||
public virtual DbSet<Cluster> Clusters { get; set; }
|
||
public virtual DbSet<Company> Companies { get; set; }
|
||
public virtual DbSet<Deposit> Deposits { get; set; }
|
||
public virtual DbSet<FileCategory> FileCategories { get; set; }
|
||
public virtual DbSet<FileInfo> Files { get; set; }
|
||
public virtual DbSet<FileMark> FileMarks { get; set; }
|
||
public virtual DbSet<Measure> Measures { get; set; }
|
||
public virtual DbSet<MeasureCategory> MeasureCategories { get; set; }
|
||
public virtual DbSet<ReportProperty> ReportProperties { get; set; }
|
||
public virtual DbSet<SetpointsRequest> SetpointsRequests { get; set; }
|
||
public virtual DbSet<Telemetry> Telemetries { get; set; }
|
||
public virtual DbSet<TelemetryDataSaub> TelemetryDataSaub { get; set; }
|
||
public virtual DbSet<TelemetryDataSpin> TelemetryDataSpin { get; set; }
|
||
public virtual DbSet<TelemetryAnalysis> TelemetryAnalysis { get; set; }
|
||
public virtual DbSet<TelemetryEvent> TelemetryEvents { get; set; }
|
||
public virtual DbSet<TelemetryMessage> TelemetryMessages { get; set; }
|
||
public virtual DbSet<TelemetryUser> TelemetryUsers { get; set; }
|
||
public virtual DbSet<User> Users { get; set; }
|
||
public virtual DbSet<UserRole> UserRoles { get; set; }
|
||
public virtual DbSet<Well> Wells { get; set; }
|
||
public virtual DbSet<WellComposite> WellComposites { get; set; }
|
||
public virtual DbSet<WellOperation> WellOperations { get; set; }
|
||
public virtual DbSet<WellOperationCategory> WellOperationCategories { get; set; }
|
||
public virtual DbSet<WellSectionType> WellSectionTypes { get; set; }
|
||
public virtual DbSet<WellType> WellTypes { get; set; }
|
||
public virtual DbSet<DrillParams> DrillParams { get; set; }
|
||
public virtual DbSet<DrillFlowChart> DrillFlowChart { get; set; }
|
||
public virtual DbSet<RelationUserUserRole> RelationUserUserRoles { get; set; }
|
||
public virtual DbSet<Permission> Permissions { get; set; }
|
||
public virtual DbSet<RelationUserRolePermission> RelationUserRolePermissions { get; set; }
|
||
|
||
//var options = new DbContextOptionsBuilder<AsbCloudDbContext>()
|
||
// .UseNpgsql("Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True")
|
||
// .Options;
|
||
//var context = new AsbCloudDbContext(options);
|
||
|
||
public AsbCloudDbContext() : base()
|
||
{
|
||
Database.Migrate();
|
||
}
|
||
|
||
public AsbCloudDbContext(DbContextOptions<AsbCloudDbContext> options)
|
||
: base(options)
|
||
{
|
||
//Database.SetCommandTimeout(60 * 60 * 2);
|
||
Database.Migrate();
|
||
}
|
||
|
||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||
{
|
||
if (!optionsBuilder.IsConfigured)
|
||
optionsBuilder.UseNpgsql("Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True");
|
||
}
|
||
|
||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||
{
|
||
modelBuilder.HasPostgresExtension("adminpack")
|
||
.HasAnnotation("Relational:Collation", "Russian_Russia.1251");
|
||
|
||
modelBuilder.Entity<Cluster>(entity =>
|
||
{
|
||
entity.HasOne(d => d.Deposit)
|
||
.WithMany(p => p.Clusters)
|
||
.HasForeignKey(d => d.IdDeposit)
|
||
.HasConstraintName("t_cluster_t_deposit_id_fk");
|
||
});
|
||
|
||
modelBuilder.Entity<WellComposite>(entity =>
|
||
{
|
||
entity.HasKey(
|
||
nameof(WellComposite.IdWell),
|
||
nameof(WellComposite.IdWellSrc),
|
||
nameof(WellComposite.IdWellSectionType));
|
||
|
||
entity.HasOne(d => d.Well)
|
||
.WithMany(p => p.WellComposites)
|
||
.HasForeignKey(d => d.IdWell)
|
||
.HasConstraintName("t_well_сomposite_t_well_id_fk");
|
||
|
||
entity.HasOne(d => d.WellSrc)
|
||
.WithMany(p => p.WellCompositeSrcs)
|
||
.HasForeignKey(d => d.IdWellSrc)
|
||
.HasConstraintName("t_well_сomposite_src_t_well_id_fk");
|
||
|
||
entity.HasOne(d => d.WellSectionType)
|
||
.WithMany(p => p.WellComposites)
|
||
.HasForeignKey(d => d.IdWellSectionType)
|
||
.HasConstraintName("t_well_сomposite_t_well_section_type_id_fk");
|
||
});
|
||
|
||
modelBuilder.Entity<TelemetryDataSaub>(entity =>
|
||
{
|
||
entity.HasOne(d => d.Telemetry)
|
||
.WithMany(p => p.DataSaub)
|
||
.HasForeignKey(d => d.IdTelemetry)
|
||
.OnDelete(DeleteBehavior.Cascade)
|
||
.HasConstraintName("t_telemetry_data_saub_t_telemetry_id_fk");
|
||
|
||
entity.HasKey(nameof(ITelemetryData.IdTelemetry), nameof(ITelemetryData.Date));
|
||
});
|
||
|
||
modelBuilder.Entity<TelemetryDataSpin>(entity =>
|
||
{
|
||
entity.HasOne(d => d.Telemetry)
|
||
.WithMany(p => p.DataSpin)
|
||
.HasForeignKey(d => d.IdTelemetry)
|
||
.OnDelete(DeleteBehavior.Cascade)
|
||
.HasConstraintName("t_telemetry_data_spin_t_telemetry_id_fk");
|
||
|
||
entity.HasKey(nameof(ITelemetryData.IdTelemetry), nameof(ITelemetryData.Date));
|
||
});
|
||
|
||
modelBuilder.Entity<TelemetryMessage>(entity =>
|
||
{
|
||
entity.HasOne(d => d.Telemetry)
|
||
.WithMany(p => p.Messages)
|
||
.HasForeignKey(d => d.IdTelemetry)
|
||
.OnDelete(DeleteBehavior.Cascade)
|
||
.HasConstraintName("t_messages_t_telemetry_id_fk");
|
||
});
|
||
|
||
modelBuilder.Entity<TelemetryUser>(entity =>
|
||
{
|
||
entity.HasKey(nameof(TelemetryUser.IdTelemetry), nameof(TelemetryUser.IdUser));
|
||
entity.HasOne(d => d.Telemetry)
|
||
.WithMany(p => p.Users)
|
||
.HasForeignKey(d => d.IdTelemetry)
|
||
.OnDelete(DeleteBehavior.Cascade)
|
||
.HasConstraintName("t_telemetry_user_t_telemetry_id_fk");
|
||
});
|
||
|
||
modelBuilder.Entity<TelemetryAnalysis>(entity =>
|
||
{
|
||
entity.HasOne(d => d.Telemetry)
|
||
.WithMany(p => p.Analysis)
|
||
.HasForeignKey(d => d.IdTelemetry)
|
||
.OnDelete(DeleteBehavior.Cascade)
|
||
.HasConstraintName("t_analysis_t_telemetry_id_fk");
|
||
|
||
entity.HasOne(d => d.Operation)
|
||
.WithMany(p => p.Analysis)
|
||
.HasForeignKey(d => d.IdOperation)
|
||
.OnDelete(DeleteBehavior.SetNull)
|
||
.HasConstraintName("t_analysis_t_operation_id_fk");
|
||
});
|
||
|
||
modelBuilder.Entity<TelemetryEvent>(entity =>
|
||
{
|
||
entity.HasKey(nameof(TelemetryEvent.IdTelemetry), nameof(TelemetryEvent.IdEvent));
|
||
entity.HasOne(d => d.Telemetry)
|
||
.WithMany(p => p.Events)
|
||
.HasForeignKey(d => d.IdTelemetry)
|
||
.OnDelete(DeleteBehavior.Cascade)
|
||
.HasConstraintName("t_event_t_telemetry_id_fk");
|
||
});
|
||
|
||
modelBuilder.Entity<User>(entity =>
|
||
{
|
||
entity.HasOne(d => d.Company)
|
||
.WithMany(p => p.Users)
|
||
.HasForeignKey(d => d.IdCompany)
|
||
.OnDelete(DeleteBehavior.SetNull)
|
||
.HasConstraintName("t_user_t_company_id_fk");
|
||
|
||
entity.HasIndex(d => d.Login)
|
||
.IsUnique();
|
||
});
|
||
|
||
modelBuilder.Entity<Well>(entity =>
|
||
{
|
||
entity.HasOne(d => d.Cluster)
|
||
.WithMany(p => p.Wells)
|
||
.HasForeignKey(d => d.IdCluster)
|
||
.HasConstraintName("t_well_t_cluster_id_fk");
|
||
|
||
entity.HasOne(d => d.Telemetry)
|
||
.WithOne(p => p.Well)
|
||
.HasForeignKey<Well>(d => d.IdTelemetry)
|
||
.OnDelete(DeleteBehavior.SetNull)
|
||
.HasConstraintName("t_well_t_telemetry_id_fk");
|
||
});
|
||
|
||
modelBuilder.Entity<RelationCompanyWell>(entity =>
|
||
{
|
||
entity.HasKey(nameof(RelationCompanyWell.IdCompany), nameof(RelationCompanyWell.IdWell));
|
||
|
||
entity.HasOne(r => r.Well)
|
||
.WithMany(w => w.RelationCompaniesWells)
|
||
.HasForeignKey(r => r.IdWell)
|
||
.HasConstraintName("t_relation_company_well_t_well_id_fk");
|
||
|
||
entity.HasOne(r => r.Company)
|
||
.WithMany(w => w.RelationCompaniesWells)
|
||
.HasForeignKey(r => r.IdCompany)
|
||
.HasConstraintName("t_relation_company_well_t_company_id_fk");
|
||
});
|
||
|
||
modelBuilder.Entity<WellOperation>(entity =>
|
||
{
|
||
entity.HasIndex(d => d.DepthEnd);
|
||
entity.HasIndex(d => d.DateStart);
|
||
});
|
||
|
||
modelBuilder.Entity<DrillParams>(entity =>
|
||
{
|
||
entity.HasOne(r => r.WellSectionType)
|
||
.WithMany(w => w.DrillParamsCollection)
|
||
.HasForeignKey(r => r.IdWellSectionType)
|
||
.HasConstraintName("t_drill_params_t_well_section_type_id_fk");
|
||
});
|
||
|
||
modelBuilder.Entity<DrillFlowChart>(entity =>
|
||
{
|
||
entity.HasIndex(d => d.IdWellOperationCategory);
|
||
});
|
||
|
||
modelBuilder.Entity<FileMark>(entity =>
|
||
{
|
||
entity.HasOne(d => d.User)
|
||
.WithMany(p => p.FileMarks)
|
||
.HasForeignKey(d => d.IdUser)
|
||
.OnDelete(DeleteBehavior.Cascade)
|
||
.HasConstraintName("t_user_t_file_mark_fk");
|
||
|
||
entity.HasOne(d => d.FileInfo)
|
||
.WithMany(p => p.FileMarks)
|
||
.HasForeignKey(d => d.IdFile)
|
||
.OnDelete(DeleteBehavior.Cascade)
|
||
.HasConstraintName("t_file_mark_t_file_info_fk");
|
||
});
|
||
|
||
modelBuilder.Entity<RelationUserUserRole>(entity =>
|
||
{
|
||
entity.HasKey(e => new { e.IdUser, e.IdUserRole });
|
||
});
|
||
|
||
modelBuilder.Entity<RelationUserRolePermission>(entity =>
|
||
{
|
||
entity.HasKey(e => new { e.IdUserRole, e.IdPermission });
|
||
|
||
entity.HasOne(r => r.Permission)
|
||
.WithMany(p => p.RelationUserRolePermissions)
|
||
.IsRequired();
|
||
|
||
entity.HasOne(r => r.UserRole)
|
||
.WithMany(r => r.RelationUserRolePermissions)
|
||
.IsRequired();
|
||
});
|
||
|
||
FillData(modelBuilder);
|
||
}
|
||
|
||
private static void FillData(ModelBuilder modelBuilder)
|
||
{
|
||
modelBuilder.Entity<UserRole>(entity =>
|
||
{
|
||
entity.HasData(new List<UserRole>{
|
||
new UserRole{ Id = 1, Caption = "Администратор", },
|
||
new UserRole{ Id = 2, Caption = "Пользователь", },
|
||
});
|
||
});
|
||
|
||
modelBuilder.Entity<User>(entity =>
|
||
{
|
||
entity.HasData(new List<User>{
|
||
new User{
|
||
Id = 1,
|
||
IdCompany = 1,
|
||
Login = "dev",
|
||
PasswordHash = "Vlcj|4fa529103dde7ff72cfe76185f344d4aa87931f8e1b2044e8a7739947c3d18923464eaad93843e4f809c5e126d013072",
|
||
Name = "Разработчик",
|
||
},
|
||
});
|
||
});
|
||
|
||
modelBuilder.Entity<RelationUserUserRole>(entity =>
|
||
{
|
||
entity.HasData(new List<RelationUserUserRole>{
|
||
new RelationUserUserRole { IdUser = 1, IdUserRole = 2, },
|
||
});
|
||
});
|
||
|
||
modelBuilder.Entity<Company>(entity =>
|
||
{
|
||
entity.HasData(new List<Company>{
|
||
new Company{ Id = 1, Caption = "ООО \"АСБ\"", IdCompanyType = 3},
|
||
});
|
||
});
|
||
|
||
modelBuilder.Entity<WellOperationCategory>(entity =>
|
||
{
|
||
entity.HasData(new List<WellOperationCategory> {
|
||
// Автоматически определяемые операции
|
||
new WellOperationCategory {Id = 1, Name = "Невозможно определить операцию", Code = 0},
|
||
new WellOperationCategory {Id = 2, Name = "Роторное бурение", Code = 0 },
|
||
new WellOperationCategory {Id = 3, Name = "Слайдирование", Code = 0 },
|
||
new WellOperationCategory {Id = 4, Name = "Подъем с проработкой", Code = 0 },
|
||
new WellOperationCategory {Id = 5, Name = "Спуск с проработкой", Code = 0 },
|
||
new WellOperationCategory {Id = 6, Name = "Подъем с промывкой", Code = 0 },
|
||
new WellOperationCategory {Id = 7, Name = "Спуск с промывкой", Code = 0 },
|
||
new WellOperationCategory {Id = 8, Name = "Спуск в скважину", Code = 0 },
|
||
new WellOperationCategory {Id = 9, Name = "Спуск с вращением", Code = 0 },
|
||
new WellOperationCategory {Id = 10, Name = "Подъем из скважины", Code = 0 },
|
||
new WellOperationCategory {Id = 11, Name = "Подъем с вращением", Code = 0 },
|
||
new WellOperationCategory {Id = 12, Name = "Промывка в покое", Code = 0 },
|
||
new WellOperationCategory {Id = 13, Name = "Промывка с вращением", Code = 0 },
|
||
new WellOperationCategory {Id = 14, Name = "Удержание в клиньях", Code = 0 },
|
||
new WellOperationCategory {Id = 15, Name = "Неподвижное состояние", Code = 0 },
|
||
new WellOperationCategory {Id = 16, Name = "Вращение без циркуляции", Code = 0 },
|
||
new WellOperationCategory {Id = 17, Name = "На поверхности", Code = 0 },
|
||
// Операции ручного ввода
|
||
new WellOperationCategory {Id = 1001, Name = "Бурение", Code = 0 },
|
||
new WellOperationCategory {Id = 1002, Name = "ГИС", Code = 0 },
|
||
new WellOperationCategory {Id = 1003, Name = "ГФР", Code = 0 },
|
||
new WellOperationCategory {Id = 1004, Name = "Монтаж ПВО", Code = 0 },
|
||
new WellOperationCategory {Id = 1005, Name = "Демонтаж ПВО", Code = 0 },
|
||
new WellOperationCategory {Id = 1006, Name = "Установка ФА", Code = 0 },
|
||
new WellOperationCategory {Id = 1007, Name = "Оборудование устья", Code = 0 },
|
||
new WellOperationCategory {Id = 1008, Name = "ОЗЦ", Code = 0 },
|
||
new WellOperationCategory {Id = 1011, Name = "Начало цикла строительства скважины", Code = 0 },
|
||
new WellOperationCategory {Id = 1012, Name = "Окончание цикла строительства скважины", Code = 0 },
|
||
new WellOperationCategory {Id = 1013, Name = "Опрессовка ПВО", Code = 0 },
|
||
new WellOperationCategory {Id = 1014, Name = "Опрессовка Ц.К.", Code = 0 },
|
||
new WellOperationCategory {Id = 1015, Name = "Опрессовка ВЗД", Code = 0 },
|
||
new WellOperationCategory {Id = 1016, Name = "Перевод скв на другой тип промывочной жидкости", Code = 0 },
|
||
new WellOperationCategory {Id = 1017, Name = "Перезапись каротажа", Code = 0 },
|
||
new WellOperationCategory {Id = 1018, Name = "Перетяжка талевого каната", Code = 0 },
|
||
new WellOperationCategory {Id = 1019, Name = "Наращивание, промывка", Code = 0 },
|
||
new WellOperationCategory {Id = 1020, Name = "Подъем инструмента", Code = 0 },
|
||
new WellOperationCategory {Id = 1021, Name = "Подъем инструмента с промывкой", Code = 0 },
|
||
new WellOperationCategory {Id = 1022, Name = "Обратная проработка", Code = 0 },
|
||
new WellOperationCategory {Id = 1023, Name = "Сборка инструмента с мостков", Code = 0 },
|
||
new WellOperationCategory {Id = 1024, Name = "Подготовительные работы", Code = 0 },
|
||
new WellOperationCategory {Id = 1025, Name = "Сборка КНБК", Code = 0 },
|
||
new WellOperationCategory {Id = 1026, Name = "Разборка КНБК", Code = 0 },
|
||
new WellOperationCategory {Id = 1027, Name = "Промывка", Code = 0 },
|
||
new WellOperationCategory {Id = 1028, Name = "Промежуточная промывка", Code = 0 },
|
||
new WellOperationCategory {Id = 1029, Name = "Прокачка пачек", Code = 0 },
|
||
new WellOperationCategory {Id = 1030, Name = "Разбуривание тех.оснастки", Code = 0 },
|
||
new WellOperationCategory {Id = 1031, Name = "Ремонт", Code = 0 },
|
||
new WellOperationCategory {Id = 1032, Name = "Спуск инструмента", Code = 0 },
|
||
new WellOperationCategory {Id = 1033, Name = "Спуск инструмента с промывкой", Code = 0 },
|
||
new WellOperationCategory {Id = 1034, Name = "Прямая проработка", Code = 0 },
|
||
new WellOperationCategory {Id = 1035, Name = "Принудительная проработка", Code = 0 },
|
||
new WellOperationCategory {Id = 1037, Name = "Тех СПО-подъем", Code = 0 },
|
||
new WellOperationCategory {Id = 1038, Name = "Тех СПО-спуск", Code = 0 },
|
||
new WellOperationCategory {Id = 1039, Name = "Техническое обслуживание", Code = 0 },
|
||
new WellOperationCategory {Id = 1040, Name = "Цементаж", Code = 0 },
|
||
new WellOperationCategory {Id = 1041, Name = "Шаблонировка ствола", Code = 0 },
|
||
new WellOperationCategory {Id = 1042, Name = "Геологическое осложнение", Code = 0 },
|
||
new WellOperationCategory {Id = 1043, Name = "НПВ", Code = 0 },
|
||
new WellOperationCategory {Id = 1044, Name = "ВМР", Code = 0 },
|
||
new WellOperationCategory {Id = 1045, Name = "Прочее", Code = 0 },
|
||
new WellOperationCategory {Id = 1046, Name = "Спуск КНБК", Code = 0 },
|
||
new WellOperationCategory {Id = 1047, Name = "Подъем КНБК", Code = 0 },
|
||
new WellOperationCategory {Id = 1048, Name = "Спуск ОК", Code = 0 },
|
||
new WellOperationCategory {Id = 1050, Name = "Промывка при спуске ОК", Code = 0 },
|
||
new WellOperationCategory {Id = 1051, Name = "Замер ТС", Code = 0 },
|
||
new WellOperationCategory {Id = 1052, Name = "Тех. отстой", Code = 0 },
|
||
new WellOperationCategory {Id = 1053, Name = "Циркуляция и Обработка БР", Code = 0 },
|
||
new WellOperationCategory {Id = 1054, Name = "Срезка ствола", Code = 0 },
|
||
new WellOperationCategory {Id = 1055, Name = "Вспомогательные работы", Code = 0 },
|
||
});
|
||
});
|
||
|
||
modelBuilder.Entity<FileCategory>(entity =>
|
||
{
|
||
entity.HasData(new List<FileCategory> {
|
||
new FileCategory {Id = 1, Name = "Растворный сервис", ShortName = "fluidService"},
|
||
new FileCategory {Id = 2, Name = "Цементирование", ShortName = "cement"},
|
||
new FileCategory {Id = 3, Name = "ННБ", ShortName = "nnb"},
|
||
new FileCategory {Id = 4, Name = "ГТИ", ShortName = "gti"},
|
||
new FileCategory {Id = 5, Name = "Документы по скважине", ShortName = "wellDocuments"},
|
||
new FileCategory {Id = 6, Name = "Супервайзер", ShortName = "supervisor"},
|
||
new FileCategory {Id = 7, Name = "Мастер", ShortName = "master"},
|
||
|
||
new FileCategory {Id = 8, Name = "Долотный сервис", ShortName = "toolService"},
|
||
new FileCategory {Id = 9, Name = "Буровой подрядчик", ShortName = "drillService"},
|
||
new FileCategory {Id = 10, Name = "Сервис по заканчиванию скважины", ShortName = "closingService"},
|
||
//new FileCategory {Id = 11, Name = "", ShortName = ""},
|
||
|
||
new FileCategory {Id = 12, Name = "Рапорт", ShortName = "report"},
|
||
new FileCategory {Id = 13, Name = "Программа бурения, части", ShortName = "ПБч"},
|
||
new FileCategory {Id = 14, Name = "Программа бурения", ShortName = "ПБ"},
|
||
});
|
||
});
|
||
|
||
modelBuilder.Entity<WellSectionType>(entity =>
|
||
{
|
||
entity.HasData(new List<WellSectionType>{
|
||
new WellSectionType{ Id = 1, Caption = "Пилотный ствол"},
|
||
new WellSectionType{ Id = 2, Caption = "Направление"},
|
||
new WellSectionType{ Id = 3, Caption = "Кондуктор"},
|
||
new WellSectionType{ Id = 4, Caption = "Эксплуатационная колонна"},
|
||
new WellSectionType{ Id = 5, Caption = "Транспортный ствол"},
|
||
new WellSectionType{ Id = 6, Caption = "Хвостовик"},
|
||
|
||
new WellSectionType{ Id = 7, Caption = "Пилотный ствол 2"},
|
||
new WellSectionType{ Id = 8, Caption = "Направление 2"},
|
||
new WellSectionType{ Id = 9, Caption = "Кондуктор 2"},
|
||
new WellSectionType{ Id = 10, Caption = "Эксплуатационная колонна 2"},
|
||
new WellSectionType{ Id = 11, Caption = "Транспортный ствол 2"},
|
||
new WellSectionType{ Id = 12, Caption = "Хвостовик 2"},
|
||
|
||
new WellSectionType{ Id = 13, Caption = "Пилотный ствол 3"},
|
||
new WellSectionType{ Id = 14, Caption = "Направление 3"},
|
||
new WellSectionType{ Id = 15, Caption = "Кондуктор 3"},
|
||
new WellSectionType{ Id = 16, Caption = "Эксплуатационная колонна 3"},
|
||
new WellSectionType{ Id = 17, Caption = "Транспортный ствол 3"},
|
||
new WellSectionType{ Id = 18, Caption = "Хвостовик 3"},
|
||
|
||
new WellSectionType{ Id = 19, Caption = "Пилотный ствол 4"},
|
||
new WellSectionType{ Id = 20, Caption = "Направление 4"},
|
||
new WellSectionType{ Id = 21, Caption = "Кондуктор 4"},
|
||
new WellSectionType{ Id = 22, Caption = "Эксплуатационная колонна 4"},
|
||
new WellSectionType{ Id = 23, Caption = "Транспортный ствол 4"},
|
||
new WellSectionType{ Id = 24, Caption = "Хвостовик 4"},
|
||
|
||
new WellSectionType{ Id = 25, Caption = "Пилотный ствол 5"},
|
||
new WellSectionType{ Id = 26, Caption = "Направление 5"},
|
||
new WellSectionType{ Id = 27, Caption = "Кондуктор 5"},
|
||
new WellSectionType{ Id = 28, Caption = "Эксплуатационная колонна 5"},
|
||
new WellSectionType{ Id = 29, Caption = "Транспортный ствол 5"},
|
||
new WellSectionType{ Id = 30, Caption = "Хвостовик 5"},
|
||
});
|
||
});
|
||
|
||
modelBuilder.Entity<WellType>(entity =>
|
||
{
|
||
entity.HasData(new List<WellType> {
|
||
new WellType{ Id = 1, Caption = "Наклонно-направленная"},
|
||
new WellType{ Id = 2, Caption = "Горизонтальная"},
|
||
});
|
||
});
|
||
|
||
modelBuilder.Entity<MeasureCategory>(entity =>
|
||
{
|
||
entity.HasData(new List<MeasureCategory> {
|
||
new MeasureCategory{ Id = 1, Name = "Показатели бурового раствора", ShortName = "Раствор"},
|
||
new MeasureCategory{ Id = 2, Name = "Шламограмма", ShortName = "Шламограмма"},
|
||
new MeasureCategory{ Id = 3, Name = "ННБ", ShortName = "ННБ"},
|
||
});
|
||
});
|
||
|
||
modelBuilder.Entity<CompanyType>(entity =>
|
||
{
|
||
entity.HasData(new List<CompanyType>{
|
||
new CompanyType{ Id = 1, Caption = "Недрапользователь", },
|
||
new CompanyType{ Id = 2, Caption = "Буровой подрядчик", },
|
||
new CompanyType{ Id = 3, Caption = "Сервис автоматизации бурения", },
|
||
});
|
||
});
|
||
|
||
}
|
||
}
|
||
}
|