From e2b6fd7b5a432885b096c6bbd90319fc563ac42c Mon Sep 17 00:00:00 2001 From: Marselchi Date: Tue, 28 May 2024 23:23:48 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=B0=D0=BA=D0=BE=D0=B9-=D1=82=D0=BE=20?= =?UTF-8?q?=D0=BC=D0=B8=D0=BA=D1=80=D0=BE=D1=84=D0=B8=D0=BA=D1=81,=20?= =?UTF-8?q?=D0=BD=D0=B0=D1=87=D0=B8=D0=BD=D0=B0=D1=8E=20=D1=80=D0=B0=D0=B1?= =?UTF-8?q?=D0=BE=D1=82=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20240528191551_InitFull.Designer.cs | 505 ++++++++++++++++++ .../Migrations/20240528191551_InitFull.cs | 19 + 2 files changed, 524 insertions(+) create mode 100644 CarCenter/CarCenterDatabaseImplement/Migrations/20240528191551_InitFull.Designer.cs create mode 100644 CarCenter/CarCenterDatabaseImplement/Migrations/20240528191551_InitFull.cs diff --git a/CarCenter/CarCenterDatabaseImplement/Migrations/20240528191551_InitFull.Designer.cs b/CarCenter/CarCenterDatabaseImplement/Migrations/20240528191551_InitFull.Designer.cs new file mode 100644 index 0000000..03d2eaa --- /dev/null +++ b/CarCenter/CarCenterDatabaseImplement/Migrations/20240528191551_InitFull.Designer.cs @@ -0,0 +1,505 @@ +// +using System; +using CarCenterDatabaseImplement; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace CarCenterDatabaseImplement.Migrations +{ + [DbContext(typeof(CarCenterDatabase))] + [Migration("20240528191551_InitFull")] + partial class InitFull + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.29") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Bundling", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EquipmentPackage") + .HasColumnType("integer"); + + b.Property("Price") + .HasColumnType("double precision"); + + b.Property("StorekeeperId") + .HasColumnType("integer"); + + b.Property("TirePackage") + .HasColumnType("integer"); + + b.Property("ToolKit") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Bundlings"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Car", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CarBrand") + .HasColumnType("integer"); + + b.Property("CarClass") + .HasColumnType("integer"); + + b.Property("FeatureID") + .HasColumnType("integer"); + + b.Property("FeatureId") + .HasColumnType("integer"); + + b.Property("Model") + .IsRequired() + .HasColumnType("text"); + + b.Property("OrderId") + .HasColumnType("integer"); + + b.Property("Price") + .HasColumnType("double precision"); + + b.Property("StorekeeperId") + .HasColumnType("integer"); + + b.Property("VINnumber") + .HasColumnType("bigint"); + + b.Property("Year") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("FeatureId"); + + b.HasIndex("OrderId"); + + b.HasIndex("StorekeeperId"); + + b.ToTable("Cars"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.CarBundling", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BundlingId") + .HasColumnType("integer"); + + b.Property("CarId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("BundlingId"); + + b.HasIndex("CarId"); + + b.ToTable("CarBundlings"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Feature", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CabinColor") + .IsRequired() + .HasColumnType("text"); + + b.Property("DriveType") + .HasColumnType("integer"); + + b.Property("HelpDevice") + .HasColumnType("integer"); + + b.Property("Price") + .HasColumnType("double precision"); + + b.Property("StorekeeperId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Features"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BuyerFCS") + .IsRequired() + .HasColumnType("text"); + + b.Property("PaymentDate") + .HasColumnType("timestamp without time zone"); + + b.Property("PaymentStatus") + .HasColumnType("integer"); + + b.Property("PaymentType") + .HasColumnType("integer"); + + b.Property("Sum") + .HasColumnType("double precision"); + + b.Property("WorkerId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("WorkerId"); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.OrderPresale", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("OrderId") + .HasColumnType("integer"); + + b.Property("PresaleId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.HasIndex("PresaleId"); + + b.ToTable("OrderPresales"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Presale", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("DueTill") + .HasColumnType("timestamp without time zone"); + + b.Property("PresaleStatus") + .HasColumnType("integer"); + + b.Property("Price") + .HasColumnType("double precision"); + + b.HasKey("Id"); + + b.ToTable("Presales"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.PresaleBundling", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BundlingId") + .HasColumnType("integer"); + + b.Property("PresaleId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("BundlingId"); + + b.HasIndex("PresaleId"); + + b.ToTable("PresaleBundlings"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Request", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("PresaleId") + .HasColumnType("integer"); + + b.Property("RequestType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("PresaleId"); + + b.ToTable("Requests"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Storekeeper", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Email") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Password") + .IsRequired() + .HasColumnType("text"); + + b.Property("Patronymic") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("bigint"); + + b.Property("Surname") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Storekeepers"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Worker", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Email") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Password") + .IsRequired() + .HasColumnType("text"); + + b.Property("Patronymic") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("bigint"); + + b.Property("Surname") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Workers"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Car", b => + { + b.HasOne("CarCenterDatabaseImplement.Models.Feature", "Feature") + .WithMany("Cars") + .HasForeignKey("FeatureId"); + + b.HasOne("CarCenterDatabaseImplement.Models.Order", "Order") + .WithMany("Cars") + .HasForeignKey("OrderId"); + + b.HasOne("CarCenterDatabaseImplement.Models.Storekeeper", "Storekeeper") + .WithMany("Cars") + .HasForeignKey("StorekeeperId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Feature"); + + b.Navigation("Order"); + + b.Navigation("Storekeeper"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.CarBundling", b => + { + b.HasOne("CarCenterDatabaseImplement.Models.Bundling", "Bundling") + .WithMany("CarBundling") + .HasForeignKey("BundlingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CarCenterDatabaseImplement.Models.Car", "Car") + .WithMany("Bundlings") + .HasForeignKey("CarId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Bundling"); + + b.Navigation("Car"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Order", b => + { + b.HasOne("CarCenterDatabaseImplement.Models.Worker", "Worker") + .WithMany("Orders") + .HasForeignKey("WorkerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Worker"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.OrderPresale", b => + { + b.HasOne("CarCenterDatabaseImplement.Models.Order", "Order") + .WithMany("Presales") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CarCenterDatabaseImplement.Models.Presale", "Presale") + .WithMany("OrderPresales") + .HasForeignKey("PresaleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Order"); + + b.Navigation("Presale"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.PresaleBundling", b => + { + b.HasOne("CarCenterDatabaseImplement.Models.Bundling", "Bundling") + .WithMany("PresaleBundling") + .HasForeignKey("BundlingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CarCenterDatabaseImplement.Models.Presale", "Presale") + .WithMany("Bundlings") + .HasForeignKey("PresaleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Bundling"); + + b.Navigation("Presale"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Request", b => + { + b.HasOne("CarCenterDatabaseImplement.Models.Presale", "Presale") + .WithMany("Requests") + .HasForeignKey("PresaleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Presale"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Bundling", b => + { + b.Navigation("CarBundling"); + + b.Navigation("PresaleBundling"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Car", b => + { + b.Navigation("Bundlings"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Feature", b => + { + b.Navigation("Cars"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Order", b => + { + b.Navigation("Cars"); + + b.Navigation("Presales"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Presale", b => + { + b.Navigation("Bundlings"); + + b.Navigation("OrderPresales"); + + b.Navigation("Requests"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Storekeeper", b => + { + b.Navigation("Cars"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Worker", b => + { + b.Navigation("Orders"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/CarCenter/CarCenterDatabaseImplement/Migrations/20240528191551_InitFull.cs b/CarCenter/CarCenterDatabaseImplement/Migrations/20240528191551_InitFull.cs new file mode 100644 index 0000000..12b50a3 --- /dev/null +++ b/CarCenter/CarCenterDatabaseImplement/Migrations/20240528191551_InitFull.cs @@ -0,0 +1,19 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace CarCenterDatabaseImplement.Migrations +{ + public partial class InitFull : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +}