// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using DiunaBI.Domain.Entities; using DiunaBI.Infrastructure.Data; #nullable disable namespace DiunaBI.Infrastructure.Migrations { [DbContext(typeof(AppDbContext))] [Migration("20230106095427_RenameModels")] partial class RenameModels { /// protected void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "7.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); modelBuilder.Entity("WebAPI.Models.Layer", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedById") .HasColumnType("uniqueidentifier"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("ModifiedAt") .HasColumnType("datetime2"); b.Property("ModifiedById") .HasColumnType("uniqueidentifier"); b.Property("Name") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("Number") .IsRequired() .HasColumnType("int"); b.Property("Source") .IsRequired() .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("CreatedById"); b.HasIndex("ModifiedById"); b.ToTable("Layers"); }); modelBuilder.Entity("WebAPI.Models.Record", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("Code") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("CreatedById") .HasColumnType("uniqueidentifier"); b.Property("Desc1") .HasColumnType("nvarchar(max)"); b.Property("Desc2") .HasColumnType("nvarchar(max)"); b.Property("Desc3") .HasColumnType("nvarchar(max)"); b.Property("Desc4") .HasColumnType("nvarchar(max)"); b.Property("Desc5") .HasColumnType("nvarchar(max)"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("LayerId") .HasColumnType("uniqueidentifier"); b.Property("ModifiedAt") .HasColumnType("datetime2"); b.Property("ModifiedById") .HasColumnType("uniqueidentifier"); b.Property("Value") .HasColumnType("real"); b.HasKey("Id"); b.HasIndex("CreatedById"); b.HasIndex("LayerId"); b.HasIndex("ModifiedById"); b.ToTable("Records"); }); modelBuilder.Entity("WebAPI.Models.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("CreatedAt") .HasColumnType("datetime2"); b.Property("Email") .HasColumnType("nvarchar(max)"); b.Property("UserName") .HasMaxLength(50) .HasColumnType("nvarchar(50)"); b.HasKey("Id"); b.ToTable("Users"); }); modelBuilder.Entity("WebAPI.Models.Layer", b => { b.HasOne("WebAPI.Models.User", "CreatedBy") .WithMany() .HasForeignKey("CreatedById") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("WebAPI.Models.User", "ModifiedBy") .WithMany() .HasForeignKey("ModifiedById") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("CreatedBy"); b.Navigation("ModifiedBy"); }); modelBuilder.Entity("WebAPI.Models.Record", b => { b.HasOne("WebAPI.Models.User", "CreatedBy") .WithMany() .HasForeignKey("CreatedById") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("WebAPI.Models.Layer", null) .WithMany("Records") .HasForeignKey("LayerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("WebAPI.Models.User", "ModifiedBy") .WithMany() .HasForeignKey("ModifiedById") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("CreatedBy"); b.Navigation("ModifiedBy"); }); modelBuilder.Entity("WebAPI.Models.Layer", b => { b.Navigation("Records"); }); #pragma warning restore 612, 618 } } }