refactor: AmineContent Database

This commit is contained in:
2026-02-27 08:58:33 +03:00
parent 102e56ec93
commit 64fa8090dc
22 changed files with 572 additions and 430 deletions
@@ -1,4 +1,6 @@
using GSS2.Core.Analysis.AmineContent.Database;
using GSS2.Core.Analysis.AmineContent.Database.Calibration;
using Microsoft.Extensions.Logging;
namespace GSS2.Core.Analysis.AmineContent;
@@ -1,4 +1,6 @@
using GSS2.Core.Analysis.AmineContent.Database;
using GSS2.Core.Analysis.AmineContent.Database.Calibration;
using Microsoft.Extensions.Logging;
namespace GSS2.Core.Analysis.AmineContent;
@@ -1,130 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace GSS2.Core.Analysis.AmineContent.Database
{
/// <inheritdoc />
public partial class AmineContentCalibrationInitial : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Images",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false, comment: "Уникальный идентификатор")
.Annotation("Sqlite:Autoincrement", true),
VisibleIntensity = table.Column<double>(type: "REAL", nullable: false, comment: "Интенсивность видимого света (0..1)"),
Uv365Intensity = table.Column<double>(type: "REAL", nullable: false, comment: "Интенсивность УФ излучения 365 нм (0..1)"),
Uv254Intensity = table.Column<double>(type: "REAL", nullable: false, comment: "Интенсивность УФ излучения 254 нм (0..1)"),
ImageType = table.Column<string>(type: "TEXT", nullable: false, comment: "Тип изображения (sample - проба или separator - сепаратор)"),
ImagePath = table.Column<string>(type: "TEXT", nullable: false, comment: "Путь к файлу изображения")
},
constraints: table =>
{
table.PrimaryKey("PK_Images", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Records",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false, comment: "Уникальный идентификатор")
.Annotation("Sqlite:Autoincrement", true),
SampleName = table.Column<string>(type: "TEXT", nullable: false, comment: "Название пробы"),
SampleComment = table.Column<string>(type: "TEXT", nullable: false, comment: "Дополнительная информация о пробе"),
SampleBrand = table.Column<string>(type: "TEXT", nullable: false, comment: "Марка пробы"),
SampleMass = table.Column<double>(type: "REAL", nullable: false, comment: "Масса пробы (кг)"),
SamplingDateTime = table.Column<DateTime>(type: "TEXT", nullable: false, comment: "Дата и время отбора пробы"),
SamplingPlace = table.Column<string>(type: "TEXT", nullable: false, comment: "Место отбора пробы"),
MixtureName = table.Column<string>(type: "TEXT", nullable: false, comment: "Название используемой кондиционирующей смеси"),
MixtureAmineContent = table.Column<double>(type: "REAL", nullable: false, comment: "Содержание аминов в кондиционирующей смеси (%)"),
MixtureNormalRate = table.Column<double>(type: "REAL", nullable: false, comment: "Норма расхода кондиционирующей смеси (кг/т)"),
MixtureActualRate = table.Column<double>(type: "REAL", nullable: false, comment: "Истинный расход кондиционирующей смеси (кг/т)"),
AirTemperature = table.Column<double>(type: "REAL", nullable: false, comment: "Температура воздуха (℃)"),
AirHumidity = table.Column<double>(type: "REAL", nullable: false, comment: "Относительная влажность воздуха (%)")
},
constraints: table =>
{
table.PrimaryKey("PK_Records", x => x.Id);
});
migrationBuilder.CreateTable(
name: "SampleImages",
columns: table => new
{
SampleImagesId = table.Column<int>(type: "INTEGER", nullable: false),
SampleRecordsId = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SampleImages", x => new { x.SampleImagesId, x.SampleRecordsId });
table.ForeignKey(
name: "FK_SampleImages_Images_SampleImagesId",
column: x => x.SampleImagesId,
principalTable: "Images",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_SampleImages_Records_SampleRecordsId",
column: x => x.SampleRecordsId,
principalTable: "Records",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "SeparatorImages",
columns: table => new
{
SeparatorImagesId = table.Column<int>(type: "INTEGER", nullable: false),
SeparatorRecordsId = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SeparatorImages", x => new { x.SeparatorImagesId, x.SeparatorRecordsId });
table.ForeignKey(
name: "FK_SeparatorImages_Images_SeparatorImagesId",
column: x => x.SeparatorImagesId,
principalTable: "Images",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_SeparatorImages_Records_SeparatorRecordsId",
column: x => x.SeparatorRecordsId,
principalTable: "Records",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_SampleImages_SampleRecordsId",
table: "SampleImages",
column: "SampleRecordsId");
migrationBuilder.CreateIndex(
name: "IX_SeparatorImages_SeparatorRecordsId",
table: "SeparatorImages",
column: "SeparatorRecordsId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "SampleImages");
migrationBuilder.DropTable(
name: "SeparatorImages");
migrationBuilder.DropTable(
name: "Images");
migrationBuilder.DropTable(
name: "Records");
}
}
}
@@ -1,78 +0,0 @@
using Microsoft.EntityFrameworkCore;
namespace GSS2.Core.Analysis.AmineContent.Database;
public class AmineContentCalibrationContext : DbContext
{
public class Record
{
[Comment("Уникальный идентификатор")]
public int Id { get; set; }
[Comment("Название пробы")]
public string SampleName { get; set; } = string.Empty;
[Comment("Дополнительная информация о пробе")]
public string SampleComment { get; set; } = string.Empty;
[Comment("Марка пробы")]
public string SampleBrand { get; set; } = string.Empty;
[Comment("Масса пробы (кг)")]
public double SampleMass { get; set; } = double.NaN;
[Comment("Дата и время отбора пробы")]
public DateTime SamplingDateTime { get; set; } = DateTime.Now;
[Comment("Место отбора пробы")]
public string SamplingPlace { get; set; } = string.Empty;
[Comment("Название используемой кондиционирующей смеси")]
public string MixtureName { get; set; } = string.Empty;
[Comment("Содержание аминов в кондиционирующей смеси (%)")]
public double MixtureAmineContent { get; set; } = double.NaN;
[Comment("Норма расхода кондиционирующей смеси (кг/т)")]
public double MixtureNormalRate { get; set; } = double.NaN;
[Comment("Истинный расход кондиционирующей смеси (кг/т)")]
public double MixtureActualRate { get; set; } = double.NaN;
[Comment("Изображения пробы")]
public List<ImageData> SampleImages { get; set; } = new();
[Comment("Изображения пустого сепаратора")]
public List<ImageData> SeparatorImages { get; set; } = new();
[Comment("Температура воздуха (℃)")]
public double AirTemperature { get; set; } = new();
[Comment("Относительная влажность воздуха (%)")]
public double AirHumidity { get; set; } = new();
}
public class ImageData
{
[Comment("Уникальный идентификатор")]
public int Id { get; set; }
[Comment("Интенсивность видимого света (0..1)")]
public double VisibleIntensity { get; set; } = double.NaN;
[Comment("Интенсивность УФ излучения 365 нм (0..1)")]
public double Uv365Intensity { get; set; } = double.NaN;
[Comment("Интенсивность УФ излучения 254 нм (0..1)")]
public double Uv254Intensity { get; set; } = double.NaN;
[Comment("Тип изображения (sample - проба или separator - сепаратор)")]
public string ImageType { get; set; } = string.Empty;
[Comment("Путь к файлу изображения")]
public string ImagePath { get; set; } = string.Empty;
[Comment("Записи в которых это изображение используется как изображение пробы")]
public List<Record> SampleRecords { get; set; } = new();
[Comment("Записи в которых это изображение используется как изображение сепаратора")]
public List<Record> SeparatorRecords { get; set; } = new();
}
public DbSet<Record> Records => Set<Record>();
public DbSet<ImageData> Images => Set<ImageData>();
public AmineContentCalibrationContext(DbContextOptions<AmineContentCalibrationContext> options) : base(options) { }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Record>()
.HasMany(r => r.SampleImages)
.WithMany(i => i.SampleRecords)
.UsingEntity(j => j.ToTable("SampleImages"));
modelBuilder.Entity<Record>()
.HasMany(r => r.SeparatorImages)
.WithMany(i => i.SeparatorRecords)
.UsingEntity(j => j.ToTable("SeparatorImages"));
}
}
@@ -1,6 +1,6 @@
// <auto-generated />
using System;
using GSS2.Core.Analysis.AmineContent.Database;
using GSS2.Core.Analysis.AmineContent.Database.Calibration;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
@@ -8,10 +8,10 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace GSS2.Core.Analysis.AmineContent.Database
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
{
[DbContext(typeof(AmineContentCalibrationContext))]
[Migration("20251208044919_AmineContentCalibrationInitial")]
[Migration("20260227055810_AmineContentCalibrationInitial")]
partial class AmineContentCalibrationInitial
{
/// <inheritdoc />
@@ -20,22 +20,87 @@ namespace GSS2.Core.Analysis.AmineContent.Database
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.0");
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.AmineContentCalibrationContext+ImageData", b =>
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasComment("Уникальный идентификатор");
b.Property<double?>("MixtureActualRate")
.HasColumnType("REAL")
.HasComment("Фактический расход кондиционирующей смеси (кг/т)");
b.Property<double?>("MixtureAmineContent")
.HasColumnType("REAL")
.HasComment("Содержание аминов в кондиционирующей смеси (%)");
b.Property<string>("MixtureName")
.HasMaxLength(512)
.HasColumnType("TEXT")
.HasComment("Название используемой кондиционирующей смеси");
b.Property<double?>("MixtureNormalRate")
.HasColumnType("REAL")
.HasComment("Норма расхода кондиционирующей смеси (кг/т)");
b.Property<string>("SampleBrand")
.HasMaxLength(512)
.HasColumnType("TEXT")
.HasComment("Марка пробы");
b.Property<string>("SampleComment")
.HasMaxLength(2048)
.HasColumnType("TEXT")
.HasComment("Дополнительная информация о пробе");
b.Property<double?>("SampleMass")
.HasColumnType("REAL")
.HasComment("Масса пробы (кг)");
b.Property<string>("SampleName")
.HasMaxLength(512)
.HasColumnType("TEXT")
.HasComment("Название пробы");
b.Property<DateTime?>("SamplingDateTime")
.HasColumnType("TEXT")
.HasComment("Дата и время отбора пробы");
b.Property<string>("SamplingPlace")
.HasMaxLength(512)
.HasColumnType("TEXT")
.HasComment("Место отбора пробы");
b.HasKey("Id");
b.ToTable("CalibrationRecords");
});
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.ImageRecord", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasComment("Уникальный идентификатор");
b.Property<int?>("CalibrationRecordId")
.HasColumnType("INTEGER");
b.Property<int?>("CalibrationRecordId1")
.HasColumnType("INTEGER");
b.Property<string>("ImagePath")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("TEXT")
.HasComment("Путь к файлу изображения");
b.Property<string>("ImageType")
.IsRequired()
.HasColumnType("TEXT")
.HasComment("Тип изображения (sample - проба или separator - сепаратор)");
b.Property<int?>("SeparatorRecordId")
.HasColumnType("INTEGER");
b.Property<int?>("TrayRecordId")
.HasColumnType("INTEGER");
b.Property<double>("Uv254Intensity")
.HasColumnType("REAL")
@@ -51,132 +116,91 @@ namespace GSS2.Core.Analysis.AmineContent.Database
b.HasKey("Id");
b.ToTable("Images");
b.HasIndex("CalibrationRecordId");
b.HasIndex("CalibrationRecordId1");
b.HasIndex("SeparatorRecordId");
b.HasIndex("TrayRecordId");
b.ToTable("ImageRecords");
});
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.AmineContentCalibrationContext+Record", b =>
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasComment("Уникальный идентификатор");
b.Property<double>("AirHumidity")
.HasColumnType("REAL")
.HasComment("Относительная влажность воздуха (%)");
b.Property<double>("AirTemperature")
.HasColumnType("REAL")
.HasComment("Температура воздуха (℃)");
b.Property<double>("MixtureActualRate")
.HasColumnType("REAL")
.HasComment("Истинный расход кондиционирующей смеси (кг/т)");
b.Property<double>("MixtureAmineContent")
.HasColumnType("REAL")
.HasComment("Содержание аминов в кондиционирующей смеси (%)");
b.Property<string>("MixtureName")
b.Property<string>("Batch")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT")
.HasComment("Название используемой кондиционирующей смеси");
.HasComment("Партия сепаратора");
b.Property<double>("MixtureNormalRate")
.HasColumnType("REAL")
.HasComment("Норма расхода кондиционирующей смеси (кг/т)");
b.Property<string>("SampleBrand")
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT")
.HasComment("Марка пробы");
b.Property<string>("SampleComment")
.IsRequired()
.HasColumnType("TEXT")
.HasComment("Дополнительная информация о пробе");
b.Property<double>("SampleMass")
.HasColumnType("REAL")
.HasComment("Масса пробы (кг)");
b.Property<string>("SampleName")
.IsRequired()
.HasColumnType("TEXT")
.HasComment("Название пробы");
b.Property<DateTime>("SamplingDateTime")
.HasColumnType("TEXT")
.HasComment("Дата и время отбора пробы");
b.Property<string>("SamplingPlace")
.IsRequired()
.HasColumnType("TEXT")
.HasComment("Место отбора пробы");
.HasComment("Тип сепаратора");
b.HasKey("Id");
b.ToTable("Records");
b.ToTable("SeparatorRecords");
});
modelBuilder.Entity("ImageDataRecord", b =>
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.TrayRecord", b =>
{
b.Property<int>("SampleImagesId")
.HasColumnType("INTEGER");
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasComment("Уникальный идентификатор");
b.Property<int>("SampleRecordsId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasKey("SampleImagesId", "SampleRecordsId");
b.HasIndex("SampleRecordsId");
b.ToTable("SampleImages", (string)null);
b.ToTable("TrayRecords");
});
modelBuilder.Entity("ImageDataRecord1", b =>
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.ImageRecord", b =>
{
b.Property<int>("SeparatorImagesId")
.HasColumnType("INTEGER");
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", null)
.WithMany("SampleImages")
.HasForeignKey("CalibrationRecordId")
.OnDelete(DeleteBehavior.Cascade);
b.Property<int>("SeparatorRecordsId")
.HasColumnType("INTEGER");
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", null)
.WithMany("SeparatorImages")
.HasForeignKey("CalibrationRecordId1")
.OnDelete(DeleteBehavior.Cascade);
b.HasKey("SeparatorImagesId", "SeparatorRecordsId");
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", null)
.WithMany("Images")
.HasForeignKey("SeparatorRecordId")
.OnDelete(DeleteBehavior.Cascade);
b.HasIndex("SeparatorRecordsId");
b.ToTable("SeparatorImages", (string)null);
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.TrayRecord", null)
.WithMany("Images")
.HasForeignKey("TrayRecordId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("ImageDataRecord", b =>
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", b =>
{
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.AmineContentCalibrationContext+ImageData", null)
.WithMany()
.HasForeignKey("SampleImagesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("SampleImages");
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.AmineContentCalibrationContext+Record", null)
.WithMany()
.HasForeignKey("SampleRecordsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("SeparatorImages");
});
modelBuilder.Entity("ImageDataRecord1", b =>
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", b =>
{
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.AmineContentCalibrationContext+ImageData", null)
.WithMany()
.HasForeignKey("SeparatorImagesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Images");
});
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.AmineContentCalibrationContext+Record", null)
.WithMany()
.HasForeignKey("SeparatorRecordsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.TrayRecord", b =>
{
b.Navigation("Images");
});
#pragma warning restore 612, 618
}
@@ -0,0 +1,143 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
{
/// <inheritdoc />
public partial class AmineContentCalibrationInitial : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CalibrationRecords",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false, comment: "Уникальный идентификатор")
.Annotation("Sqlite:Autoincrement", true),
SampleName = table.Column<string>(type: "TEXT", maxLength: 512, nullable: true, comment: "Название пробы"),
SampleComment = table.Column<string>(type: "TEXT", maxLength: 2048, nullable: true, comment: "Дополнительная информация о пробе"),
SampleBrand = table.Column<string>(type: "TEXT", maxLength: 512, nullable: true, comment: "Марка пробы"),
SampleMass = table.Column<double>(type: "REAL", nullable: true, comment: "Масса пробы (кг)"),
SamplingDateTime = table.Column<DateTime>(type: "TEXT", nullable: true, comment: "Дата и время отбора пробы"),
SamplingPlace = table.Column<string>(type: "TEXT", maxLength: 512, nullable: true, comment: "Место отбора пробы"),
MixtureName = table.Column<string>(type: "TEXT", maxLength: 512, nullable: true, comment: "Название используемой кондиционирующей смеси"),
MixtureAmineContent = table.Column<double>(type: "REAL", nullable: true, comment: "Содержание аминов в кондиционирующей смеси (%)"),
MixtureNormalRate = table.Column<double>(type: "REAL", nullable: true, comment: "Норма расхода кондиционирующей смеси (кг/т)"),
MixtureActualRate = table.Column<double>(type: "REAL", nullable: true, comment: "Фактический расход кондиционирующей смеси (кг/т)")
},
constraints: table =>
{
table.PrimaryKey("PK_CalibrationRecords", x => x.Id);
});
migrationBuilder.CreateTable(
name: "SeparatorRecords",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false, comment: "Уникальный идентификатор")
.Annotation("Sqlite:Autoincrement", true),
Type = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false, comment: "Тип сепаратора"),
Batch = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false, comment: "Партия сепаратора")
},
constraints: table =>
{
table.PrimaryKey("PK_SeparatorRecords", x => x.Id);
});
migrationBuilder.CreateTable(
name: "TrayRecords",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false, comment: "Уникальный идентификатор")
.Annotation("Sqlite:Autoincrement", true)
},
constraints: table =>
{
table.PrimaryKey("PK_TrayRecords", x => x.Id);
});
migrationBuilder.CreateTable(
name: "ImageRecords",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false, comment: "Уникальный идентификатор")
.Annotation("Sqlite:Autoincrement", true),
VisibleIntensity = table.Column<double>(type: "REAL", nullable: false, comment: "Интенсивность видимого света (0..1)"),
Uv365Intensity = table.Column<double>(type: "REAL", nullable: false, comment: "Интенсивность УФ излучения 365 нм (0..1)"),
Uv254Intensity = table.Column<double>(type: "REAL", nullable: false, comment: "Интенсивность УФ излучения 254 нм (0..1)"),
ImagePath = table.Column<string>(type: "TEXT", maxLength: 1024, nullable: false, comment: "Путь к файлу изображения"),
CalibrationRecordId = table.Column<int>(type: "INTEGER", nullable: true),
CalibrationRecordId1 = table.Column<int>(type: "INTEGER", nullable: true),
SeparatorRecordId = table.Column<int>(type: "INTEGER", nullable: true),
TrayRecordId = table.Column<int>(type: "INTEGER", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ImageRecords", x => x.Id);
table.ForeignKey(
name: "FK_ImageRecords_CalibrationRecords_CalibrationRecordId",
column: x => x.CalibrationRecordId,
principalTable: "CalibrationRecords",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ImageRecords_CalibrationRecords_CalibrationRecordId1",
column: x => x.CalibrationRecordId1,
principalTable: "CalibrationRecords",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ImageRecords_SeparatorRecords_SeparatorRecordId",
column: x => x.SeparatorRecordId,
principalTable: "SeparatorRecords",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ImageRecords_TrayRecords_TrayRecordId",
column: x => x.TrayRecordId,
principalTable: "TrayRecords",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_ImageRecords_CalibrationRecordId",
table: "ImageRecords",
column: "CalibrationRecordId");
migrationBuilder.CreateIndex(
name: "IX_ImageRecords_CalibrationRecordId1",
table: "ImageRecords",
column: "CalibrationRecordId1");
migrationBuilder.CreateIndex(
name: "IX_ImageRecords_SeparatorRecordId",
table: "ImageRecords",
column: "SeparatorRecordId");
migrationBuilder.CreateIndex(
name: "IX_ImageRecords_TrayRecordId",
table: "ImageRecords",
column: "TrayRecordId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ImageRecords");
migrationBuilder.DropTable(
name: "CalibrationRecords");
migrationBuilder.DropTable(
name: "SeparatorRecords");
migrationBuilder.DropTable(
name: "TrayRecords");
}
}
}
@@ -0,0 +1,75 @@
using Microsoft.EntityFrameworkCore;
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration;
public class AmineContentCalibrationContext : DbContext
{
public DbSet<ImageRecord> ImageRecords => Set<ImageRecord>();
public DbSet<TrayRecord> TrayRecords => Set<TrayRecord>();
public DbSet<SeparatorRecord> SeparatorRecords => Set<SeparatorRecord>();
public DbSet<CalibrationRecord> CalibrationRecords => Set<CalibrationRecord>();
public AmineContentCalibrationContext(DbContextOptions<AmineContentCalibrationContext> options)
: base(options)
{ }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<ImageRecord>(entity =>
{
entity.HasKey(x => x.Id);
entity.Property(x => x.ImagePath)
.IsRequired()
.HasMaxLength(1024);
});
modelBuilder.Entity<TrayRecord>(entity =>
{
entity.HasKey(x => x.Id);
entity.HasMany(x => x.Images)
.WithOne()
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity<SeparatorRecord>(entity =>
{
entity.HasKey(x => x.Id);
entity.Property(x => x.Type)
.IsRequired()
.HasMaxLength(256);
entity.Property(x => x.Batch)
.IsRequired()
.HasMaxLength(256);
entity.HasMany(x => x.Images)
.WithOne()
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity<CalibrationRecord>(entity =>
{
entity.HasKey(x => x.Id);
entity.Property(x => x.SampleName).HasMaxLength(512);
entity.Property(x => x.SampleComment).HasMaxLength(2048);
entity.Property(x => x.SampleBrand).HasMaxLength(512);
entity.Property(x => x.SamplingPlace).HasMaxLength(512);
entity.Property(x => x.MixtureName).HasMaxLength(512);
entity.HasMany(x => x.SampleImages)
.WithOne()
.OnDelete(DeleteBehavior.Cascade);
entity.HasMany(x => x.SeparatorImages)
.WithOne()
.OnDelete(DeleteBehavior.Cascade);
});
}
}
@@ -1,7 +1,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
namespace GSS2.Core.Analysis.AmineContent.Database;
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration;
public class AmineContentCalibrationContextFactory : IDesignTimeDbContextFactory<AmineContentCalibrationContext>
{
@@ -1,13 +1,13 @@
// <auto-generated />
using System;
using GSS2.Core.Analysis.AmineContent.Database;
using GSS2.Core.Analysis.AmineContent.Database.Calibration;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace GSS2.Core.Analysis.AmineContent.Database
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
{
[DbContext(typeof(AmineContentCalibrationContext))]
partial class AmineContentCalibrationContextModelSnapshot : ModelSnapshot
@@ -17,22 +17,87 @@ namespace GSS2.Core.Analysis.AmineContent.Database
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.0");
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.AmineContentCalibrationContext+ImageData", b =>
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasComment("Уникальный идентификатор");
b.Property<double?>("MixtureActualRate")
.HasColumnType("REAL")
.HasComment("Фактический расход кондиционирующей смеси (кг/т)");
b.Property<double?>("MixtureAmineContent")
.HasColumnType("REAL")
.HasComment("Содержание аминов в кондиционирующей смеси (%)");
b.Property<string>("MixtureName")
.HasMaxLength(512)
.HasColumnType("TEXT")
.HasComment("Название используемой кондиционирующей смеси");
b.Property<double?>("MixtureNormalRate")
.HasColumnType("REAL")
.HasComment("Норма расхода кондиционирующей смеси (кг/т)");
b.Property<string>("SampleBrand")
.HasMaxLength(512)
.HasColumnType("TEXT")
.HasComment("Марка пробы");
b.Property<string>("SampleComment")
.HasMaxLength(2048)
.HasColumnType("TEXT")
.HasComment("Дополнительная информация о пробе");
b.Property<double?>("SampleMass")
.HasColumnType("REAL")
.HasComment("Масса пробы (кг)");
b.Property<string>("SampleName")
.HasMaxLength(512)
.HasColumnType("TEXT")
.HasComment("Название пробы");
b.Property<DateTime?>("SamplingDateTime")
.HasColumnType("TEXT")
.HasComment("Дата и время отбора пробы");
b.Property<string>("SamplingPlace")
.HasMaxLength(512)
.HasColumnType("TEXT")
.HasComment("Место отбора пробы");
b.HasKey("Id");
b.ToTable("CalibrationRecords");
});
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.ImageRecord", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasComment("Уникальный идентификатор");
b.Property<int?>("CalibrationRecordId")
.HasColumnType("INTEGER");
b.Property<int?>("CalibrationRecordId1")
.HasColumnType("INTEGER");
b.Property<string>("ImagePath")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("TEXT")
.HasComment("Путь к файлу изображения");
b.Property<string>("ImageType")
.IsRequired()
.HasColumnType("TEXT")
.HasComment("Тип изображения (sample - проба или separator - сепаратор)");
b.Property<int?>("SeparatorRecordId")
.HasColumnType("INTEGER");
b.Property<int?>("TrayRecordId")
.HasColumnType("INTEGER");
b.Property<double>("Uv254Intensity")
.HasColumnType("REAL")
@@ -48,132 +113,91 @@ namespace GSS2.Core.Analysis.AmineContent.Database
b.HasKey("Id");
b.ToTable("Images");
b.HasIndex("CalibrationRecordId");
b.HasIndex("CalibrationRecordId1");
b.HasIndex("SeparatorRecordId");
b.HasIndex("TrayRecordId");
b.ToTable("ImageRecords");
});
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.AmineContentCalibrationContext+Record", b =>
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasComment("Уникальный идентификатор");
b.Property<double>("AirHumidity")
.HasColumnType("REAL")
.HasComment("Относительная влажность воздуха (%)");
b.Property<double>("AirTemperature")
.HasColumnType("REAL")
.HasComment("Температура воздуха (℃)");
b.Property<double>("MixtureActualRate")
.HasColumnType("REAL")
.HasComment("Истинный расход кондиционирующей смеси (кг/т)");
b.Property<double>("MixtureAmineContent")
.HasColumnType("REAL")
.HasComment("Содержание аминов в кондиционирующей смеси (%)");
b.Property<string>("MixtureName")
b.Property<string>("Batch")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT")
.HasComment("Название используемой кондиционирующей смеси");
.HasComment("Партия сепаратора");
b.Property<double>("MixtureNormalRate")
.HasColumnType("REAL")
.HasComment("Норма расхода кондиционирующей смеси (кг/т)");
b.Property<string>("SampleBrand")
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT")
.HasComment("Марка пробы");
b.Property<string>("SampleComment")
.IsRequired()
.HasColumnType("TEXT")
.HasComment("Дополнительная информация о пробе");
b.Property<double>("SampleMass")
.HasColumnType("REAL")
.HasComment("Масса пробы (кг)");
b.Property<string>("SampleName")
.IsRequired()
.HasColumnType("TEXT")
.HasComment("Название пробы");
b.Property<DateTime>("SamplingDateTime")
.HasColumnType("TEXT")
.HasComment("Дата и время отбора пробы");
b.Property<string>("SamplingPlace")
.IsRequired()
.HasColumnType("TEXT")
.HasComment("Место отбора пробы");
.HasComment("Тип сепаратора");
b.HasKey("Id");
b.ToTable("Records");
b.ToTable("SeparatorRecords");
});
modelBuilder.Entity("ImageDataRecord", b =>
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.TrayRecord", b =>
{
b.Property<int>("SampleImagesId")
.HasColumnType("INTEGER");
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasComment("Уникальный идентификатор");
b.Property<int>("SampleRecordsId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasKey("SampleImagesId", "SampleRecordsId");
b.HasIndex("SampleRecordsId");
b.ToTable("SampleImages", (string)null);
b.ToTable("TrayRecords");
});
modelBuilder.Entity("ImageDataRecord1", b =>
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.ImageRecord", b =>
{
b.Property<int>("SeparatorImagesId")
.HasColumnType("INTEGER");
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", null)
.WithMany("SampleImages")
.HasForeignKey("CalibrationRecordId")
.OnDelete(DeleteBehavior.Cascade);
b.Property<int>("SeparatorRecordsId")
.HasColumnType("INTEGER");
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", null)
.WithMany("SeparatorImages")
.HasForeignKey("CalibrationRecordId1")
.OnDelete(DeleteBehavior.Cascade);
b.HasKey("SeparatorImagesId", "SeparatorRecordsId");
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", null)
.WithMany("Images")
.HasForeignKey("SeparatorRecordId")
.OnDelete(DeleteBehavior.Cascade);
b.HasIndex("SeparatorRecordsId");
b.ToTable("SeparatorImages", (string)null);
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.TrayRecord", null)
.WithMany("Images")
.HasForeignKey("TrayRecordId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("ImageDataRecord", b =>
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", b =>
{
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.AmineContentCalibrationContext+ImageData", null)
.WithMany()
.HasForeignKey("SampleImagesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("SampleImages");
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.AmineContentCalibrationContext+Record", null)
.WithMany()
.HasForeignKey("SampleRecordsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("SeparatorImages");
});
modelBuilder.Entity("ImageDataRecord1", b =>
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", b =>
{
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.AmineContentCalibrationContext+ImageData", null)
.WithMany()
.HasForeignKey("SeparatorImagesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Images");
});
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.AmineContentCalibrationContext+Record", null)
.WithMany()
.HasForeignKey("SeparatorRecordsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.TrayRecord", b =>
{
b.Navigation("Images");
});
#pragma warning restore 612, 618
}
@@ -0,0 +1,33 @@
using Microsoft.EntityFrameworkCore;
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration;
public record CalibrationRecord
{
[Comment("Уникальный идентификатор")]
public int Id { get; set; }
[Comment("Название пробы")]
public required string? SampleName { get; init; }
[Comment("Дополнительная информация о пробе")]
public required string? SampleComment { get; init; }
[Comment("Марка пробы")]
public required string? SampleBrand { get; init; }
[Comment("Масса пробы (кг)")]
public required double? SampleMass { get; init; }
[Comment("Дата и время отбора пробы")]
public required DateTime? SamplingDateTime { get; init; }
[Comment("Место отбора пробы")]
public required string? SamplingPlace { get; init; }
[Comment("Название используемой кондиционирующей смеси")]
public required string? MixtureName { get; init; }
[Comment("Содержание аминов в кондиционирующей смеси (%)")]
public required double? MixtureAmineContent { get; init; }
[Comment("Норма расхода кондиционирующей смеси (кг/т)")]
public required double? MixtureNormalRate { get; init; }
[Comment("Фактический расход кондиционирующей смеси (кг/т)")]
public required double? MixtureActualRate { get; init; }
[Comment("Изображения пробы")]
public required List<ImageRecord> SampleImages { get; init; }
[Comment("Изображения пустого сепаратора")]
public required List<ImageRecord> SeparatorImages { get; init; }
}
@@ -0,0 +1,17 @@
using Microsoft.EntityFrameworkCore;
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration;
public record ImageRecord
{
[Comment("Уникальный идентификатор")]
public int Id { get; set; }
[Comment("Интенсивность видимого света (0..1)")]
public required double VisibleIntensity { get; init; }
[Comment("Интенсивность УФ излучения 365 нм (0..1)")]
public required double Uv365Intensity { get; init; }
[Comment("Интенсивность УФ излучения 254 нм (0..1)")]
public required double Uv254Intensity { get; init; }
[Comment("Путь к файлу изображения")]
public required string ImagePath { get; init; }
}
@@ -0,0 +1,15 @@
using Microsoft.EntityFrameworkCore;
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration;
public record SeparatorRecord
{
[Comment("Уникальный идентификатор")]
public int Id { get; set; }
[Comment("Тип сепаратора")]
public required string Type { get; init; }
[Comment("Партия сепаратора")]
public required string Batch { get; init; }
[Comment("Изображения сепаратора")]
public required List<ImageRecord> Images { get; init; }
}
@@ -0,0 +1,11 @@
using Microsoft.EntityFrameworkCore;
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration;
public record TrayRecord
{
[Comment("Уникальный идентификатор")]
public int Id { get; set; }
[Comment("Изображения лотка")]
public required List<ImageRecord> Images { get; init; }
}
@@ -1,6 +1,6 @@
// <auto-generated />
using System;
using GSS2.Core.Analysis.AmineContent.Database;
using GSS2.Core.Analysis.AmineContent.Database.Results;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
@@ -8,10 +8,10 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace GSS2.Core.Analysis.AmineContent.Database
namespace GSS2.Core.Analysis.AmineContent.Database.Results
{
[DbContext(typeof(AmineContentResultsContext))]
[Migration("20251208044924_AmineContentResultsInitial")]
[Migration("20260227055822_AmineContentResultsInitial")]
partial class AmineContentResultsInitial
{
/// <inheritdoc />
@@ -20,7 +20,7 @@ namespace GSS2.Core.Analysis.AmineContent.Database
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.0");
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.AmineContentResultsContext+ImageData", b =>
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Results.AmineContentResultsContext+ImageData", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -54,7 +54,7 @@ namespace GSS2.Core.Analysis.AmineContent.Database
b.ToTable("Images");
});
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.AmineContentResultsContext+Record", b =>
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Results.AmineContentResultsContext+Record", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -134,13 +134,13 @@ namespace GSS2.Core.Analysis.AmineContent.Database
modelBuilder.Entity("ImageDataRecord", b =>
{
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.AmineContentResultsContext+ImageData", null)
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Results.AmineContentResultsContext+ImageData", null)
.WithMany()
.HasForeignKey("SampleImagesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.AmineContentResultsContext+Record", null)
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Results.AmineContentResultsContext+Record", null)
.WithMany()
.HasForeignKey("SampleRecordsId")
.OnDelete(DeleteBehavior.Cascade)
@@ -149,13 +149,13 @@ namespace GSS2.Core.Analysis.AmineContent.Database
modelBuilder.Entity("ImageDataRecord1", b =>
{
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.AmineContentResultsContext+ImageData", null)
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Results.AmineContentResultsContext+ImageData", null)
.WithMany()
.HasForeignKey("SeparatorImagesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.AmineContentResultsContext+Record", null)
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Results.AmineContentResultsContext+Record", null)
.WithMany()
.HasForeignKey("SeparatorRecordsId")
.OnDelete(DeleteBehavior.Cascade)
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace GSS2.Core.Analysis.AmineContent.Database
namespace GSS2.Core.Analysis.AmineContent.Database.Results
{
/// <inheritdoc />
public partial class AmineContentResultsInitial : Migration
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
namespace GSS2.Core.Analysis.AmineContent.Database;
namespace GSS2.Core.Analysis.AmineContent.Database.Results;
public class AmineContentResultsContext : DbContext
{
@@ -1,7 +1,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
namespace GSS2.Core.Analysis.AmineContent.Database;
namespace GSS2.Core.Analysis.AmineContent.Database.Results;
public class AmineContentResultsContextFactory : IDesignTimeDbContextFactory<AmineContentResultsContext>
{
@@ -1,13 +1,13 @@
// <auto-generated />
using System;
using GSS2.Core.Analysis.AmineContent.Database;
using GSS2.Core.Analysis.AmineContent.Database.Results;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace GSS2.Core.Analysis.AmineContent.Database
namespace GSS2.Core.Analysis.AmineContent.Database.Results
{
[DbContext(typeof(AmineContentResultsContext))]
partial class AmineContentResultsContextModelSnapshot : ModelSnapshot
@@ -17,7 +17,7 @@ namespace GSS2.Core.Analysis.AmineContent.Database
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.0");
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.AmineContentResultsContext+ImageData", b =>
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Results.AmineContentResultsContext+ImageData", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -51,7 +51,7 @@ namespace GSS2.Core.Analysis.AmineContent.Database
b.ToTable("Images");
});
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.AmineContentResultsContext+Record", b =>
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Results.AmineContentResultsContext+Record", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -131,13 +131,13 @@ namespace GSS2.Core.Analysis.AmineContent.Database
modelBuilder.Entity("ImageDataRecord", b =>
{
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.AmineContentResultsContext+ImageData", null)
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Results.AmineContentResultsContext+ImageData", null)
.WithMany()
.HasForeignKey("SampleImagesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.AmineContentResultsContext+Record", null)
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Results.AmineContentResultsContext+Record", null)
.WithMany()
.HasForeignKey("SampleRecordsId")
.OnDelete(DeleteBehavior.Cascade)
@@ -146,13 +146,13 @@ namespace GSS2.Core.Analysis.AmineContent.Database
modelBuilder.Entity("ImageDataRecord1", b =>
{
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.AmineContentResultsContext+ImageData", null)
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Results.AmineContentResultsContext+ImageData", null)
.WithMany()
.HasForeignKey("SeparatorImagesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.AmineContentResultsContext+Record", null)
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Results.AmineContentResultsContext+Record", null)
.WithMany()
.HasForeignKey("SeparatorRecordsId")
.OnDelete(DeleteBehavior.Cascade)
+2 -1
View File
@@ -5,7 +5,8 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using GSS2.Core.Hardware;
using GSS2.Core.Analysis.AmineContent.Database;
using GSS2.Core.Analysis.AmineContent.Database.Calibration;
using GSS2.Core.Analysis.AmineContent.Database.Results;
namespace GSS2.Core;
+2 -2
View File
@@ -1,2 +1,2 @@
dotnet ef migrations add -o .\Analysis\AmineContent\Database --project .\GSS2.Core\ AmineContentCalibrationInitial --context AmineContentCalibrationContext
dotnet ef migrations add -o .\Analysis\AmineContent\Database --project .\GSS2.Core\ AmineContentResultsInitial --context AmineContentResultsContext
dotnet ef migrations add -o .\Analysis\AmineContent\Database\Calibration --project .\GSS2.Core\ AmineContentCalibrationInitial --context AmineContentCalibrationContext
dotnet ef migrations add -o .\Analysis\AmineContent\Database\Results --project .\GSS2.Core\ AmineContentResultsInitial --context AmineContentResultsContext
+2
View File
@@ -0,0 +1,2 @@
dotnet ef migrations add -o ./Analysis/AmineContent/Database/Calibration --project ./GSS2.Core/ AmineContentCalibrationInitial --context AmineContentCalibrationContext
dotnet ef migrations add -o ./Analysis/AmineContent/Database/Results --project ./GSS2.Core/ AmineContentResultsInitial --context AmineContentResultsContext
+2 -1
View File
@@ -8,7 +8,8 @@ using Avalonia.OpenGL.Egl;
using GSS2.Core;
using GSS2.Core.Logging;
using GSS2.Core.Analysis.AmineContent.Database;
using GSS2.Core.Analysis.AmineContent.Database.Calibration;
using GSS2.Core.Analysis.AmineContent.Database.Results;
using ConsoleFormatter = GSS2.Core.Logging.ConsoleFormatter;