From 63fec6a1db4cf250e36f25af0cc22416135490e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=9A=D1=83=D0=BA?= =?UTF-8?q?=D0=BB=D0=B5=D0=B2?= Date: Tue, 30 Apr 2024 20:32:54 +0400 Subject: [PATCH] =?UTF-8?q?=D1=81=D1=8E=D0=B4=D0=B0=202.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20240429152414_InitialCreate.Designer.cs | 372 ++++++++++++++++++ .../20240429152414_InitialCreate.cs | 259 ++++++++++++ .../Migrations/CarCenterDBModelSnapshot.cs | 369 +++++++++++++++++ 3 files changed, 1000 insertions(+) create mode 100644 CarCenterDatabaseImplement/Migrations/20240429152414_InitialCreate.Designer.cs create mode 100644 CarCenterDatabaseImplement/Migrations/20240429152414_InitialCreate.cs create mode 100644 CarCenterDatabaseImplement/Migrations/CarCenterDBModelSnapshot.cs diff --git a/CarCenterDatabaseImplement/Migrations/20240429152414_InitialCreate.Designer.cs b/CarCenterDatabaseImplement/Migrations/20240429152414_InitialCreate.Designer.cs new file mode 100644 index 0000000..b42f777 --- /dev/null +++ b/CarCenterDatabaseImplement/Migrations/20240429152414_InitialCreate.Designer.cs @@ -0,0 +1,372 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using CarCenterDatabaseImplement; + +#nullable disable + +namespace CarCenterDatabaseImplement.Migrations +{ + [DbContext(typeof(CarCenterDB))] + [Migration("20240429152414_InitialCreate")] + partial class InitialCreate + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Account", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClientByDisciplineId") + .HasColumnType("integer"); + + b.Property("DateOfAccount") + .HasColumnType("date"); + + b.Property("Price") + .HasColumnType("double precision"); + + b.HasKey("Id"); + + b.HasIndex("ClientByDisciplineId"); + + b.ToTable("Accounts"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Course") + .HasColumnType("integer"); + + b.Property("DirectorId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Price") + .HasColumnType("double precision"); + + b.HasKey("Id"); + + b.HasIndex("DirectorId"); + + b.ToTable("Clients"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.ClientByDiscipline", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClientId") + .HasColumnType("integer"); + + b.Property("DateOfClient") + .HasColumnType("timestamp with time zone"); + + b.Property("DisciplineId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.HasIndex("DisciplineId"); + + b.ToTable("ClientsByDisciplines"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Director", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Login") + .IsRequired() + .HasColumnType("text"); + + b.Property("Password") + .IsRequired() + .HasColumnType("text"); + + b.Property("PhoneNumber") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Directors"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Discipline", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateOfPassage") + .HasColumnType("date"); + + b.Property("DateOfReceipt") + .HasColumnType("date"); + + b.Property("ImplementerId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Price") + .HasColumnType("double precision"); + + b.HasKey("Id"); + + b.HasIndex("ImplementerId"); + + b.ToTable("Disciplines"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Implementer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Login") + .IsRequired() + .HasColumnType("text"); + + b.Property("Password") + .IsRequired() + .HasColumnType("text"); + + b.Property("PhoneNumber") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Implementers"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Requirement", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DirectorId") + .HasColumnType("integer"); + + b.Property("NameOfRequirement") + .IsRequired() + .HasColumnType("text"); + + b.Property("Price") + .HasColumnType("double precision"); + + b.HasKey("Id"); + + b.HasIndex("DirectorId"); + + b.ToTable("Requirements"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.RequirementByDiscipline", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Count") + .HasColumnType("integer"); + + b.Property("DisciplineId") + .HasColumnType("integer"); + + b.Property("RequirementId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("RequirementId"); + + b.ToTable("RequirementByDisciplines"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Account", b => + { + b.HasOne("CarCenterDatabaseImplement.Models.ClientByDiscipline", "ClientByDiscipline") + .WithMany("Accounts") + .HasForeignKey("ClientByDisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ClientByDiscipline"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Client", b => + { + b.HasOne("CarCenterDatabaseImplement.Models.Director", "Director") + .WithMany("Clients") + .HasForeignKey("DirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Director"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.ClientByDiscipline", b => + { + b.HasOne("CarCenterDatabaseImplement.Models.Client", "Client") + .WithMany("Disciplines") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CarCenterDatabaseImplement.Models.Discipline", "Discipline") + .WithMany("Clients") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Discipline", b => + { + b.HasOne("CarCenterDatabaseImplement.Models.Implementer", "Client") + .WithMany("Disciplines") + .HasForeignKey("ImplementerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Requirement", b => + { + b.HasOne("CarCenterDatabaseImplement.Models.Director", "Director") + .WithMany("Requirements") + .HasForeignKey("DirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Director"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.RequirementByDiscipline", b => + { + b.HasOne("CarCenterDatabaseImplement.Models.Discipline", "Discipline") + .WithMany("Requirements") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CarCenterDatabaseImplement.Models.Requirement", "Requirement") + .WithMany("Disciplines") + .HasForeignKey("RequirementId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Discipline"); + + b.Navigation("Requirement"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Client", b => + { + b.Navigation("Disciplines"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.ClientByDiscipline", b => + { + b.Navigation("Accounts"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Director", b => + { + b.Navigation("Clients"); + + b.Navigation("Requirements"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Discipline", b => + { + b.Navigation("Clients"); + + b.Navigation("Requirements"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Implementer", b => + { + b.Navigation("Disciplines"); + }); + + modelBuilder.Entity("CarCenterDatabaseImplement.Models.Requirement", b => + { + b.Navigation("Disciplines"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/CarCenterDatabaseImplement/Migrations/20240429152414_InitialCreate.cs b/CarCenterDatabaseImplement/Migrations/20240429152414_InitialCreate.cs new file mode 100644 index 0000000..df01015 --- /dev/null +++ b/CarCenterDatabaseImplement/Migrations/20240429152414_InitialCreate.cs @@ -0,0 +1,259 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace CarCenterDatabaseImplement.Migrations +{ + /// + public partial class InitialCreate : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Directors", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + FirstName = table.Column(type: "text", nullable: false), + LastName = table.Column(type: "text", nullable: false), + Login = table.Column(type: "text", nullable: false), + Password = table.Column(type: "text", nullable: false), + PhoneNumber = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Directors", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Implementers", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + FirstName = table.Column(type: "text", nullable: false), + LastName = table.Column(type: "text", nullable: false), + Login = table.Column(type: "text", nullable: false), + Password = table.Column(type: "text", nullable: false), + PhoneNumber = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Implementers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Clients", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + DirectorId = table.Column(type: "integer", nullable: false), + Name = table.Column(type: "text", nullable: false), + Price = table.Column(type: "double precision", nullable: false), + Course = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Clients", x => x.Id); + table.ForeignKey( + name: "FK_Clients_Directors_DirectorId", + column: x => x.DirectorId, + principalTable: "Directors", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Requirements", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + DirectorId = table.Column(type: "integer", nullable: false), + NameOfRequirement = table.Column(type: "text", nullable: false), + Price = table.Column(type: "double precision", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Requirements", x => x.Id); + table.ForeignKey( + name: "FK_Requirements_Directors_DirectorId", + column: x => x.DirectorId, + principalTable: "Directors", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Disciplines", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ImplementerId = table.Column(type: "integer", nullable: false), + Name = table.Column(type: "text", nullable: false), + Price = table.Column(type: "double precision", nullable: false), + DateOfReceipt = table.Column(type: "date", nullable: false), + DateOfPassage = table.Column(type: "date", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Disciplines", x => x.Id); + table.ForeignKey( + name: "FK_Disciplines_Implementers_ImplementerId", + column: x => x.ImplementerId, + principalTable: "Implementers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "ClientsByDisciplines", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ClientId = table.Column(type: "integer", nullable: false), + DisciplineId = table.Column(type: "integer", nullable: false), + DateOfClient = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ClientsByDisciplines", x => x.Id); + table.ForeignKey( + name: "FK_ClientsByDisciplines_Clients_ClientId", + column: x => x.ClientId, + principalTable: "Clients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_ClientsByDisciplines_Disciplines_DisciplineId", + column: x => x.DisciplineId, + principalTable: "Disciplines", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "RequirementByDisciplines", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + RequirementId = table.Column(type: "integer", nullable: false), + DisciplineId = table.Column(type: "integer", nullable: false), + Count = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_RequirementByDisciplines", x => x.Id); + table.ForeignKey( + name: "FK_RequirementByDisciplines_Disciplines_DisciplineId", + column: x => x.DisciplineId, + principalTable: "Disciplines", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_RequirementByDisciplines_Requirements_RequirementId", + column: x => x.RequirementId, + principalTable: "Requirements", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Accounts", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ClientByDisciplineId = table.Column(type: "integer", nullable: false), + DateOfAccount = table.Column(type: "date", nullable: false), + Price = table.Column(type: "double precision", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Accounts", x => x.Id); + table.ForeignKey( + name: "FK_Accounts_ClientsByDisciplines_ClientByDisciplineId", + column: x => x.ClientByDisciplineId, + principalTable: "ClientsByDisciplines", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_Accounts_ClientByDisciplineId", + table: "Accounts", + column: "ClientByDisciplineId"); + + migrationBuilder.CreateIndex( + name: "IX_Clients_DirectorId", + table: "Clients", + column: "DirectorId"); + + migrationBuilder.CreateIndex( + name: "IX_ClientsByDisciplines_ClientId", + table: "ClientsByDisciplines", + column: "ClientId"); + + migrationBuilder.CreateIndex( + name: "IX_ClientsByDisciplines_DisciplineId", + table: "ClientsByDisciplines", + column: "DisciplineId"); + + migrationBuilder.CreateIndex( + name: "IX_Disciplines_ImplementerId", + table: "Disciplines", + column: "ImplementerId"); + + migrationBuilder.CreateIndex( + name: "IX_RequirementByDisciplines_DisciplineId", + table: "RequirementByDisciplines", + column: "DisciplineId"); + + migrationBuilder.CreateIndex( + name: "IX_RequirementByDisciplines_RequirementId", + table: "RequirementByDisciplines", + column: "RequirementId"); + + migrationBuilder.CreateIndex( + name: "IX_Requirements_DirectorId", + table: "Requirements", + column: "DirectorId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Accounts"); + + migrationBuilder.DropTable( + name: "RequirementByDisciplines"); + + migrationBuilder.DropTable( + name: "ClientsByDisciplines"); + + migrationBuilder.DropTable( + name: "Requirements"); + + migrationBuilder.DropTable( + name: "Clients"); + + migrationBuilder.DropTable( + name: "Disciplines"); + + migrationBuilder.DropTable( + name: "Directors"); + + migrationBuilder.DropTable( + name: "Implementers"); + } + } +} diff --git a/CarCenterDatabaseImplement/Migrations/CarCenterDBModelSnapshot.cs b/CarCenterDatabaseImplement/Migrations/CarCenterDBModelSnapshot.cs new file mode 100644 index 0000000..bc7cc27 --- /dev/null +++ b/CarCenterDatabaseImplement/Migrations/CarCenterDBModelSnapshot.cs @@ -0,0 +1,369 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using UniversityDatabaseImplement; + +#nullable disable + +namespace UniversityDatabaseImplement.Migrations +{ + [DbContext(typeof(UniversityDB))] + partial class UniversityDBModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.Account", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClientByModelsId") + .HasColumnType("integer"); + + b.Property("DateOfAccount") + .HasColumnType("date"); + + b.Property("Price") + .HasColumnType("double precision"); + + b.HasKey("Id"); + + b.HasIndex("ClientByModelsId"); + + b.ToTable("Accounts"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Course") + .HasColumnType("integer"); + + b.Property("DirectorId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Price") + .HasColumnType("double precision"); + + b.HasKey("Id"); + + b.HasIndex("DirectorId"); + + b.ToTable("Clients"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.ClientByModels", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClientId") + .HasColumnType("integer"); + + b.Property("DateOfClient") + .HasColumnType("timestamp with time zone"); + + b.Property("ModelsId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.HasIndex("ModelsId"); + + b.ToTable("ClientsByModelss"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.Director", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Login") + .IsRequired() + .HasColumnType("text"); + + b.Property("Password") + .IsRequired() + .HasColumnType("text"); + + b.Property("PhoneNumber") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Directors"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.Models", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateOfPassage") + .HasColumnType("date"); + + b.Property("DateOfReceipt") + .HasColumnType("date"); + + b.Property("ImplementerId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Price") + .HasColumnType("double precision"); + + b.HasKey("Id"); + + b.HasIndex("ImplementerId"); + + b.ToTable("Modelss"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.Implementer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Login") + .IsRequired() + .HasColumnType("text"); + + b.Property("Password") + .IsRequired() + .HasColumnType("text"); + + b.Property("PhoneNumber") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Implementers"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.Requirement", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DirectorId") + .HasColumnType("integer"); + + b.Property("NameOfRequirement") + .IsRequired() + .HasColumnType("text"); + + b.Property("Price") + .HasColumnType("double precision"); + + b.HasKey("Id"); + + b.HasIndex("DirectorId"); + + b.ToTable("Requirements"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.RequirementByModels", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Count") + .HasColumnType("integer"); + + b.Property("ModelsId") + .HasColumnType("integer"); + + b.Property("RequirementId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ModelsId"); + + b.HasIndex("RequirementId"); + + b.ToTable("RequirementByModelss"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.Account", b => + { + b.HasOne("UniversityDatabaseImplement.Models.ClientByModels", "ClientByModels") + .WithMany("Accounts") + .HasForeignKey("ClientByModelsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ClientByModels"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.Client", b => + { + b.HasOne("UniversityDatabaseImplement.Models.Director", "Director") + .WithMany("Clients") + .HasForeignKey("DirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Director"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.ClientByModels", b => + { + b.HasOne("UniversityDatabaseImplement.Models.Client", "Client") + .WithMany("Modelss") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("UniversityDatabaseImplement.Models.Models", "Models") + .WithMany("Clients") + .HasForeignKey("ModelsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + + b.Navigation("Models"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.Models", b => + { + b.HasOne("UniversityDatabaseImplement.Models.Implementer", "Client") + .WithMany("Modelss") + .HasForeignKey("ImplementerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.Requirement", b => + { + b.HasOne("UniversityDatabaseImplement.Models.Director", "Director") + .WithMany("Requirements") + .HasForeignKey("DirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Director"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.RequirementByModels", b => + { + b.HasOne("UniversityDatabaseImplement.Models.Models", "Models") + .WithMany("Requirements") + .HasForeignKey("ModelsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("UniversityDatabaseImplement.Models.Requirement", "Requirement") + .WithMany("Modelss") + .HasForeignKey("RequirementId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Models"); + + b.Navigation("Requirement"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.Client", b => + { + b.Navigation("Modelss"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.ClientByModels", b => + { + b.Navigation("Accounts"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.Director", b => + { + b.Navigation("Clients"); + + b.Navigation("Requirements"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.Models", b => + { + b.Navigation("Clients"); + + b.Navigation("Requirements"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.Implementer", b => + { + b.Navigation("Modelss"); + }); + + modelBuilder.Entity("UniversityDatabaseImplement.Models.Requirement", b => + { + b.Navigation("Modelss"); + }); +#pragma warning restore 612, 618 + } + } +}