// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using SportsDivision.Infrastructure.Data;

#nullable disable

namespace SportsDivision.Infrastructure.Migrations
{
    [DbContext(typeof(ApplicationDbContext))]
    partial class ApplicationDbContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "10.0.2")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("EventEventLevel", b =>
                {
                    b.Property<int>("EventLevelsEventLevelId")
                        .HasColumnType("integer");

                    b.Property<int>("EventsEventId")
                        .HasColumnType("integer");

                    b.HasKey("EventLevelsEventLevelId", "EventsEventId");

                    b.HasIndex("EventsEventId");

                    b.ToTable("EventEventLevel", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("text");

                    b.Property<string>("Name")
                        .HasMaxLength(256)
                        .HasColumnType("character varying(256)");

                    b.Property<string>("NormalizedName")
                        .HasMaxLength(256)
                        .HasColumnType("character varying(256)");

                    b.HasKey("Id");

                    b.HasIndex("NormalizedName")
                        .IsUnique()
                        .HasDatabaseName("RoleNameIndex");

                    b.ToTable("AspNetRoles", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("ClaimType")
                        .HasColumnType("text");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("text");

                    b.Property<string>("RoleId")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetRoleClaims", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("ClaimType")
                        .HasColumnType("text");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("text");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserClaims", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.Property<string>("LoginProvider")
                        .HasColumnType("text");

                    b.Property<string>("ProviderKey")
                        .HasColumnType("text");

                    b.Property<string>("ProviderDisplayName")
                        .HasColumnType("text");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("LoginProvider", "ProviderKey");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserLogins", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.Property<string>("UserId")
                        .HasColumnType("text");

                    b.Property<string>("RoleId")
                        .HasColumnType("text");

                    b.HasKey("UserId", "RoleId");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetUserRoles", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.Property<string>("UserId")
                        .HasColumnType("text");

                    b.Property<string>("LoginProvider")
                        .HasColumnType("text");

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

                    b.Property<string>("Value")
                        .HasColumnType("text");

                    b.HasKey("UserId", "LoginProvider", "Name");

                    b.ToTable("AspNetUserTokens", (string)null);
                });

            modelBuilder.Entity("SportsDivision.Domain.Entities.Event", b =>
                {
                    b.Property<int>("EventId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("EventId"));

                    b.Property<string>("Category")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("character varying(20)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("boolean");

                    b.Property<bool>("IsRelay")
                        .HasColumnType("boolean");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("character varying(100)");

                    b.Property<bool>("PrimarySchool")
                        .HasColumnType("boolean");

                    b.Property<bool>("SecondarySchool")
                        .HasColumnType("boolean");

                    b.HasKey("EventId");

                    b.HasIndex("Name")
                        .IsUnique();

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.EventLevel", b =>
                {
                    b.Property<int>("EventLevelId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("EventLevelId"));

                    b.Property<bool>("IsActive")
                        .HasColumnType("boolean");

                    b.Property<bool>("IsAgeBased")
                        .HasColumnType("boolean");

                    b.Property<int?>("MaxAge")
                        .HasColumnType("integer");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("character varying(100)");

                    b.Property<string>("SchoolLevel")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("character varying(20)");

                    b.Property<string>("Sex")
                        .IsRequired()
                        .HasMaxLength(10)
                        .HasColumnType("character varying(10)");

                    b.Property<int>("SortOrder")
                        .HasColumnType("integer");

                    b.HasKey("EventLevelId");

                    b.HasIndex("Name", "Sex")
                        .IsUnique();

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.EventRegistration", b =>
                {
                    b.Property<int>("EventRegistrationId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("EventRegistrationId"));

                    b.Property<DateTime>("RegisteredAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("RegisteredBy")
                        .IsRequired()
                        .HasMaxLength(450)
                        .HasColumnType("character varying(450)");

                    b.Property<int?>("RelayTeamId")
                        .HasColumnType("integer");

                    b.Property<int?>("StudentId")
                        .HasColumnType("integer");

                    b.Property<int>("TournamentEventLevelId")
                        .HasColumnType("integer");

                    b.HasKey("EventRegistrationId");

                    b.HasIndex("RelayTeamId");

                    b.HasIndex("StudentId");

                    b.HasIndex("TournamentEventLevelId", "StudentId")
                        .IsUnique()
                        .HasFilter("\"StudentId\" IS NOT NULL");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.Heat", b =>
                {
                    b.Property<int>("HeatId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("HeatId"));

                    b.Property<int>("HeatNumber")
                        .HasColumnType("integer");

                    b.Property<int>("RoundId")
                        .HasColumnType("integer");

                    b.Property<string>("Status")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("character varying(20)");

                    b.HasKey("HeatId");

                    b.HasIndex("RoundId");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.HeatLane", b =>
                {
                    b.Property<int>("HeatLaneId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("HeatLaneId"));

                    b.Property<string>("AdvanceReason")
                        .HasMaxLength(20)
                        .HasColumnType("character varying(20)");

                    b.Property<int>("EventRegistrationId")
                        .HasColumnType("integer");

                    b.Property<int>("HeatId")
                        .HasColumnType("integer");

                    b.Property<bool>("IsAdvanced")
                        .HasColumnType("boolean");

                    b.Property<bool>("IsDNF")
                        .HasColumnType("boolean");

                    b.Property<bool>("IsDNS")
                        .HasColumnType("boolean");

                    b.Property<bool>("IsDQ")
                        .HasColumnType("boolean");

                    b.Property<int>("LaneNumber")
                        .HasColumnType("integer");

                    b.Property<DateTime?>("RecordedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("RecordedBy")
                        .HasMaxLength(450)
                        .HasColumnType("character varying(450)");

                    b.Property<decimal?>("Time")
                        .HasPrecision(10, 3)
                        .HasColumnType("numeric(10,3)");

                    b.HasKey("HeatLaneId");

                    b.HasIndex("EventRegistrationId");

                    b.HasIndex("HeatId", "LaneNumber")
                        .IsUnique();

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.HighJumpAttempt", b =>
                {
                    b.Property<int>("HighJumpAttemptId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("HighJumpAttemptId"));

                    b.Property<string>("Attempt1")
                        .HasMaxLength(10)
                        .HasColumnType("character varying(10)");

                    b.Property<string>("Attempt2")
                        .HasMaxLength(10)
                        .HasColumnType("character varying(10)");

                    b.Property<string>("Attempt3")
                        .HasMaxLength(10)
                        .HasColumnType("character varying(10)");

                    b.Property<int>("EventRegistrationId")
                        .HasColumnType("integer");

                    b.Property<int>("HighJumpHeightId")
                        .HasColumnType("integer");

                    b.HasKey("HighJumpAttemptId");

                    b.HasIndex("EventRegistrationId");

                    b.HasIndex("HighJumpHeightId", "EventRegistrationId")
                        .IsUnique();

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.HighJumpHeight", b =>
                {
                    b.Property<int>("HighJumpHeightId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("HighJumpHeightId"));

                    b.Property<decimal>("Height")
                        .HasPrecision(5, 2)
                        .HasColumnType("numeric(5,2)");

                    b.Property<int>("SortOrder")
                        .HasColumnType("integer");

                    b.Property<int>("TournamentEventLevelId")
                        .HasColumnType("integer");

                    b.HasKey("HighJumpHeightId");

                    b.HasIndex("TournamentEventLevelId");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.PlacementPointConfig", b =>
                {
                    b.Property<int>("PlacementPointConfigId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("PlacementPointConfigId"));

                    b.Property<int>("Placement")
                        .HasColumnType("integer");

                    b.Property<int>("Points")
                        .HasColumnType("integer");

                    b.HasKey("PlacementPointConfigId");

                    b.HasIndex("Placement")
                        .IsUnique();

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.RelayTeam", b =>
                {
                    b.Property<int>("RelayTeamId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("RelayTeamId"));

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("character varying(100)");

                    b.Property<int>("SchoolId")
                        .HasColumnType("integer");

                    b.HasKey("RelayTeamId");

                    b.HasIndex("SchoolId");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.RelayTeamMember", b =>
                {
                    b.Property<int>("RelayTeamMemberId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("RelayTeamMemberId"));

                    b.Property<int>("RelayTeamId")
                        .HasColumnType("integer");

                    b.Property<int>("RunOrder")
                        .HasColumnType("integer");

                    b.Property<int>("StudentId")
                        .HasColumnType("integer");

                    b.HasKey("RelayTeamMemberId");

                    b.HasIndex("StudentId");

                    b.HasIndex("RelayTeamId", "StudentId")
                        .IsUnique();

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.Round", b =>
                {
                    b.Property<int>("RoundId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("RoundId"));

                    b.Property<int?>("AdvanceFastestLosers")
                        .HasColumnType("integer");

                    b.Property<int?>("AdvanceTopN")
                        .HasColumnType("integer");

                    b.Property<int>("RoundOrder")
                        .HasColumnType("integer");

                    b.Property<string>("RoundType")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("character varying(20)");

                    b.Property<string>("Status")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("character varying(20)");

                    b.Property<int>("TournamentEventLevelId")
                        .HasColumnType("integer");

                    b.HasKey("RoundId");

                    b.HasIndex("TournamentEventLevelId");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.School", b =>
                {
                    b.Property<int>("SchoolId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("SchoolId"));

                    b.Property<bool>("IsActive")
                        .HasColumnType("boolean");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)");

                    b.Property<string>("SchoolLevel")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("character varying(20)");

                    b.Property<string>("ShortName")
                        .HasMaxLength(20)
                        .HasColumnType("character varying(20)");

                    b.Property<int>("ZoneId")
                        .HasColumnType("integer");

                    b.HasKey("SchoolId");

                    b.HasIndex("Name")
                        .IsUnique();

                    b.HasIndex("ZoneId");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.Score", b =>
                {
                    b.Property<int>("ScoreId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ScoreId"));

                    b.Property<int>("CalculatedPoints")
                        .HasColumnType("integer");

                    b.Property<int>("EventRegistrationId")
                        .HasColumnType("integer");

                    b.Property<int?>("Placement")
                        .HasColumnType("integer");

                    b.Property<int>("PlacementPoints")
                        .HasColumnType("integer");

                    b.Property<decimal>("RawPerformance")
                        .HasPrecision(10, 3)
                        .HasColumnType("numeric(10,3)");

                    b.Property<DateTime>("RecordedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("RecordedBy")
                        .HasMaxLength(450)
                        .HasColumnType("character varying(450)");

                    b.HasKey("ScoreId");

                    b.HasIndex("EventRegistrationId")
                        .IsUnique();

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.ScoringConstant", b =>
                {
                    b.Property<int>("ScoringConstantId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ScoringConstantId"));

                    b.Property<decimal>("A")
                        .HasPrecision(18, 6)
                        .HasColumnType("numeric(18,6)");

                    b.Property<decimal>("B")
                        .HasPrecision(18, 6)
                        .HasColumnType("numeric(18,6)");

                    b.Property<decimal>("C")
                        .HasPrecision(18, 6)
                        .HasColumnType("numeric(18,6)");

                    b.Property<int>("EventId")
                        .HasColumnType("integer");

                    b.Property<string>("Unit")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("character varying(20)");

                    b.HasKey("ScoringConstantId");

                    b.HasIndex("EventId");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.Student", b =>
                {
                    b.Property<int>("StudentId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("StudentId"));

                    b.Property<DateOnly>("DateOfBirth")
                        .HasColumnType("date");

                    b.Property<string>("ExistingStudentId")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)");

                    b.Property<string>("FirstName")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("character varying(100)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("boolean");

                    b.Property<string>("LastName")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("character varying(100)");

                    b.Property<int>("SchoolId")
                        .HasColumnType("integer");

                    b.Property<string>("Sex")
                        .IsRequired()
                        .HasMaxLength(10)
                        .HasColumnType("character varying(10)");

                    b.HasKey("StudentId");

                    b.HasIndex("ExistingStudentId")
                        .IsUnique();

                    b.HasIndex("SchoolId");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.Tournament", b =>
                {
                    b.Property<int>("TournamentId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("TournamentId"));

                    b.Property<DateOnly>("EndDate")
                        .HasColumnType("date");

                    b.Property<bool>("IsArchived")
                        .HasColumnType("boolean");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)");

                    b.Property<string>("SchoolLevel")
                        .HasMaxLength(20)
                        .HasColumnType("character varying(20)");

                    b.Property<DateOnly>("StartDate")
                        .HasColumnType("date");

                    b.Property<string>("Status")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("character varying(20)");

                    b.Property<int?>("ZoneId")
                        .HasColumnType("integer");

                    b.HasKey("TournamentId");

                    b.HasIndex("ZoneId");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.TournamentEventLevel", b =>
                {
                    b.Property<int>("TournamentEventLevelId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("TournamentEventLevelId"));

                    b.Property<bool>("AgeRestrictionWaived")
                        .HasColumnType("boolean");

                    b.Property<int>("EventId")
                        .HasColumnType("integer");

                    b.Property<int>("EventLevelId")
                        .HasColumnType("integer");

                    b.Property<int>("TournamentId")
                        .HasColumnType("integer");

                    b.HasKey("TournamentEventLevelId");

                    b.HasIndex("EventId");

                    b.HasIndex("EventLevelId");

                    b.HasIndex("TournamentId", "EventId", "EventLevelId")
                        .IsUnique();

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.Zone", b =>
                {
                    b.Property<int>("ZoneId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ZoneId"));

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasMaxLength(10)
                        .HasColumnType("character varying(10)");

                    b.Property<bool>("IsActive")
                        .HasColumnType("boolean");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("character varying(100)");

                    b.HasKey("ZoneId");

                    b.HasIndex("Code")
                        .IsUnique();

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

            modelBuilder.Entity("SportsDivision.Infrastructure.Identity.ApplicationUser", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text");

                    b.Property<int>("AccessFailedCount")
                        .HasColumnType("integer");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("text");

                    b.Property<string>("Email")
                        .HasMaxLength(256)
                        .HasColumnType("character varying(256)");

                    b.Property<bool>("EmailConfirmed")
                        .HasColumnType("boolean");

                    b.Property<string>("FirstName")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<bool>("IsActive")
                        .HasColumnType("boolean");

                    b.Property<string>("LastName")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<bool>("LockoutEnabled")
                        .HasColumnType("boolean");

                    b.Property<DateTimeOffset?>("LockoutEnd")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("NormalizedEmail")
                        .HasMaxLength(256)
                        .HasColumnType("character varying(256)");

                    b.Property<string>("NormalizedUserName")
                        .HasMaxLength(256)
                        .HasColumnType("character varying(256)");

                    b.Property<string>("PasswordHash")
                        .HasColumnType("text");

                    b.Property<string>("PhoneNumber")
                        .HasColumnType("text");

                    b.Property<bool>("PhoneNumberConfirmed")
                        .HasColumnType("boolean");

                    b.Property<int?>("SchoolId")
                        .HasColumnType("integer");

                    b.Property<string>("SecurityStamp")
                        .HasColumnType("text");

                    b.Property<bool>("TwoFactorEnabled")
                        .HasColumnType("boolean");

                    b.Property<string>("UserName")
                        .HasMaxLength(256)
                        .HasColumnType("character varying(256)");

                    b.HasKey("Id");

                    b.HasIndex("NormalizedEmail")
                        .HasDatabaseName("EmailIndex");

                    b.HasIndex("NormalizedUserName")
                        .IsUnique()
                        .HasDatabaseName("UserNameIndex");

                    b.ToTable("AspNetUsers", (string)null);
                });

            modelBuilder.Entity("EventEventLevel", b =>
                {
                    b.HasOne("SportsDivision.Domain.Entities.EventLevel", null)
                        .WithMany()
                        .HasForeignKey("EventLevelsEventLevelId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("SportsDivision.Domain.Entities.Event", null)
                        .WithMany()
                        .HasForeignKey("EventsEventId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.HasOne("SportsDivision.Infrastructure.Identity.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.HasOne("SportsDivision.Infrastructure.Identity.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("SportsDivision.Infrastructure.Identity.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.HasOne("SportsDivision.Infrastructure.Identity.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("SportsDivision.Domain.Entities.EventRegistration", b =>
                {
                    b.HasOne("SportsDivision.Domain.Entities.RelayTeam", "RelayTeam")
                        .WithMany("Registrations")
                        .HasForeignKey("RelayTeamId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("SportsDivision.Domain.Entities.Student", "Student")
                        .WithMany("Registrations")
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("SportsDivision.Domain.Entities.TournamentEventLevel", "TournamentEventLevel")
                        .WithMany("Registrations")
                        .HasForeignKey("TournamentEventLevelId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("RelayTeam");

                    b.Navigation("Student");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.Heat", b =>
                {
                    b.HasOne("SportsDivision.Domain.Entities.Round", "Round")
                        .WithMany("Heats")
                        .HasForeignKey("RoundId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.HeatLane", b =>
                {
                    b.HasOne("SportsDivision.Domain.Entities.EventRegistration", "EventRegistration")
                        .WithMany("HeatLanes")
                        .HasForeignKey("EventRegistrationId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("SportsDivision.Domain.Entities.Heat", "Heat")
                        .WithMany("HeatLanes")
                        .HasForeignKey("HeatId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("EventRegistration");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.HighJumpAttempt", b =>
                {
                    b.HasOne("SportsDivision.Domain.Entities.EventRegistration", "EventRegistration")
                        .WithMany()
                        .HasForeignKey("EventRegistrationId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("SportsDivision.Domain.Entities.HighJumpHeight", "HighJumpHeight")
                        .WithMany("Attempts")
                        .HasForeignKey("HighJumpHeightId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("EventRegistration");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.HighJumpHeight", b =>
                {
                    b.HasOne("SportsDivision.Domain.Entities.TournamentEventLevel", "TournamentEventLevel")
                        .WithMany("HighJumpHeights")
                        .HasForeignKey("TournamentEventLevelId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.RelayTeam", b =>
                {
                    b.HasOne("SportsDivision.Domain.Entities.School", "School")
                        .WithMany()
                        .HasForeignKey("SchoolId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.RelayTeamMember", b =>
                {
                    b.HasOne("SportsDivision.Domain.Entities.RelayTeam", "RelayTeam")
                        .WithMany("Members")
                        .HasForeignKey("RelayTeamId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("SportsDivision.Domain.Entities.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("RelayTeam");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.Round", b =>
                {
                    b.HasOne("SportsDivision.Domain.Entities.TournamentEventLevel", "TournamentEventLevel")
                        .WithMany("Rounds")
                        .HasForeignKey("TournamentEventLevelId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.School", b =>
                {
                    b.HasOne("SportsDivision.Domain.Entities.Zone", "Zone")
                        .WithMany("Schools")
                        .HasForeignKey("ZoneId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.Score", b =>
                {
                    b.HasOne("SportsDivision.Domain.Entities.EventRegistration", "EventRegistration")
                        .WithOne("Score")
                        .HasForeignKey("SportsDivision.Domain.Entities.Score", "EventRegistrationId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.ScoringConstant", b =>
                {
                    b.HasOne("SportsDivision.Domain.Entities.Event", "Event")
                        .WithMany("ScoringConstants")
                        .HasForeignKey("EventId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.Student", b =>
                {
                    b.HasOne("SportsDivision.Domain.Entities.School", "School")
                        .WithMany("Students")
                        .HasForeignKey("SchoolId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.Tournament", b =>
                {
                    b.HasOne("SportsDivision.Domain.Entities.Zone", "Zone")
                        .WithMany()
                        .HasForeignKey("ZoneId")
                        .OnDelete(DeleteBehavior.SetNull);

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.TournamentEventLevel", b =>
                {
                    b.HasOne("SportsDivision.Domain.Entities.Event", "Event")
                        .WithMany("TournamentEventLevels")
                        .HasForeignKey("EventId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("SportsDivision.Domain.Entities.EventLevel", "EventLevel")
                        .WithMany("TournamentEventLevels")
                        .HasForeignKey("EventLevelId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("SportsDivision.Domain.Entities.Tournament", "Tournament")
                        .WithMany("TournamentEventLevels")
                        .HasForeignKey("TournamentId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Event");

                    b.Navigation("EventLevel");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.Event", b =>
                {
                    b.Navigation("ScoringConstants");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.EventLevel", b =>
                {
                    b.Navigation("TournamentEventLevels");
                });

            modelBuilder.Entity("SportsDivision.Domain.Entities.EventRegistration", b =>
                {
                    b.Navigation("HeatLanes");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.Heat", b =>
                {
                    b.Navigation("HeatLanes");
                });

            modelBuilder.Entity("SportsDivision.Domain.Entities.HighJumpHeight", b =>
                {
                    b.Navigation("Attempts");
                });

            modelBuilder.Entity("SportsDivision.Domain.Entities.RelayTeam", b =>
                {
                    b.Navigation("Members");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.Round", b =>
                {
                    b.Navigation("Heats");
                });

            modelBuilder.Entity("SportsDivision.Domain.Entities.School", b =>
                {
                    b.Navigation("Students");
                });

            modelBuilder.Entity("SportsDivision.Domain.Entities.Student", b =>
                {
                    b.Navigation("Registrations");
                });

            modelBuilder.Entity("SportsDivision.Domain.Entities.Tournament", b =>
                {
                    b.Navigation("TournamentEventLevels");
                });

            modelBuilder.Entity("SportsDivision.Domain.Entities.TournamentEventLevel", b =>
                {
                    b.Navigation("HighJumpHeights");

                    b.Navigation("Registrations");

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

            modelBuilder.Entity("SportsDivision.Domain.Entities.Zone", b =>
                {
                    b.Navigation("Schools");
                });
#pragma warning restore 612, 618
        }
    }
}
