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

#nullable disable

namespace Data.Migrations
{
    [DbContext(typeof(AppDbContext))]
    [Migration("20250825173042_InitialCreate")]
    partial class InitialCreate
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder.HasAnnotation("ProductVersion", "9.0.8");

            modelBuilder.Entity("Core.Entities.EventDefinition", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

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

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

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

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

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

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

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

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

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(128)
                        .HasColumnType("TEXT");

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

                    b.Property<bool>("RegionalEvent")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("RegionalPresubmit")
                        .HasColumnType("INTEGER");

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

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

                    b.Property<bool>("StatePreliminaryRound")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("StatePresubmission")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("StatePretesting")
                        .HasColumnType("INTEGER");

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

                    b.HasKey("Id");

                    b.HasIndex("Name");

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

            modelBuilder.Entity("Core.Entities.Student", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

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

                    b.HasKey("Id");

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

            modelBuilder.Entity("Core.Entities.Team", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

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

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

                    b.HasKey("Id");

                    b.HasIndex("CaptainId");

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

            modelBuilder.Entity("StudentTeam", b =>
                {
                    b.Property<int>("StudentsId")
                        .HasColumnType("INTEGER");

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

                    b.HasKey("StudentsId", "TeamsId");

                    b.HasIndex("TeamsId");

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

            modelBuilder.Entity("Core.Entities.Team", b =>
                {
                    b.HasOne("Core.Entities.Student", "Captain")
                        .WithMany()
                        .HasForeignKey("CaptainId");

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

            modelBuilder.Entity("StudentTeam", b =>
                {
                    b.HasOne("Core.Entities.Student", null)
                        .WithMany()
                        .HasForeignKey("StudentsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Core.Entities.Team", null)
                        .WithMany()
                        .HasForeignKey("TeamsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });
#pragma warning restore 612, 618
        }
    }
}
