// <auto-generated />
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.Storage.Internal;
using System;
using TicTacToe.Data;

namespace TicTacToe.Migrations
{
    [DbContext(typeof(GameDbContext))]
    partial class GameDbContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "2.0.1-rtm-125")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("TicTacToe.Models.GameInvitationModel", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd();

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

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

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

                    b.Property<Guid>("InvitedByUserId");

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

                    b.HasKey("Id");

                    b.HasIndex("InvitedByUserId");

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

            modelBuilder.Entity("TicTacToe.Models.GameSessionModel", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<Guid>("ActiveUserId");

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

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

                    b.Property<Guid?>("User2Id");

                    b.Property<Guid>("UserId1");

                    b.Property<Guid>("UserId2");

                    b.Property<Guid>("WinnerId");

                    b.HasKey("Id");

                    b.HasIndex("User2Id");

                    b.HasIndex("UserId1");

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

            modelBuilder.Entity("TicTacToe.Models.TurnModel", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd();

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

                    b.Property<Guid?>("GameSessionModelId");

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

                    b.Property<Guid>("UserId");

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

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

                    b.HasKey("Id");

                    b.HasIndex("GameSessionModelId");

                    b.HasIndex("UserId");

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

            modelBuilder.Entity("TicTacToe.Models.UserModel", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd();

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

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

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

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

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

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

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

                    b.HasKey("Id");

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

            modelBuilder.Entity("TicTacToe.Models.GameInvitationModel", b =>
                {
                    b.HasOne("TicTacToe.Models.UserModel", "InvitedByUser")
                        .WithMany()
                        .HasForeignKey("InvitedByUserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("TicTacToe.Models.GameSessionModel", b =>
                {
                    b.HasOne("TicTacToe.Models.UserModel", "User2")
                        .WithMany()
                        .HasForeignKey("User2Id")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("TicTacToe.Models.UserModel", "User1")
                        .WithMany()
                        .HasForeignKey("UserId1")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("TicTacToe.Models.TurnModel", b =>
                {
                    b.HasOne("TicTacToe.Models.GameSessionModel")
                        .WithMany("Turns")
                        .HasForeignKey("GameSessionModelId");

                    b.HasOne("TicTacToe.Models.UserModel", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });
#pragma warning restore 612, 618
        }
    }
}
