This commit is contained in:
Marselchi 2024-05-29 18:30:36 +04:00
commit f6eb581099
2 changed files with 517 additions and 0 deletions

View File

@ -6,7 +6,11 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace CarCenterDatabaseImplement.Migrations
{
<<<<<<<< HEAD:CarCenter/CarCenterDatabaseImplement/Migrations/20240529134131_FixTest.cs
public partial class FixTest : Migration
========
public partial class ababa4 : Migration
>>>>>>>> d89e50b210935777ba7b3d61880ea7525a5955b5:CarCenter/CarCenterDatabaseImplement/Migrations/20240529141913_ababa4.cs
{
protected override void Up(MigrationBuilder migrationBuilder)
{
@ -16,6 +20,7 @@ namespace CarCenterDatabaseImplement.Migrations
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
DateCreate = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
StorekeeperId = table.Column<int>(type: "integer", nullable: false),
EquipmentPackage = table.Column<int>(type: "integer", nullable: false),
TirePackage = table.Column<int>(type: "integer", nullable: false),
@ -183,6 +188,7 @@ namespace CarCenterDatabaseImplement.Migrations
Year = table.Column<int>(type: "integer", nullable: false),
Price = table.Column<double>(type: "double precision", nullable: false),
VINnumber = table.Column<long>(type: "bigint", nullable: false),
DateCreate = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
FeatureID = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>

View File

@ -0,0 +1,511 @@
// <auto-generated />
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("20240529141913_ababa4")]
partial class ababa4
{
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<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("DateCreate")
.HasColumnType("timestamp without time zone");
b.Property<int>("EquipmentPackage")
.HasColumnType("integer");
b.Property<double>("Price")
.HasColumnType("double precision");
b.Property<int>("StorekeeperId")
.HasColumnType("integer");
b.Property<int>("TirePackage")
.HasColumnType("integer");
b.Property<int>("ToolKit")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("Bundlings");
});
modelBuilder.Entity("CarCenterDatabaseImplement.Models.Car", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("CarBrand")
.HasColumnType("integer");
b.Property<int>("CarClass")
.HasColumnType("integer");
b.Property<DateTime>("DateCreate")
.HasColumnType("timestamp without time zone");
b.Property<int>("FeatureID")
.HasColumnType("integer");
b.Property<int?>("FeatureId")
.HasColumnType("integer");
b.Property<string>("Model")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("OrderId")
.HasColumnType("integer");
b.Property<double>("Price")
.HasColumnType("double precision");
b.Property<int>("StorekeeperId")
.HasColumnType("integer");
b.Property<long>("VINnumber")
.HasColumnType("bigint");
b.Property<int>("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<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("BundlingId")
.HasColumnType("integer");
b.Property<int>("CarId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("BundlingId");
b.HasIndex("CarId");
b.ToTable("CarBundlings");
});
modelBuilder.Entity("CarCenterDatabaseImplement.Models.Feature", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("CabinColor")
.IsRequired()
.HasColumnType("text");
b.Property<int>("DriveType")
.HasColumnType("integer");
b.Property<int>("HelpDevice")
.HasColumnType("integer");
b.Property<double>("Price")
.HasColumnType("double precision");
b.Property<int>("StorekeeperId")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("Features");
});
modelBuilder.Entity("CarCenterDatabaseImplement.Models.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("BuyerFCS")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("PaymentDate")
.HasColumnType("timestamp without time zone");
b.Property<int>("PaymentStatus")
.HasColumnType("integer");
b.Property<int>("PaymentType")
.HasColumnType("integer");
b.Property<double>("Sum")
.HasColumnType("double precision");
b.Property<int>("WorkerId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("WorkerId");
b.ToTable("Orders");
});
modelBuilder.Entity("CarCenterDatabaseImplement.Models.OrderPresale", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("OrderId")
.HasColumnType("integer");
b.Property<int>("PresaleId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("OrderId");
b.HasIndex("PresaleId");
b.ToTable("OrderPresales");
});
modelBuilder.Entity("CarCenterDatabaseImplement.Models.Presale", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("DueTill")
.HasColumnType("timestamp without time zone");
b.Property<int>("PresaleStatus")
.HasColumnType("integer");
b.Property<double>("Price")
.HasColumnType("double precision");
b.HasKey("Id");
b.ToTable("Presales");
});
modelBuilder.Entity("CarCenterDatabaseImplement.Models.PresaleBundling", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("BundlingId")
.HasColumnType("integer");
b.Property<int>("PresaleId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("BundlingId");
b.HasIndex("PresaleId");
b.ToTable("PresaleBundlings");
});
modelBuilder.Entity("CarCenterDatabaseImplement.Models.Request", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.IsRequired()
.HasColumnType("text");
b.Property<int>("PresaleId")
.HasColumnType("integer");
b.Property<int>("RequestType")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("PresaleId");
b.ToTable("Requests");
});
modelBuilder.Entity("CarCenterDatabaseImplement.Models.Storekeeper", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Patronymic")
.HasColumnType("text");
b.Property<long>("PhoneNumber")
.HasColumnType("bigint");
b.Property<string>("Surname")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Storekeepers");
});
modelBuilder.Entity("CarCenterDatabaseImplement.Models.Worker", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Patronymic")
.HasColumnType("text");
b.Property<long>("PhoneNumber")
.HasColumnType("bigint");
b.Property<string>("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
}
}
}