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

namespace WakeboardUK2018.Data.Migrations
{
    [DbContext(typeof(ApplicationDbContext))]
    [Migration("20200304214125_LocationSocials")]
    partial class LocationSocials
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "2.2.6-servicing-10079")
                .HasAnnotation("Relational:MaxIdentifierLength", 128)
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("NormalizedName")
                        .IsUnique()
                        .HasName("RoleNameIndex")
                        .HasFilter("[NormalizedName] IS NOT NULL");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("RoleId");

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

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("UserId");

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

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

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

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

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

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

                    b.HasIndex("UserId");

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

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

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

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

                    b.HasIndex("RoleId");

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

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

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

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

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

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

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

            modelBuilder.Entity("WakeboardUK2018.Models.ApplicationUser", b =>
                {
                    b.Property<string>("Id")
                        .ValueGeneratedOnAdd();

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

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

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

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

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

                    b.Property<DateTimeOffset?>("LockoutEnd");

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

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

                    b.HasIndex("NormalizedUserName")
                        .IsUnique()
                        .HasName("UserNameIndex")
                        .HasFilter("[NormalizedUserName] IS NOT NULL");

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

            modelBuilder.Entity("WakeboardUK2018.Models.Article", b =>
                {
                    b.Property<int>("ArticleId")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("Content")
                        .IsRequired();

                    b.Property<DateTime>("CreateDate");

                    b.Property<string>("Description")
                        .IsRequired();

                    b.Property<string>("ImageUrl");

                    b.Property<bool>("Public");

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

                    b.HasKey("ArticleId");

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

            modelBuilder.Entity("WakeboardUK2018.Models.Competition", b =>
                {
                    b.Property<int>("CompetitionId")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

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

                    b.Property<string>("Title");

                    b.Property<string>("accommodation");

                    b.Property<int?>("country_id");

                    b.Property<DateTime?>("created_at");

                    b.Property<DateTime?>("end_date");

                    b.Property<string>("entry");

                    b.Property<string>("location");

                    b.Property<int?>("location_id");

                    b.Property<string>("notes");

                    b.Property<string>("official_url");

                    b.Property<string>("photo_content_type");

                    b.Property<string>("photo_file_name");

                    b.Property<int?>("photo_file_size");

                    b.Property<bool>("published");

                    b.Property<string>("result");

                    b.Property<string>("schedule");

                    b.Property<string>("short_name");

                    b.Property<string>("sponsors");

                    b.Property<DateTime?>("start_date");

                    b.Property<DateTime?>("updated_at");

                    b.HasKey("CompetitionId");

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

            modelBuilder.Entity("WakeboardUK2018.Models.Competitor", b =>
                {
                    b.Property<int>("CompetitorId")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("CountryId");

                    b.Property<DateTime>("CreateDate");

                    b.Property<string>("FacebookPage");

                    b.Property<string>("Firstname")
                        .IsRequired();

                    b.Property<string>("ImageUrl");

                    b.Property<string>("InstagramId");

                    b.Property<int>("SexId");

                    b.Property<string>("Surname")
                        .IsRequired();

                    b.Property<string>("TwitterId");

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

                    b.HasKey("CompetitorId");

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

            modelBuilder.Entity("WakeboardUK2018.Models.CompetitorSponsor", b =>
                {
                    b.Property<int>("CompetitorId");

                    b.Property<int>("SponsorId");

                    b.HasKey("CompetitorId", "SponsorId");

                    b.HasIndex("SponsorId");

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

            modelBuilder.Entity("WakeboardUK2018.Models.Download", b =>
                {
                    b.Property<int>("DownloadId")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("Description")
                        .IsRequired();

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

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

                    b.HasKey("DownloadId");

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

            modelBuilder.Entity("WakeboardUK2018.Models.Location", b =>
                {
                    b.Property<int>("LocationId")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("Content")
                        .IsRequired();

                    b.Property<string>("Description")
                        .IsRequired();

                    b.Property<string>("FacebookPage");

                    b.Property<string>("ImageUrl");

                    b.Property<string>("InstagramId");

                    b.Property<double>("Latitude");

                    b.Property<int>("LocationTypeId");

                    b.Property<double>("Longitude");

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

                    b.Property<string>("TwitterId");

                    b.Property<string>("WebsiteUrl");

                    b.HasKey("LocationId");

                    b.HasIndex("LocationTypeId");

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

            modelBuilder.Entity("WakeboardUK2018.Models.LocationType", b =>
                {
                    b.Property<int>("LocationTypeId")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

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

                    b.HasKey("LocationTypeId");

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

            modelBuilder.Entity("WakeboardUK2018.Models.Media", b =>
                {
                    b.Property<int>("MediaId")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("Photographer");

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

                    b.Property<string>("Uri")
                        .IsRequired();

                    b.HasKey("MediaId");

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

            modelBuilder.Entity("WakeboardUK2018.Models.MediaCompetitor", b =>
                {
                    b.Property<int>("MediaId");

                    b.Property<int>("CompetitorId");

                    b.HasKey("MediaId", "CompetitorId");

                    b.HasIndex("CompetitorId");

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

            modelBuilder.Entity("WakeboardUK2018.Models.Sponsor", b =>
                {
                    b.Property<int>("SponsorId")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

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

                    b.Property<string>("FacebookPage");

                    b.Property<string>("FacebookTags");

                    b.Property<string>("InstagramId");

                    b.Property<string>("InstagramTags");

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

                    b.Property<string>("SponsorImage");

                    b.Property<string>("TwitterId");

                    b.Property<string>("TwitterTags");

                    b.Property<string>("WebsiteUrl");

                    b.HasKey("SponsorId");

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

            modelBuilder.Entity("WakeboardUK2018.Models.Squad", b =>
                {
                    b.Property<int>("SquadId")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("Description")
                        .IsRequired();

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

                    b.Property<int>("Year");

                    b.HasKey("SquadId");

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

            modelBuilder.Entity("WakeboardUK2018.Models.SquadCompetitor", b =>
                {
                    b.Property<int>("SquadId");

                    b.Property<int>("CompetitorId");

                    b.Property<bool>("ContractSigned");

                    b.Property<double>("DepositPaid");

                    b.Property<double>("EntryPaid");

                    b.Property<string>("FlightBack");

                    b.Property<string>("FlightOut");

                    b.Property<bool>("HasJacket");

                    b.Property<bool>("Insured");

                    b.Property<bool>("Licenced");

                    b.Property<int>("PartySize");

                    b.Property<double>("PracticePaid");

                    b.Property<string>("TransportBack");

                    b.Property<string>("TransportOut");

                    b.HasKey("SquadId", "CompetitorId");

                    b.HasIndex("CompetitorId");

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

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

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

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

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

                    b.HasOne("WakeboardUK2018.Models.ApplicationUser")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

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

            modelBuilder.Entity("WakeboardUK2018.Models.CompetitorSponsor", b =>
                {
                    b.HasOne("WakeboardUK2018.Models.Competitor", "Competitor")
                        .WithMany("CompetitorSponsors")
                        .HasForeignKey("CompetitorId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("WakeboardUK2018.Models.Sponsor", "Sponsor")
                        .WithMany("CompetitorSponsors")
                        .HasForeignKey("SponsorId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("WakeboardUK2018.Models.Location", b =>
                {
                    b.HasOne("WakeboardUK2018.Models.LocationType", "LocationType")
                        .WithMany("Locations")
                        .HasForeignKey("LocationTypeId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("WakeboardUK2018.Models.MediaCompetitor", b =>
                {
                    b.HasOne("WakeboardUK2018.Models.Competitor", "Competitor")
                        .WithMany("MediaCompetitors")
                        .HasForeignKey("CompetitorId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("WakeboardUK2018.Models.Media", "Media")
                        .WithMany("MediaCompetitors")
                        .HasForeignKey("MediaId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("WakeboardUK2018.Models.SquadCompetitor", b =>
                {
                    b.HasOne("WakeboardUK2018.Models.Competitor", "Competitor")
                        .WithMany("SquadCompetitors")
                        .HasForeignKey("CompetitorId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("WakeboardUK2018.Models.Squad", "Squad")
                        .WithMany("SquadCompetitors")
                        .HasForeignKey("SquadId")
                        .OnDelete(DeleteBehavior.Cascade);
                });
#pragma warning restore 612, 618
        }
    }
}
