forked from amkovkov/GranuSightSoftware2
feat: update db, move autogen db slop to subdir
This commit is contained in:
+5
-5
@@ -28,8 +28,8 @@ public class AmineContentCalibrationContext : DbContext
|
||||
{
|
||||
entity.HasKey(x => x.Id);
|
||||
entity.HasMany(x => x.Images)
|
||||
.WithOne(x => x.Separator)
|
||||
.HasForeignKey(x => x.SeparatorRecordId)
|
||||
.WithOne(x => x.UsedInSeparatorRecord)
|
||||
.HasForeignKey(x => x.UsedInSeparatorRecordId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
entity.Property(x => x.Type)
|
||||
.IsRequired()
|
||||
@@ -43,11 +43,11 @@ public class AmineContentCalibrationContext : DbContext
|
||||
{
|
||||
entity.HasKey(x => x.Id);
|
||||
entity.HasMany(x => x.SampleImages)
|
||||
.WithOne(x => x.CalibrationSample)
|
||||
.HasForeignKey(x => x.CalibrationSampleId)
|
||||
.WithOne(x => x.UsedInCalibrationRecordSample)
|
||||
.HasForeignKey(x => x.UsedInCalibrationRecordSampleId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
entity.HasMany(x => x.SeparatorImages)
|
||||
.WithMany(x => x.UsedInCalibrations)
|
||||
.WithMany(x => x.UsedInCalibrationRecordsSeparator)
|
||||
.UsingEntity<Dictionary<string, object>>(
|
||||
"CalibrationSeparatorImage",
|
||||
j => j
|
||||
|
||||
@@ -26,7 +26,7 @@ public record CalibrationRecord
|
||||
public required double? MixtureNormalRate { get; set; }
|
||||
[Comment("Фактический расход кондиционирующей смеси (кг/т | гр/кг)")]
|
||||
public required double? MixtureActualRate { get; set; }
|
||||
[Comment("Измеренное колличество масла (кг/т | гр/кг)")]
|
||||
[Comment("Измеренное количество масла (кг/т | гр/кг)")]
|
||||
public required double? MeasuredContent { get; set; }
|
||||
[Comment("Изображения пробы")]
|
||||
public required List<ImageRecord> SampleImages { get; set; }
|
||||
|
||||
@@ -16,12 +16,12 @@ public record ImageRecord
|
||||
public required string ImagePath { get; set; }
|
||||
|
||||
// 1:N
|
||||
public int? SeparatorRecordId { get; set; }
|
||||
public SeparatorRecord? Separator { get; set; }
|
||||
public int? UsedInSeparatorRecordId { get; set; }
|
||||
public SeparatorRecord? UsedInSeparatorRecord { get; set; }
|
||||
|
||||
public int? CalibrationSampleId { get; set; }
|
||||
public CalibrationRecord? CalibrationSample { get; set; }
|
||||
public int? UsedInCalibrationRecordSampleId { get; set; }
|
||||
public CalibrationRecord? UsedInCalibrationRecordSample { get; set; }
|
||||
|
||||
// M:N
|
||||
public List<CalibrationRecord> UsedInCalibrations { get; set; } = new();
|
||||
public List<CalibrationRecord> UsedInCalibrationRecordsSeparator { get; set; } = new();
|
||||
}
|
||||
|
||||
+16
-16
@@ -8,11 +8,11 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
|
||||
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration.Migrations
|
||||
{
|
||||
[DbContext(typeof(AmineContentCalibrationContext))]
|
||||
[Migration("20260303084152_AmineContentCalibrationInitial")]
|
||||
partial class AmineContentCalibrationInitial
|
||||
[Migration("20260313083001_AmineContentCalibration0")]
|
||||
partial class AmineContentCalibration0
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@@ -44,7 +44,7 @@ namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
|
||||
|
||||
b.Property<double?>("MeasuredContent")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Измеренное колличество масла (кг/т | гр/кг)");
|
||||
.HasComment("Измеренное количество масла (кг/т | гр/кг)");
|
||||
|
||||
b.Property<double?>("MixtureActualRate")
|
||||
.HasColumnType("REAL")
|
||||
@@ -103,16 +103,16 @@ namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
|
||||
.HasColumnType("INTEGER")
|
||||
.HasComment("Уникальный идентификатор");
|
||||
|
||||
b.Property<int?>("CalibrationSampleId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("ImagePath")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1024)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Путь к файлу изображения");
|
||||
|
||||
b.Property<int?>("SeparatorRecordId")
|
||||
b.Property<int?>("UsedInCalibrationRecordSampleId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("UsedInSeparatorRecordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<double>("Uv254Intensity")
|
||||
@@ -129,9 +129,9 @@ namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CalibrationSampleId");
|
||||
b.HasIndex("UsedInCalibrationRecordSampleId");
|
||||
|
||||
b.HasIndex("SeparatorRecordId");
|
||||
b.HasIndex("UsedInSeparatorRecordId");
|
||||
|
||||
b.ToTable("ImageRecords");
|
||||
});
|
||||
@@ -177,19 +177,19 @@ namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
|
||||
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.ImageRecord", b =>
|
||||
{
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", "CalibrationSample")
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", "UsedInCalibrationRecordSample")
|
||||
.WithMany("SampleImages")
|
||||
.HasForeignKey("CalibrationSampleId")
|
||||
.HasForeignKey("UsedInCalibrationRecordSampleId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", "Separator")
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", "UsedInSeparatorRecord")
|
||||
.WithMany("Images")
|
||||
.HasForeignKey("SeparatorRecordId")
|
||||
.HasForeignKey("UsedInSeparatorRecordId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.Navigation("CalibrationSample");
|
||||
b.Navigation("UsedInCalibrationRecordSample");
|
||||
|
||||
b.Navigation("Separator");
|
||||
b.Navigation("UsedInSeparatorRecord");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", b =>
|
||||
+13
-13
@@ -3,10 +3,10 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
|
||||
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AmineContentCalibrationInitial : Migration
|
||||
public partial class AmineContentCalibration0 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
@@ -27,7 +27,7 @@ namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
|
||||
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: "Фактический расход кондиционирующей смеси (кг/т | гр/кг)"),
|
||||
MeasuredContent = table.Column<double>(type: "REAL", nullable: true, comment: "Измеренное колличество масла (кг/т | гр/кг)")
|
||||
MeasuredContent = table.Column<double>(type: "REAL", nullable: true, comment: "Измеренное количество масла (кг/т | гр/кг)")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -58,21 +58,21 @@ namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
|
||||
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: "Путь к файлу изображения"),
|
||||
SeparatorRecordId = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
CalibrationSampleId = table.Column<int>(type: "INTEGER", nullable: true)
|
||||
UsedInSeparatorRecordId = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
UsedInCalibrationRecordSampleId = table.Column<int>(type: "INTEGER", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ImageRecords", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ImageRecords_CalibrationRecords_CalibrationSampleId",
|
||||
column: x => x.CalibrationSampleId,
|
||||
name: "FK_ImageRecords_CalibrationRecords_UsedInCalibrationRecordSampleId",
|
||||
column: x => x.UsedInCalibrationRecordSampleId,
|
||||
principalTable: "CalibrationRecords",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_ImageRecords_SeparatorRecords_SeparatorRecordId",
|
||||
column: x => x.SeparatorRecordId,
|
||||
name: "FK_ImageRecords_SeparatorRecords_UsedInSeparatorRecordId",
|
||||
column: x => x.UsedInSeparatorRecordId,
|
||||
principalTable: "SeparatorRecords",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
@@ -108,14 +108,14 @@ namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
|
||||
column: "ImageRecordId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ImageRecords_CalibrationSampleId",
|
||||
name: "IX_ImageRecords_UsedInCalibrationRecordSampleId",
|
||||
table: "ImageRecords",
|
||||
column: "CalibrationSampleId");
|
||||
column: "UsedInCalibrationRecordSampleId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ImageRecords_SeparatorRecordId",
|
||||
name: "IX_ImageRecords_UsedInSeparatorRecordId",
|
||||
table: "ImageRecords",
|
||||
column: "SeparatorRecordId");
|
||||
column: "UsedInSeparatorRecordId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
+14
-14
@@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
|
||||
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration.Migrations
|
||||
{
|
||||
[DbContext(typeof(AmineContentCalibrationContext))]
|
||||
partial class AmineContentCalibrationContextModelSnapshot : ModelSnapshot
|
||||
@@ -41,7 +41,7 @@ namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
|
||||
|
||||
b.Property<double?>("MeasuredContent")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Измеренное колличество масла (кг/т | гр/кг)");
|
||||
.HasComment("Измеренное количество масла (кг/т | гр/кг)");
|
||||
|
||||
b.Property<double?>("MixtureActualRate")
|
||||
.HasColumnType("REAL")
|
||||
@@ -100,16 +100,16 @@ namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
|
||||
.HasColumnType("INTEGER")
|
||||
.HasComment("Уникальный идентификатор");
|
||||
|
||||
b.Property<int?>("CalibrationSampleId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("ImagePath")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1024)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Путь к файлу изображения");
|
||||
|
||||
b.Property<int?>("SeparatorRecordId")
|
||||
b.Property<int?>("UsedInCalibrationRecordSampleId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("UsedInSeparatorRecordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<double>("Uv254Intensity")
|
||||
@@ -126,9 +126,9 @@ namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CalibrationSampleId");
|
||||
b.HasIndex("UsedInCalibrationRecordSampleId");
|
||||
|
||||
b.HasIndex("SeparatorRecordId");
|
||||
b.HasIndex("UsedInSeparatorRecordId");
|
||||
|
||||
b.ToTable("ImageRecords");
|
||||
});
|
||||
@@ -174,19 +174,19 @@ namespace GSS2.Core.Analysis.AmineContent.Database.Calibration
|
||||
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.ImageRecord", b =>
|
||||
{
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", "CalibrationSample")
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", "UsedInCalibrationRecordSample")
|
||||
.WithMany("SampleImages")
|
||||
.HasForeignKey("CalibrationSampleId")
|
||||
.HasForeignKey("UsedInCalibrationRecordSampleId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", "Separator")
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", "UsedInSeparatorRecord")
|
||||
.WithMany("Images")
|
||||
.HasForeignKey("SeparatorRecordId")
|
||||
.HasForeignKey("UsedInSeparatorRecordId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.Navigation("CalibrationSample");
|
||||
b.Navigation("UsedInCalibrationRecordSample");
|
||||
|
||||
b.Navigation("Separator");
|
||||
b.Navigation("UsedInSeparatorRecord");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", b =>
|
||||
Reference in New Issue
Block a user