2024-11-26 10:23:48 +05:00
|
|
|
|
// <auto-generated />
|
|
|
|
|
using System;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
|
using Persistence.Database.Model;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
namespace Persistence.Database.Postgres.Migrations
|
|
|
|
|
{
|
|
|
|
|
[DbContext(typeof(PersistenceDbContext))]
|
2024-11-28 13:13:07 +05:00
|
|
|
|
[Migration("20241128074729_TechMessageMigration")]
|
2024-11-26 10:23:48 +05:00
|
|
|
|
partial class TechMessageMigration
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
#pragma warning disable 612, 618
|
|
|
|
|
modelBuilder
|
|
|
|
|
.UseCollation("Russian_Russia.1251")
|
|
|
|
|
.HasAnnotation("ProductVersion", "8.0.10")
|
|
|
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
|
|
|
|
|
|
NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack");
|
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
|
|
2024-11-28 08:55:50 +05:00
|
|
|
|
modelBuilder.Entity("Persistence.Database.Entity.ADSystem", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<Guid>("SystemId")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid")
|
|
|
|
|
.HasComment("Id системы автобурения");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Description")
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasComment("Описание системы автобурения");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("varchar(256)")
|
|
|
|
|
.HasComment("Наименование системы автобурения");
|
|
|
|
|
|
|
|
|
|
b.HasKey("SystemId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("ADSystem");
|
|
|
|
|
});
|
|
|
|
|
|
2024-11-26 10:23:48 +05:00
|
|
|
|
modelBuilder.Entity("Persistence.Database.Entity.TechMessage", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<Guid>("EventId")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid")
|
|
|
|
|
.HasComment("Id события");
|
|
|
|
|
|
2024-11-28 13:13:07 +05:00
|
|
|
|
b.Property<int>("CategoryId")
|
|
|
|
|
.HasColumnType("integer")
|
|
|
|
|
.HasComment("Id Категории важности");
|
|
|
|
|
|
2024-11-26 10:23:48 +05:00
|
|
|
|
b.Property<double?>("Depth")
|
|
|
|
|
.HasColumnType("double precision")
|
|
|
|
|
.HasComment("Глубина забоя");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("MessageText")
|
2024-11-28 08:55:50 +05:00
|
|
|
|
.IsRequired()
|
2024-11-26 10:23:48 +05:00
|
|
|
|
.HasColumnType("varchar(512)")
|
|
|
|
|
.HasComment("Текст сообщения");
|
|
|
|
|
|
2024-11-28 08:55:50 +05:00
|
|
|
|
b.Property<Guid>("SystemId")
|
|
|
|
|
.HasColumnType("uuid")
|
|
|
|
|
.HasComment("Id системы автобурения, к которой относится сообщение");
|
|
|
|
|
|
2024-11-28 13:13:07 +05:00
|
|
|
|
b.Property<DateTimeOffset>("Timestamp")
|
|
|
|
|
.HasColumnType("timestamp with time zone")
|
|
|
|
|
.HasComment("Дата возникновения");
|
|
|
|
|
|
2024-11-26 10:23:48 +05:00
|
|
|
|
b.Property<Guid>("UserId")
|
|
|
|
|
.HasColumnType("uuid")
|
|
|
|
|
.HasComment("Id пользователя за пультом бурильщика");
|
|
|
|
|
|
|
|
|
|
b.HasKey("EventId");
|
|
|
|
|
|
2024-11-28 08:55:50 +05:00
|
|
|
|
b.HasIndex("SystemId");
|
|
|
|
|
|
2024-11-26 10:23:48 +05:00
|
|
|
|
b.ToTable("TechMessage");
|
|
|
|
|
});
|
|
|
|
|
|
2024-11-28 08:55:50 +05:00
|
|
|
|
modelBuilder.Entity("Persistence.Database.Entity.TimestampedSet", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<Guid>("IdDiscriminator")
|
|
|
|
|
.HasColumnType("uuid")
|
|
|
|
|
.HasComment("Дискриминатор ссылка на тип сохраняемых данных");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTimeOffset>("Timestamp")
|
|
|
|
|
.HasColumnType("timestamp with time zone")
|
|
|
|
|
.HasComment("Отметка времени, строго в UTC");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Set")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("jsonb")
|
|
|
|
|
.HasComment("Набор сохраняемых данных");
|
|
|
|
|
|
|
|
|
|
b.HasKey("IdDiscriminator", "Timestamp");
|
|
|
|
|
|
|
|
|
|
b.ToTable("TimestampedSets", t =>
|
|
|
|
|
{
|
|
|
|
|
t.HasComment("Общая таблица данных временных рядов");
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2024-11-26 10:23:48 +05:00
|
|
|
|
modelBuilder.Entity("Persistence.Database.Model.DataSaub", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<DateTimeOffset>("Date")
|
|
|
|
|
.HasColumnType("timestamp with time zone")
|
|
|
|
|
.HasColumnName("date");
|
|
|
|
|
|
|
|
|
|
b.Property<double?>("AxialLoad")
|
|
|
|
|
.HasColumnType("double precision")
|
|
|
|
|
.HasColumnName("axialLoad");
|
|
|
|
|
|
|
|
|
|
b.Property<double?>("BitDepth")
|
|
|
|
|
.HasColumnType("double precision")
|
|
|
|
|
.HasColumnName("bitDepth");
|
|
|
|
|
|
|
|
|
|
b.Property<double?>("BlockPosition")
|
|
|
|
|
.HasColumnType("double precision")
|
|
|
|
|
.HasColumnName("blockPosition");
|
|
|
|
|
|
|
|
|
|
b.Property<double?>("BlockSpeed")
|
|
|
|
|
.HasColumnType("double precision")
|
|
|
|
|
.HasColumnName("blockSpeed");
|
|
|
|
|
|
|
|
|
|
b.Property<double?>("Flow")
|
|
|
|
|
.HasColumnType("double precision")
|
|
|
|
|
.HasColumnName("flow");
|
|
|
|
|
|
|
|
|
|
b.Property<double?>("HookWeight")
|
|
|
|
|
.HasColumnType("double precision")
|
|
|
|
|
.HasColumnName("hookWeight");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("IdFeedRegulator")
|
|
|
|
|
.HasColumnType("integer")
|
|
|
|
|
.HasColumnName("idFeedRegulator");
|
|
|
|
|
|
|
|
|
|
b.Property<int?>("Mode")
|
|
|
|
|
.HasColumnType("integer")
|
|
|
|
|
.HasColumnName("mode");
|
|
|
|
|
|
|
|
|
|
b.Property<double?>("Mse")
|
|
|
|
|
.HasColumnType("double precision")
|
|
|
|
|
.HasColumnName("mse");
|
|
|
|
|
|
|
|
|
|
b.Property<short>("MseState")
|
|
|
|
|
.HasColumnType("smallint")
|
|
|
|
|
.HasColumnName("mseState");
|
|
|
|
|
|
|
|
|
|
b.Property<double?>("Pressure")
|
|
|
|
|
.HasColumnType("double precision")
|
|
|
|
|
.HasColumnName("pressure");
|
|
|
|
|
|
|
|
|
|
b.Property<double?>("Pump0Flow")
|
|
|
|
|
.HasColumnType("double precision")
|
|
|
|
|
.HasColumnName("pump0Flow");
|
|
|
|
|
|
|
|
|
|
b.Property<double?>("Pump1Flow")
|
|
|
|
|
.HasColumnType("double precision")
|
|
|
|
|
.HasColumnName("pump1Flow");
|
|
|
|
|
|
|
|
|
|
b.Property<double?>("Pump2Flow")
|
|
|
|
|
.HasColumnType("double precision")
|
|
|
|
|
.HasColumnName("pump2Flow");
|
|
|
|
|
|
|
|
|
|
b.Property<double?>("RotorSpeed")
|
|
|
|
|
.HasColumnType("double precision")
|
|
|
|
|
.HasColumnName("rotorSpeed");
|
|
|
|
|
|
|
|
|
|
b.Property<double?>("RotorTorque")
|
|
|
|
|
.HasColumnType("double precision")
|
|
|
|
|
.HasColumnName("rotorTorque");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("User")
|
|
|
|
|
.HasColumnType("text")
|
|
|
|
|
.HasColumnName("user");
|
|
|
|
|
|
|
|
|
|
b.Property<double?>("WellDepth")
|
|
|
|
|
.HasColumnType("double precision")
|
|
|
|
|
.HasColumnName("wellDepth");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Date");
|
|
|
|
|
|
|
|
|
|
b.ToTable("DataSaub");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("Persistence.Database.Model.Setpoint", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<Guid>("Key")
|
|
|
|
|
.HasColumnType("uuid")
|
|
|
|
|
.HasComment("Ключ");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTimeOffset>("Created")
|
|
|
|
|
.HasColumnType("timestamp with time zone")
|
|
|
|
|
.HasComment("Дата создания уставки");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("IdUser")
|
|
|
|
|
.HasColumnType("integer")
|
|
|
|
|
.HasComment("Id автора последнего изменения");
|
|
|
|
|
|
|
|
|
|
b.Property<object>("Value")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("jsonb")
|
|
|
|
|
.HasComment("Значение уставки");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Key", "Created");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Setpoint");
|
|
|
|
|
});
|
2024-11-28 08:55:50 +05:00
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("Persistence.Database.Entity.TechMessage", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("Persistence.Database.Entity.ADSystem", "System")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("SystemId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("System");
|
|
|
|
|
});
|
2024-11-26 10:23:48 +05:00
|
|
|
|
#pragma warning restore 612, 618
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|