PIbd-21_Anisin_R.S._CourseW.../TravelAgency/TravelAgencyDatabaseImplement/Migrations/TravelAgencyDatabaseModelSnapshot.cs

458 lines
16 KiB
C#
Raw Normal View History

2024-04-29 21:30:41 +04:00
// <auto-generated />
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<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ExcursionDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ExcursionName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<double>("Price")
.HasColumnType("float");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Excursions");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.ExcursionGroup", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ExcursionGroupName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("GuideId")
.HasColumnType("int");
b.Property<int>("ParticipantsAmount")
.HasColumnType("int");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("GuideId");
b.HasIndex("UserId");
b.ToTable("ExcursionGroups");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.ExcursionGroupTour", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ExcursionGroupId")
.HasColumnType("int");
b.Property<int>("TourId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ExcursionGroupId");
b.HasIndex("TourId");
b.ToTable("ExcursionGroupTours");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.ExcursionTour", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ExcursionId")
.HasColumnType("int");
b.Property<int>("TourId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ExcursionId");
b.HasIndex("TourId");
b.ToTable("ExcursionTours");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Guide", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("GuideFIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Guides");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.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.HasKey("Id");
b.HasIndex("ExcursionId");
b.ToTable("Places");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Tour", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<double>("Price")
.HasColumnType("float");
b.Property<DateTime>("TourDate")
.HasColumnType("datetime2");
b.Property<string>("TourDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("TourName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Tours");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Trip", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("GuideId")
.HasColumnType("int");
b.Property<DateTime>("TripDate")
.HasColumnType("datetime2");
b.Property<string>("TripName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("GuideId");
b.ToTable("Trips");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.TripPlace", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("PlaceId")
.HasColumnType("int");
b.Property<int>("TripId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("PlaceId");
b.HasIndex("TripId");
b.ToTable("TripPlaces");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserFIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Excursion", b =>
{
b.HasOne("TravelAgencyDatabaseImplement.Models.User", "User")
2024-04-29 21:56:45 +04:00
.WithMany("Excursions")
2024-04-29 21:30:41 +04:00
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.ExcursionGroup", b =>
{
b.HasOne("TravelAgencyDatabaseImplement.Models.Guide", "Guide")
2024-04-29 21:56:45 +04:00
.WithMany("ExcursionGroups")
2024-04-29 21:30:41 +04:00
.HasForeignKey("GuideId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TravelAgencyDatabaseImplement.Models.User", "User")
2024-04-29 21:56:45 +04:00
.WithMany("ExcursionGroups")
2024-04-29 21:30:41 +04:00
.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")
2024-04-29 21:56:45 +04:00
.WithMany("Places")
2024-04-29 21:30:41 +04:00
.HasForeignKey("ExcursionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Excursion");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Tour", b =>
{
b.HasOne("TravelAgencyDatabaseImplement.Models.User", "User")
2024-04-29 21:56:45 +04:00
.WithMany("Tours")
2024-04-29 21:30:41 +04:00
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Trip", b =>
{
b.HasOne("TravelAgencyDatabaseImplement.Models.Guide", "Guide")
2024-04-29 21:56:45 +04:00
.WithMany("Trips")
2024-04-29 21:30:41 +04:00
.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 =>
{
2024-04-29 21:56:45 +04:00
b.Navigation("Places");
2024-04-29 21:30:41 +04:00
b.Navigation("Tours");
});
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.ExcursionGroup", b =>
{
b.Navigation("Tours");
});
2024-04-29 21:56:45 +04:00
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.Guide", b =>
{
b.Navigation("ExcursionGroups");
b.Navigation("Trips");
});
2024-04-29 21:30:41 +04:00
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");
});
2024-04-29 21:56:45 +04:00
modelBuilder.Entity("TravelAgencyDatabaseImplement.Models.User", b =>
{
b.Navigation("ExcursionGroups");
b.Navigation("Excursions");
b.Navigation("Tours");
});
2024-04-29 21:30:41 +04:00
#pragma warning restore 612, 618
}
}
}