//
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("20251003164320_TeamIdentifier")]
partial class TeamIdentifier
{
///
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("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("ChapterEligibilityCountRegionals")
.HasColumnType("INTEGER");
b.Property("ChapterEligibilityCountState")
.HasColumnType("INTEGER");
b.Property("Description")
.HasMaxLength(1024)
.HasColumnType("TEXT");
b.Property("Documentation")
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property("Eligibility")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property("EventFormat")
.HasColumnType("INTEGER");
b.Property("LevelOfEffort")
.HasColumnType("INTEGER");
b.Property("MaxTeamSize")
.HasColumnType("INTEGER");
b.Property("MinTeamSize")
.HasColumnType("INTEGER");
b.Property("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property("Notes")
.HasMaxLength(1024)
.HasColumnType("TEXT");
b.Property("OnSiteActivity")
.HasColumnType("INTEGER");
b.Property("Presubmission")
.HasColumnType("INTEGER");
b.Property("SemifinalistActivity")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("ShortName")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("TEXT");
b.Property("Theme")
.HasMaxLength(4096)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Name");
b.ToTable("Events");
});
modelBuilder.Entity("Core.Entities.Student", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("Email")
.HasColumnType("TEXT");
b.Property("FirstName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("Grade")
.HasColumnType("INTEGER");
b.Property("LastName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("NationalId")
.HasColumnType("TEXT");
b.Property("OfficerRole")
.HasColumnType("INTEGER");
b.Property("PhoneNumber")
.HasColumnType("TEXT");
b.Property("RegionalId")
.HasColumnType("TEXT");
b.Property("StateId")
.HasColumnType("TEXT");
b.Property("TsaYear")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("Students");
});
modelBuilder.Entity("Core.Entities.StudentEventRanking", b =>
{
b.Property("EventDefinitionId")
.HasColumnType("INTEGER");
b.Property("StudentId")
.HasColumnType("INTEGER");
b.Property("Rank")
.HasColumnType("INTEGER");
b.HasKey("EventDefinitionId", "StudentId");
b.HasIndex("StudentId");
b.ToTable("StudentEventRanking");
});
modelBuilder.Entity("Core.Entities.Team", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("CaptainId")
.HasColumnType("INTEGER");
b.Property("EventId")
.HasColumnType("INTEGER");
b.Property("Identifier")
.HasMaxLength(32)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CaptainId");
b.HasIndex("EventId");
b.ToTable("Teams");
});
modelBuilder.Entity("StudentTeam", b =>
{
b.Property("StudentsId")
.HasColumnType("INTEGER");
b.Property("TeamsId")
.HasColumnType("INTEGER");
b.HasKey("StudentsId", "TeamsId");
b.HasIndex("TeamsId");
b.ToTable("StudentTeam");
});
modelBuilder.Entity("Core.Entities.StudentEventRanking", b =>
{
b.HasOne("Core.Entities.EventDefinition", "EventDefinition")
.WithMany()
.HasForeignKey("EventDefinitionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Core.Entities.Student", "Student")
.WithMany("EventRankings")
.HasForeignKey("StudentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("EventDefinition");
b.Navigation("Student");
});
modelBuilder.Entity("Core.Entities.Team", b =>
{
b.HasOne("Core.Entities.Student", "Captain")
.WithMany()
.HasForeignKey("CaptainId");
b.HasOne("Core.Entities.EventDefinition", "Event")
.WithMany()
.HasForeignKey("EventId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Captain");
b.Navigation("Event");
});
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();
});
modelBuilder.Entity("Core.Entities.Student", b =>
{
b.Navigation("EventRankings");
});
#pragma warning restore 612, 618
}
}
}