// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using UWLib;

#nullable disable

namespace UWLib.Migrations
{
    [DbContext(typeof(LectureContext))]
    [Migration("20241012140426_LinksToScrape")]
    partial class LinksToScrape
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder.HasAnnotation("ProductVersion", "8.0.10");

            modelBuilder.Entity("UWLib.Lecture", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Semester")
                        .HasColumnType("TEXT");

                    b.Property<string>("Branch")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Description")
                        .HasColumnType("TEXT");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Url")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("Id", "Semester");

                    b.ToTable("Lectures");
                });

            modelBuilder.Entity("UWLib.LectureEvent", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<DateTime>("From")
                        .HasColumnType("TEXT");

                    b.Property<int>("LectureId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("LectureSemester")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Location")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime>("To")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("LectureId", "LectureSemester");

                    b.ToTable("LectureEvents");
                });

            modelBuilder.Entity("UWLib.LinkToScrape", b =>
                {
                    b.Property<string>("Url")
                        .HasColumnType("TEXT");

                    b.Property<int>("Sort")
                        .HasColumnType("INTEGER");

                    b.HasKey("Url");

                    b.ToTable("LinksToScrape");
                });

            modelBuilder.Entity("UWLib.ScrapedLink", b =>
                {
                    b.Property<string>("Url")
                        .HasColumnType("TEXT");

                    b.Property<DateTime>("LastScrape")
                        .HasColumnType("TEXT");

                    b.HasKey("Url");

                    b.ToTable("ScrapedLinks");
                });

            modelBuilder.Entity("UWLib.LectureEvent", b =>
                {
                    b.HasOne("UWLib.Lecture", "Lecture")
                        .WithMany("Events")
                        .HasForeignKey("LectureId", "LectureSemester")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Lecture");
                });

            modelBuilder.Entity("UWLib.Lecture", b =>
                {
                    b.Navigation("Events");
                });
#pragma warning restore 612, 618
        }
    }
}
