Files
GSS2Rework/GSS2.Core/Analysis/AmineContent/Database/Context.cs
T
amkovkov 72ae26eee7 comprehensive update
1) remove unused components: camera view (due it causes segmentation faults), compute resources and all related, illuminator controller (due in useless without camera view), image storage service, temperature and humidity service
2) database schema - reduce tables references, features storing in records themselves in compressed form, add records creation and editing date and time, add separator comment column
3) analysis - rework of pipeline and ui, now database storing only raw data and all display values calculated from it
4) lights service - add reconnection if disconnected
5) add width and height command line arguments
6) fix some typos and other issues
2026-06-29 15:13:29 +03:00

28 lines
1.1 KiB
C#

using Microsoft.EntityFrameworkCore;
namespace GSS2.Core.Analysis.AmineContent.Database;
// TODO: Добавить внешние ключи в таблицы и правило что при удалении ключа ключ должен сбрасываться на 0
public class Context : DbContext
{
public DbSet<BrandRecord> BrandRecords => Set<BrandRecord>();
public DbSet<ImageRecord> ImageRecords => Set<ImageRecord>();
public DbSet<ResultRecord> ResultRecords => Set<ResultRecord>();
public DbSet<SeparatorRecord> SeparatorRecords => Set<SeparatorRecord>();
public DbSet<SampleRecord> SampleRecords => Set<SampleRecord>();
public Context(DbContextOptions<Context> options)
: base(options)
{ }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<SeparatorRecord>()
.Property(e => e.Features)
.HasConversion(new CompressedFloatListConverter());
modelBuilder.Entity<SampleRecord>()
.Property(e => e.Features)
.HasConversion(new CompressedFloatListConverter());
}
}