// <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 TravelCompanyDatabaseImplement;

#nullable disable

namespace TravelCompanyDatabaseImplement.Migrations
{
    [DbContext(typeof(TravelCompanyDatabase))]
    [Migration("20230519195652_FixMigrationTravel")]
    partial class FixMigrationTravel
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "7.0.4")
                .HasAnnotation("Relational:MaxIdentifierLength", 128);

            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.GuideExcursion", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

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

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

                    b.HasKey("Id");

                    b.HasIndex("ExcursionId");

                    b.HasIndex("GuideId");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.OperatorModels.Guide", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("OperatorId");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.OperatorModels.Operator", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("BirthDay")
                        .HasColumnType("datetime2");

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

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

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

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

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

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

                    b.HasKey("Id");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.OperatorModels.Tour", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

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

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

                    b.HasKey("Id");

                    b.HasIndex("OperatorId");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.TourTravel", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

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

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

                    b.HasKey("Id");

                    b.HasIndex("TravelId");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.TouristModel.Excursion", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("TouristId");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.TouristModel.ExcursionTravel", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

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

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

                    b.HasKey("Id");

                    b.HasIndex("ExcursionId");

                    b.HasIndex("TravelId");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.TouristModel.Place", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("ExcursionId");

                    b.HasIndex("TouristId");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.TouristModel.Tourist", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("BirthDay")
                        .HasColumnType("datetime2");

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

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

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

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

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

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

                    b.HasKey("Id");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.TouristModel.Travel", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("DateStart")
                        .HasColumnType("datetime2");

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("TouristId");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.GuideExcursion", b =>
                {
                    b.HasOne("TravelCompanyDatabaseImplement.Models.TouristModel.Excursion", "Excursion")
                        .WithMany("GuideExcursions")
                        .HasForeignKey("ExcursionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("TravelCompanyDatabaseImplement.Models.OperatorModels.Guide", "Guide")
                        .WithMany("GuideExcursions")
                        .HasForeignKey("GuideId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Excursion");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.OperatorModels.Guide", b =>
                {
                    b.HasOne("TravelCompanyDatabaseImplement.Models.OperatorModels.Operator", "Operator")
                        .WithMany("Guides")
                        .HasForeignKey("OperatorId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.OperatorModels.Tour", b =>
                {
                    b.HasOne("TravelCompanyDatabaseImplement.Models.OperatorModels.Operator", "Operator")
                        .WithMany("Tours")
                        .HasForeignKey("OperatorId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.TourTravel", b =>
                {
                    b.HasOne("TravelCompanyDatabaseImplement.Models.OperatorModels.Tour", "Tour")
                        .WithMany("TourTravels")
                        .HasForeignKey("TravelId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("TravelCompanyDatabaseImplement.Models.TouristModel.Travel", "Travel")
                        .WithMany("Tours")
                        .HasForeignKey("TravelId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Tour");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.TouristModel.Excursion", b =>
                {
                    b.HasOne("TravelCompanyDatabaseImplement.Models.TouristModel.Tourist", "Tourist")
                        .WithMany("Excursions")
                        .HasForeignKey("TouristId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.TouristModel.ExcursionTravel", b =>
                {
                    b.HasOne("TravelCompanyDatabaseImplement.Models.TouristModel.Excursion", "Excursion")
                        .WithMany("ExcursionTravels")
                        .HasForeignKey("ExcursionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("TravelCompanyDatabaseImplement.Models.TouristModel.Travel", "Travel")
                        .WithMany("ExcursionTravels")
                        .HasForeignKey("TravelId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Excursion");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.TouristModel.Place", b =>
                {
                    b.HasOne("TravelCompanyDatabaseImplement.Models.TouristModel.Excursion", "Excursion")
                        .WithMany("Places")
                        .HasForeignKey("ExcursionId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("TravelCompanyDatabaseImplement.Models.TouristModel.Tourist", "Tourist")
                        .WithMany("Places")
                        .HasForeignKey("TouristId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("Excursion");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.TouristModel.Travel", b =>
                {
                    b.HasOne("TravelCompanyDatabaseImplement.Models.TouristModel.Tourist", "Tourist")
                        .WithMany("Travels")
                        .HasForeignKey("TouristId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.OperatorModels.Guide", b =>
                {
                    b.Navigation("GuideExcursions");
                });

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.OperatorModels.Operator", b =>
                {
                    b.Navigation("Guides");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.OperatorModels.Tour", b =>
                {
                    b.Navigation("TourTravels");
                });

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.TouristModel.Excursion", b =>
                {
                    b.Navigation("ExcursionTravels");

                    b.Navigation("GuideExcursions");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.TouristModel.Tourist", b =>
                {
                    b.Navigation("Excursions");

                    b.Navigation("Places");

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

            modelBuilder.Entity("TravelCompanyDatabaseImplement.Models.TouristModel.Travel", b =>
                {
                    b.Navigation("ExcursionTravels");

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