//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using TravelAgencyDatabaseImplement;
#nullable disable
namespace TravelAgencyDatabaseImplement.Migrations
{
[DbContext(typeof(TravelAgencyDatabase))]
partial class TravelAgencyDatabaseModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.18")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Excursion", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ExcursionDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("ExcursionName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Price")
.HasColumnType("float");
b.Property("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Excursions");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.ExcursionGroup", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ExcursionGroupName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("GuideId")
.HasColumnType("int");
b.Property("ParticipantsAmount")
.HasColumnType("int");
b.Property("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("GuideId");
b.HasIndex("UserId");
b.ToTable("ExcursionGroups");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.ExcursionGroupTour", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ExcursionGroupId")
.HasColumnType("int");
b.Property("TourId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ExcursionGroupId");
b.HasIndex("TourId");
b.ToTable("ExcursionGroupTours");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.ExcursionTour", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ExcursionId")
.HasColumnType("int");
b.Property("TourId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ExcursionId");
b.HasIndex("TourId");
b.ToTable("ExcursionTours");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Guide", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("GuideFIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("PhoneNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Guides");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Place", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ExcursionId")
.HasColumnType("int");
b.Property("PlaceAddress")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("PlaceName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ExcursionId");
b.ToTable("Places");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Tour", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Price")
.HasColumnType("float");
b.Property("TourDate")
.HasColumnType("datetime2");
b.Property("TourDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("TourName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Tours");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Trip", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("GuideId")
.HasColumnType("int");
b.Property("TripDate")
.HasColumnType("datetime2");
b.Property("TripName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("GuideId");
b.ToTable("Trips");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.TripPlace", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("PlaceId")
.HasColumnType("int");
b.Property("TripId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("PlaceId");
b.HasIndex("TripId");
b.ToTable("TripPlaces");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("PhoneNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("UserFIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Excursion", b =>
{
b.HasOne("TravelAgencyDatabaseImplement.Models.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.ExcursionGroup", b =>
{
b.HasOne("TravelAgencyDatabaseImplement.Models.Guide", "Guide")
.WithMany()
.HasForeignKey("GuideId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TravelAgencyDatabaseImplement.Models.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Guide");
b.Navigation("User");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.ExcursionGroupTour", b =>
{
b.HasOne("TravelAgencyDatabaseImplement.Models.ExcursionGroup", "ExcursionGroup")
.WithMany("Tours")
.HasForeignKey("ExcursionGroupId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TravelAgencyDatabaseImplement.Models.Tour", "Tour")
.WithMany("ExcursionGroups")
.HasForeignKey("TourId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ExcursionGroup");
b.Navigation("Tour");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.ExcursionTour", b =>
{
b.HasOne("TravelAgencyDatabaseImplement.Models.Excursion", "Excursion")
.WithMany("Tours")
.HasForeignKey("ExcursionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TravelAgencyDatabaseImplement.Models.Tour", "Tour")
.WithMany("Excursions")
.HasForeignKey("TourId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Excursion");
b.Navigation("Tour");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Place", b =>
{
b.HasOne("TravelAgencyDatabaseImplement.Models.Excursion", "Excursion")
.WithMany()
.HasForeignKey("ExcursionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Excursion");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Tour", b =>
{
b.HasOne("TravelAgencyDatabaseImplement.Models.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Trip", b =>
{
b.HasOne("TravelAgencyDatabaseImplement.Models.Guide", "Guide")
.WithMany()
.HasForeignKey("GuideId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Guide");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.TripPlace", b =>
{
b.HasOne("TravelAgencyDatabaseImplement.Models.Place", "Place")
.WithMany("Trips")
.HasForeignKey("PlaceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TravelAgencyDatabaseImplement.Models.Trip", "Trip")
.WithMany("Places")
.HasForeignKey("TripId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Place");
b.Navigation("Trip");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Excursion", b =>
{
b.Navigation("Tours");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.ExcursionGroup", b =>
{
b.Navigation("Tours");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Place", b =>
{
b.Navigation("Trips");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Tour", b =>
{
b.Navigation("ExcursionGroups");
b.Navigation("Excursions");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Trip", b =>
{
b.Navigation("Places");
});
#pragma warning restore 612, 618
}
}
}