//
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Hcs.WebApp.Data.Hcs.Migrations
{
[DbContext(typeof(HcsDbContext))]
[Migration("20251023092729_CreateHcsSchema")]
public partial class CreateHcsSchema
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.9")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.Operation", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("EndedAt")
.HasColumnType("datetime2");
b.Property("InitiatorId")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("MessageGuid")
.HasColumnType("nvarchar(max)");
b.Property("StartedAt")
.HasColumnType("datetime2");
b.Property("Type")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Operations");
});
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.Registry", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property("IsCommon")
.HasColumnType("bit");
b.Property("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Number")
.HasColumnType("int");
b.Property("UpdatedAt")
.HasColumnType("datetime2");
b.HasKey("Id");
b.ToTable("Registries");
});
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.RegistryElement", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("GUID")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("RegistryId")
.HasColumnType("uniqueidentifier");
b.Property("Xml")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("RegistryId");
b.ToTable("Elements");
});
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.RegistryElement", b =>
{
b.HasOne("Hcs.WebApp.Data.Hcs.Registry", "Registry")
.WithMany("Elements")
.HasForeignKey("RegistryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Registry");
});
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.Registry", b =>
{
b.Navigation("Elements");
});
#pragma warning restore 612, 618
}
}
}