Models-Phi-8B/PHI.Data.Generator/RLHF.Generator/Persistence/Migrations/RlhfGeneratorDbContextModel...

321 lines
11 KiB
C#

// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RLHF.Generator.Persistence;
#nullable disable
namespace RLHF.Generator.Persistence.Migrations
{
[DbContext(typeof(RlhfGeneratorDbContext))]
partial class RlhfGeneratorDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("RLHF.Generator.Persistence.Category", b =>
{
b.Property<int>("Id")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(128)");
b.HasKey("Id");
b.ToTable("Category", "dbo");
b.HasData(
new
{
Id = 1,
Name = "MEDICAL_ALLERGY"
},
new
{
Id = 2,
Name = "MEDICAL_DIAGNOSIS"
},
new
{
Id = 3,
Name = "MEDICAL_FAMILY_HISTORY"
},
new
{
Id = 4,
Name = "MEDICAL_MEDICATION"
},
new
{
Id = 5,
Name = "MEDICAL_MENTAL_HEALTH"
},
new
{
Id = 6,
Name = "MEDICAL_OTHER"
},
new
{
Id = 7,
Name = "MEDICAL_PHYSICAL_HEALTH"
},
new
{
Id = 8,
Name = "MEDICAL_PROCEDURE"
},
new
{
Id = 9,
Name = "MEDICAL_SUBSTANCE_USE"
},
new
{
Id = 10,
Name = "MEDICAL_SYMPTOM"
},
new
{
Id = 11,
Name = "MEDICAL_TEST"
},
new
{
Id = 12,
Name = "MEDICAL_TREATMENT"
});
});
modelBuilder.Entity("RLHF.Generator.Persistence.GenerationRun", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<DateTimeOffset?>("CompletedAt")
.HasColumnType("datetimeoffset");
b.Property<string>("ConfigurationFingerprint")
.IsRequired()
.HasColumnType("char(64)");
b.Property<int?>("CurrentCategoryId")
.HasColumnType("int");
b.Property<bool?>("CurrentIsPositive")
.HasColumnType("bit");
b.Property<string>("FailureMessage")
.HasColumnType("nvarchar(1024)");
b.Property<string>("FailureType")
.HasColumnType("nvarchar(256)");
b.Property<string>("InputFingerprint")
.IsRequired()
.HasColumnType("char(64)");
b.Property<DateTimeOffset>("LastCheckpointAt")
.HasColumnType("datetimeoffset");
b.Property<long>("LastCommittedPlanOrdinal")
.HasColumnType("bigint");
b.Property<int>("RandomSeed")
.HasColumnType("int");
b.Property<DateTimeOffset>("StartedAt")
.HasColumnType("datetimeoffset");
b.Property<string>("Status")
.IsRequired()
.HasColumnType("nvarchar(16)");
b.Property<int>("TotalCommittedRowCount")
.HasColumnType("int");
b.Property<int>("TotalExpectedRowCount")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CurrentCategoryId");
b.HasIndex("Status");
b.ToTable("GenerationRun", "dbo");
});
modelBuilder.Entity("RLHF.Generator.Persistence.Keyword", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CategoryId")
.HasColumnType("int");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(450)
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("CategoryId", "Value")
.IsUnique();
b.ToTable("Keyword", "dbo");
});
modelBuilder.Entity("RLHF.Generator.Persistence.KeywordVariant", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ParentId")
.HasColumnType("int");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(450)
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("ParentId", "Value")
.IsUnique();
b.ToTable("KeywordVariant", "dbo");
});
modelBuilder.Entity("RLHF.Generator.Persistence.TrainingItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CategoryId")
.HasColumnType("int");
b.Property<Guid?>("GenerationRunId")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsPositive")
.HasColumnType("bit");
b.Property<int?>("KeywordId")
.HasColumnType("int");
b.Property<long?>("PlanOrdinal")
.HasColumnType("bigint");
b.Property<string>("RecordKey")
.HasColumnType("char(64)");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CategoryId");
b.HasIndex("KeywordId");
b.HasIndex("RecordKey")
.IsUnique()
.HasFilter("[RecordKey] IS NOT NULL");
b.HasIndex("GenerationRunId", "PlanOrdinal")
.IsUnique()
.HasFilter("[GenerationRunId] IS NOT NULL AND [PlanOrdinal] IS NOT NULL");
b.ToTable("TrainingItem", "dbo");
});
modelBuilder.Entity("RLHF.Generator.Persistence.GenerationRun", b =>
{
b.HasOne("RLHF.Generator.Persistence.Category", null)
.WithMany()
.HasForeignKey("CurrentCategoryId")
.OnDelete(DeleteBehavior.Restrict);
});
modelBuilder.Entity("RLHF.Generator.Persistence.Keyword", b =>
{
b.HasOne("RLHF.Generator.Persistence.Category", "Category")
.WithMany("Keywords")
.HasForeignKey("CategoryId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Category");
});
modelBuilder.Entity("RLHF.Generator.Persistence.KeywordVariant", b =>
{
b.HasOne("RLHF.Generator.Persistence.Keyword", "Parent")
.WithMany("Variants")
.HasForeignKey("ParentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Parent");
});
modelBuilder.Entity("RLHF.Generator.Persistence.TrainingItem", b =>
{
b.HasOne("RLHF.Generator.Persistence.Category", null)
.WithMany()
.HasForeignKey("CategoryId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("RLHF.Generator.Persistence.GenerationRun", null)
.WithMany()
.HasForeignKey("GenerationRunId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("RLHF.Generator.Persistence.Keyword", "Keyword")
.WithMany("TrainingItems")
.HasForeignKey("KeywordId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Keyword");
});
modelBuilder.Entity("RLHF.Generator.Persistence.Category", b =>
{
b.Navigation("Keywords");
});
modelBuilder.Entity("RLHF.Generator.Persistence.Keyword", b =>
{
b.Navigation("TrainingItems");
b.Navigation("Variants");
});
#pragma warning restore 612, 618
}
}
}