// <auto-generated />
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Shared_Traveling.DataAccess;

namespace Shared_Traveling.Migrations
{
    [DbContext(typeof(MyDbContext))]
    [Migration("20210610212619_Request")]
    partial class Request
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("Relational:MaxIdentifierLength", 128)
                .HasAnnotation("ProductVersion", "5.0.6")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("Shared_Traveling.Entities.AprovedRequest", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int")
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("TravelPostId")
                        .HasColumnType("int");

                    b.Property<int>("UserId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("TravelPostId");

                    b.HasIndex("UserId");

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

            modelBuilder.Entity("Shared_Traveling.Entities.Request", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int")
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("Content")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("TravelPostId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("TravelPostId");

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

            modelBuilder.Entity("Shared_Traveling.Entities.TravelPost", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int")
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("AddressOfDeparture")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("AddressOfDestination")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("AvailableSeats")
                        .HasColumnType("int");

                    b.Property<string>("CityOfDeparture")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("CityOfDestination")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("HourOfDeparture")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("HourOfDestination")
                        .HasColumnType("nvarchar(max)");

                    b.Property<double>("Price")
                        .HasColumnType("float");

                    b.Property<int>("UserId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

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

            modelBuilder.Entity("Shared_Traveling.Entities.User", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int")
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("FirstName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("LastName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Password")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Username")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

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

            modelBuilder.Entity("Shared_Traveling.Entities.AprovedRequest", b =>
                {
                    b.HasOne("Shared_Traveling.Entities.TravelPost", "ParentPost")
                        .WithMany()
                        .HasForeignKey("TravelPostId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Shared_Traveling.Entities.User", "ParentUser")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("ParentPost");

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

            modelBuilder.Entity("Shared_Traveling.Entities.Request", b =>
                {
                    b.HasOne("Shared_Traveling.Entities.TravelPost", "ParentPost")
                        .WithMany()
                        .HasForeignKey("TravelPostId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Shared_Traveling.Entities.TravelPost", b =>
                {
                    b.HasOne("Shared_Traveling.Entities.User", "ParentUser")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("ParentUser");
                });
#pragma warning restore 612, 618
        }
    }
}
