// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using StudyLib.API.Data; namespace StudyLib.Migrations { [DbContext(typeof(StudyLibContext))] [Migration("20201212153903_SubjectDeleteRequests")] partial class SubjectDeleteRequests { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .UseIdentityColumns() .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("ProductVersion", "5.0.0"); modelBuilder.Entity("StudyLib.API.Models.Comment", b => { b.Property("ID") .ValueGeneratedOnAdd() .HasColumnType("bigint") .UseIdentityColumn(); b.Property("SubjectId") .HasColumnType("bigint"); b.Property("Text") .IsRequired() .HasColumnType("nvarchar(max)"); b.HasKey("ID"); b.HasIndex("SubjectId"); b.ToTable("Comments"); }); modelBuilder.Entity("StudyLib.API.Models.SubjectDeleteRequest", b => { b.Property("ID") .ValueGeneratedOnAdd() .HasColumnType("bigint") .UseIdentityColumn(); b.Property("SubjectId") .HasColumnType("bigint"); b.HasKey("ID"); b.HasIndex("SubjectId"); b.ToTable("SubjectDeleteRequests"); }); modelBuilder.Entity("StudyLib.Models.Assignment", b => { b.Property("ID") .ValueGeneratedOnAdd() .HasColumnType("bigint") .UseIdentityColumn(); b.Property("Deadline") .HasColumnType("datetime2"); b.Property("Description") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("FinalMarkPercent") .HasColumnType("float"); b.Property("Name") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("SubjectId") .HasColumnType("bigint"); b.HasKey("ID"); b.HasIndex("SubjectId"); b.ToTable("Assignments"); }); modelBuilder.Entity("StudyLib.Models.Subject", b => { b.Property("ID") .ValueGeneratedOnAdd() .HasColumnType("bigint") .UseIdentityColumn(); b.Property("ExamDate") .HasColumnType("datetime2"); b.Property("LabTeacher") .HasColumnType("nvarchar(max)"); b.Property("LectureTeacher") .HasColumnType("nvarchar(max)"); b.Property("MainExam") .HasColumnType("bit"); b.Property("Name") .IsRequired() .HasColumnType("nvarchar(max)"); b.HasKey("ID"); b.ToTable("Subjects"); }); modelBuilder.Entity("StudyLib.Models.Test", b => { b.Property("ID") .ValueGeneratedOnAdd() .HasColumnType("bigint") .UseIdentityColumn(); b.Property("Date") .HasColumnType("datetime2"); b.Property("FinalMarkPercent") .HasColumnType("float"); b.Property("Scope") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("SubjectId") .HasColumnType("bigint"); b.HasKey("ID"); b.HasIndex("SubjectId"); b.ToTable("Tests"); }); modelBuilder.Entity("StudyLib.API.Models.Comment", b => { b.HasOne("StudyLib.Models.Subject", "Subject") .WithMany("Comments") .HasForeignKey("SubjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Subject"); }); modelBuilder.Entity("StudyLib.API.Models.SubjectDeleteRequest", b => { b.HasOne("StudyLib.Models.Subject", "Subject") .WithMany() .HasForeignKey("SubjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Subject"); }); modelBuilder.Entity("StudyLib.Models.Assignment", b => { b.HasOne("StudyLib.Models.Subject", "Subject") .WithMany("Assignments") .HasForeignKey("SubjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Subject"); }); modelBuilder.Entity("StudyLib.Models.Test", b => { b.HasOne("StudyLib.Models.Subject", "Subject") .WithMany("Tests") .HasForeignKey("SubjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Subject"); }); modelBuilder.Entity("StudyLib.Models.Subject", b => { b.Navigation("Assignments"); b.Navigation("Comments"); b.Navigation("Tests"); }); #pragma warning restore 612, 618 } } }