Event definiteion updates

This commit is contained in:
2025-09-26 11:33:25 -04:00
parent 1ea096469b
commit 688ca60511
17 changed files with 537 additions and 337 deletions
@@ -0,0 +1,257 @@
// <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("20250926142634_EventDefinition_Update")]
partial class EventDefinition_Update
{
/// <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<int>("ChapterEligibilityCountRegionals")
.HasColumnType("INTEGER");
b.Property<int>("ChapterEligibilityCountState")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasMaxLength(1024)
.HasColumnType("TEXT");
b.Property<string>("Documentation")
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<string>("Eligibility")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<int>("EventFormat")
.HasColumnType("INTEGER");
b.Property<int?>("LevelOfEffort")
.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")
.HasMaxLength(1024)
.HasColumnType("TEXT");
b.Property<bool>("OnSiteActivity")
.HasColumnType("INTEGER");
b.Property<bool>("Presubmission")
.HasColumnType("INTEGER");
b.Property<string>("SemifinalistActivity")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("ShortName")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("TEXT");
b.Property<string>("Theme")
.HasMaxLength(4096)
.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>("Email")
.HasColumnType("TEXT");
b.Property<string>("FirstName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("Grade")
.HasColumnType("INTEGER");
b.Property<string>("LastName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("NationalId")
.HasColumnType("TEXT");
b.Property<int?>("OfficerRole")
.HasColumnType("INTEGER");
b.Property<string>("PhoneNumber")
.HasColumnType("TEXT");
b.Property<string>("RegionalId")
.HasColumnType("TEXT");
b.Property<string>("StateId")
.HasColumnType("TEXT");
b.Property<int>("TsaYear")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("Students");
});
modelBuilder.Entity("Core.Entities.StudentEventRanking", b =>
{
b.Property<int>("EventDefinitionId")
.HasColumnType("INTEGER");
b.Property<int>("StudentId")
.HasColumnType("INTEGER");
b.Property<int>("Rank")
.HasColumnType("INTEGER");
b.HasKey("EventDefinitionId", "StudentId");
b.HasIndex("StudentId");
b.ToTable("StudentEventRanking");
});
modelBuilder.Entity("Core.Entities.Team", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int?>("CaptainId")
.HasColumnType("INTEGER");
b.Property<int>("EventId")
.HasColumnType("INTEGER");
b.Property<int?>("Number")
.HasColumnType("INTEGER");
b.Property<string>("TeamId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CaptainId");
b.HasIndex("EventId");
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.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
}
}
}
@@ -0,0 +1,100 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Data.Migrations
{
/// <inheritdoc />
public partial class EventDefinition_Update : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "MaxTeamCountState",
table: "Events");
migrationBuilder.DropColumn(
name: "RegionalEvent",
table: "Events");
migrationBuilder.RenameColumn(
name: "StatePretesting",
table: "Events",
newName: "Presubmission");
migrationBuilder.RenameColumn(
name: "StatePresubmission",
table: "Events",
newName: "OnSiteActivity");
migrationBuilder.RenameColumn(
name: "StatePreliminaryRound",
table: "Events",
newName: "ChapterEligibilityCountState");
migrationBuilder.RenameColumn(
name: "RegionalPresubmit",
table: "Events",
newName: "ChapterEligibilityCountRegionals");
migrationBuilder.AlterColumn<string>(
name: "ShortName",
table: "Events",
type: "TEXT",
maxLength: 40,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Presubmission",
table: "Events",
newName: "StatePretesting");
migrationBuilder.RenameColumn(
name: "OnSiteActivity",
table: "Events",
newName: "StatePresubmission");
migrationBuilder.RenameColumn(
name: "ChapterEligibilityCountState",
table: "Events",
newName: "StatePreliminaryRound");
migrationBuilder.RenameColumn(
name: "ChapterEligibilityCountRegionals",
table: "Events",
newName: "RegionalPresubmit");
migrationBuilder.AlterColumn<string>(
name: "ShortName",
table: "Events",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 40);
migrationBuilder.AddColumn<int>(
name: "MaxTeamCountState",
table: "Events",
type: "INTEGER",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<bool>(
name: "RegionalEvent",
table: "Events",
type: "INTEGER",
nullable: false,
defaultValue: false);
}
}
}
+21 -19
View File
@@ -22,14 +22,23 @@ namespace Data.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("ChapterEligibilityCountRegionals")
.HasColumnType("INTEGER");
b.Property<int>("ChapterEligibilityCountState")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasMaxLength(1024)
.HasColumnType("TEXT");
b.Property<string>("Documentation")
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<string>("Eligibility")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<int>("EventFormat")
@@ -38,9 +47,6 @@ namespace Data.Migrations
b.Property<int?>("LevelOfEffort")
.HasColumnType("INTEGER");
b.Property<int>("MaxTeamCountState")
.HasColumnType("INTEGER");
b.Property<int>("MaxTeamSize")
.HasColumnType("INTEGER");
@@ -53,37 +59,33 @@ namespace Data.Migrations
.HasColumnType("TEXT");
b.Property<string>("Notes")
.HasMaxLength(1024)
.HasColumnType("TEXT");
b.Property<bool>("RegionalEvent")
b.Property<bool>("OnSiteActivity")
.HasColumnType("INTEGER");
b.Property<bool>("RegionalPresubmit")
b.Property<bool>("Presubmission")
.HasColumnType("INTEGER");
b.Property<string>("SemifinalistActivity")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("ShortName")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("TEXT");
b.Property<bool>("StatePreliminaryRound")
.HasColumnType("INTEGER");
b.Property<bool>("StatePresubmission")
.HasColumnType("INTEGER");
b.Property<bool>("StatePretesting")
.HasColumnType("INTEGER");
b.Property<string>("Theme")
.HasMaxLength(4096)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Name");
b.ToTable("Events", (string)null);
b.ToTable("Events");
});
modelBuilder.Entity("Core.Entities.Student", b =>
@@ -128,7 +130,7 @@ namespace Data.Migrations
b.HasKey("Id");
b.ToTable("Students", (string)null);
b.ToTable("Students");
});
modelBuilder.Entity("Core.Entities.StudentEventRanking", b =>
@@ -146,7 +148,7 @@ namespace Data.Migrations
b.HasIndex("StudentId");
b.ToTable("StudentEventRanking", (string)null);
b.ToTable("StudentEventRanking");
});
modelBuilder.Entity("Core.Entities.Team", b =>
@@ -173,7 +175,7 @@ namespace Data.Migrations
b.HasIndex("EventId");
b.ToTable("Teams", (string)null);
b.ToTable("Teams");
});
modelBuilder.Entity("StudentTeam", b =>
@@ -188,7 +190,7 @@ namespace Data.Migrations
b.HasIndex("TeamsId");
b.ToTable("StudentTeam", (string)null);
b.ToTable("StudentTeam");
});
modelBuilder.Entity("Core.Entities.StudentEventRanking", b =>