diff --git a/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240430082941_InitialCreate.Designer.cs b/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240430082941_InitialCreate.Designer.cs deleted file mode 100644 index 096e879..0000000 --- a/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240430082941_InitialCreate.Designer.cs +++ /dev/null @@ -1,302 +0,0 @@ -// -using System; -using CarpentryWorkshopDatabaseImplement; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace CarpentryWorkshopDatabaseImplement.Migrations -{ - [DbContext(typeof(CarpentryWorkshopDatabase))] -<<<<<<<< HEAD:CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240428043913_InitialCreate.Designer.cs - [Migration("20240428043913_InitialCreate")] -======== - [Migration("20240430082941_InitialCreate")] ->>>>>>>> Lab6:CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240430082941_InitialCreate.Designer.cs - partial class InitialCreate - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("CarpentryWorkshopDatabaseImplement.Models.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ClientFIO") - .IsRequired() - .HasColumnType("text"); - - b.Property("Email") - .IsRequired() - .HasColumnType("text"); - - b.Property("Password") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Clients"); - }); - - modelBuilder.Entity("CarpentryWorkshopDatabaseImplement.Models.Component", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ComponentName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Cost") - .HasColumnType("double precision"); - - b.HasKey("Id"); - - b.ToTable("Components"); - }); - - modelBuilder.Entity("CarpentryWorkshopDatabaseImplement.Models.Implementer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ImplementerFIO") - .IsRequired() - .HasColumnType("text"); - - b.Property("Password") - .IsRequired() - .HasColumnType("text"); - - b.Property("Qualification") - .HasColumnType("integer"); - - b.Property("WorkExperience") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.ToTable("Implementers"); - }); - - modelBuilder.Entity("CarpentryWorkshopDatabaseImplement.Models.MessageInfo", b => - { - b.Property("MessageId") - .HasColumnType("text"); - - b.Property("Body") - .IsRequired() - .HasColumnType("text"); - - b.Property("ClientId") - .HasColumnType("integer"); - - b.Property("DateDelivery") - .HasColumnType("timestamp with time zone"); - - b.Property("SenderName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("MessageId"); - - b.HasIndex("ClientId"); - - b.ToTable("MessageInfos"); - }); - - modelBuilder.Entity("CarpentryWorkshopDatabaseImplement.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ClientId") - .HasColumnType("integer"); - - b.Property("Count") - .HasColumnType("integer"); - - b.Property("DateCreate") - .HasColumnType("timestamp with time zone"); - - b.Property("DateImplement") - .HasColumnType("timestamp with time zone"); - - b.Property("ImplementerId") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("Sum") - .HasColumnType("double precision"); - - b.Property("WoodId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.HasIndex("ImplementerId"); - - b.HasIndex("WoodId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("CarpentryWorkshopDatabaseImplement.Models.Wood", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Price") - .HasColumnType("double precision"); - - b.Property("WoodName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Woods"); - }); - - modelBuilder.Entity("CarpentryWorkshopDatabaseImplement.Models.WoodComponent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ComponentId") - .HasColumnType("integer"); - - b.Property("Count") - .HasColumnType("integer"); - - b.Property("WoodId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ComponentId"); - - b.HasIndex("WoodId"); - - b.ToTable("WoodComponents"); - }); - - modelBuilder.Entity("CarpentryWorkshopDatabaseImplement.Models.MessageInfo", b => - { - b.HasOne("CarpentryWorkshopDatabaseImplement.Models.Client", "Client") - .WithMany("ClientMessages") - .HasForeignKey("ClientId"); - - b.Navigation("Client"); - }); - - modelBuilder.Entity("CarpentryWorkshopDatabaseImplement.Models.Order", b => - { - b.HasOne("CarpentryWorkshopDatabaseImplement.Models.Client", "Client") - .WithMany("ClientOrders") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("CarpentryWorkshopDatabaseImplement.Models.Implementer", "Implementer") - .WithMany("Order") - .HasForeignKey("ImplementerId"); - - b.HasOne("CarpentryWorkshopDatabaseImplement.Models.Wood", "Wood") - .WithMany("Orders") - .HasForeignKey("WoodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Client"); - - b.Navigation("Implementer"); - - b.Navigation("Wood"); - }); - - modelBuilder.Entity("CarpentryWorkshopDatabaseImplement.Models.WoodComponent", b => - { - b.HasOne("CarpentryWorkshopDatabaseImplement.Models.Component", "Component") - .WithMany("WoodComponents") - .HasForeignKey("ComponentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("CarpentryWorkshopDatabaseImplement.Models.Wood", "Wood") - .WithMany("Components") - .HasForeignKey("WoodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Component"); - - b.Navigation("Wood"); - }); - - modelBuilder.Entity("CarpentryWorkshopDatabaseImplement.Models.Client", b => - { - b.Navigation("ClientMessages"); - - b.Navigation("ClientOrders"); - }); - - modelBuilder.Entity("CarpentryWorkshopDatabaseImplement.Models.Component", b => - { - b.Navigation("WoodComponents"); - }); - - modelBuilder.Entity("CarpentryWorkshopDatabaseImplement.Models.Implementer", b => - { - b.Navigation("Order"); - }); - - modelBuilder.Entity("CarpentryWorkshopDatabaseImplement.Models.Wood", b => - { - b.Navigation("Components"); - - b.Navigation("Orders"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240430082941_InitialCreate.cs b/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240430082941_InitialCreate.cs deleted file mode 100644 index 9af448a..0000000 --- a/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240430082941_InitialCreate.cs +++ /dev/null @@ -1,215 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace CarpentryWorkshopDatabaseImplement.Migrations -{ - /// - public partial class InitialCreate : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Clients", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - ClientFIO = table.Column(type: "text", nullable: false), - Email = table.Column(type: "text", nullable: false), - Password = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Clients", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Components", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - ComponentName = table.Column(type: "text", nullable: false), - Cost = table.Column(type: "double precision", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Components", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Implementers", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - ImplementerFIO = table.Column(type: "text", nullable: false), - Password = table.Column(type: "text", nullable: false), - WorkExperience = table.Column(type: "integer", nullable: false), - Qualification = table.Column(type: "integer", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Implementers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Woods", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - WoodName = table.Column(type: "text", nullable: false), - Price = table.Column(type: "double precision", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Woods", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "MessageInfos", - columns: table => new - { - MessageId = table.Column(type: "text", nullable: false), - ClientId = table.Column(type: "integer", nullable: true), - SenderName = table.Column(type: "text", nullable: false), - DateDelivery = table.Column(type: "timestamp with time zone", nullable: false), - Subject = table.Column(type: "text", nullable: false), - Body = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_MessageInfos", x => x.MessageId); - table.ForeignKey( - name: "FK_MessageInfos_Clients_ClientId", - column: x => x.ClientId, - principalTable: "Clients", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "Orders", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - WoodId = table.Column(type: "integer", nullable: false), - ImplementerId = table.Column(type: "integer", nullable: true), - ClientId = table.Column(type: "integer", nullable: false), - Count = table.Column(type: "integer", nullable: false), - Sum = table.Column(type: "double precision", nullable: false), - Status = table.Column(type: "integer", nullable: false), - DateCreate = table.Column(type: "timestamp with time zone", nullable: false), - DateImplement = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Orders", x => x.Id); - table.ForeignKey( - name: "FK_Orders_Clients_ClientId", - column: x => x.ClientId, - principalTable: "Clients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Orders_Implementers_ImplementerId", - column: x => x.ImplementerId, - principalTable: "Implementers", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_Orders_Woods_WoodId", - column: x => x.WoodId, - principalTable: "Woods", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "WoodComponents", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - WoodId = table.Column(type: "integer", nullable: false), - ComponentId = table.Column(type: "integer", nullable: false), - Count = table.Column(type: "integer", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WoodComponents", x => x.Id); - table.ForeignKey( - name: "FK_WoodComponents_Components_ComponentId", - column: x => x.ComponentId, - principalTable: "Components", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_WoodComponents_Woods_WoodId", - column: x => x.WoodId, - principalTable: "Woods", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_MessageInfos_ClientId", - table: "MessageInfos", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_ClientId", - table: "Orders", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_ImplementerId", - table: "Orders", - column: "ImplementerId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_WoodId", - table: "Orders", - column: "WoodId"); - - migrationBuilder.CreateIndex( - name: "IX_WoodComponents_ComponentId", - table: "WoodComponents", - column: "ComponentId"); - - migrationBuilder.CreateIndex( - name: "IX_WoodComponents_WoodId", - table: "WoodComponents", - column: "WoodId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "MessageInfos"); - - migrationBuilder.DropTable( - name: "Orders"); - - migrationBuilder.DropTable( - name: "WoodComponents"); - - migrationBuilder.DropTable( - name: "Clients"); - - migrationBuilder.DropTable( - name: "Implementers"); - - migrationBuilder.DropTable( - name: "Components"); - - migrationBuilder.DropTable( - name: "Woods"); - } - } -} diff --git a/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240428043913_InitialCreate.Designer.cs b/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240511234357_InitialCreate.Designer.cs similarity index 94% rename from CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240428043913_InitialCreate.Designer.cs rename to CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240511234357_InitialCreate.Designer.cs index 096e879..13a8231 100644 --- a/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240428043913_InitialCreate.Designer.cs +++ b/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240511234357_InitialCreate.Designer.cs @@ -12,11 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace CarpentryWorkshopDatabaseImplement.Migrations { [DbContext(typeof(CarpentryWorkshopDatabase))] -<<<<<<<< HEAD:CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240428043913_InitialCreate.Designer.cs - [Migration("20240428043913_InitialCreate")] -======== - [Migration("20240430082941_InitialCreate")] ->>>>>>>> Lab6:CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240430082941_InitialCreate.Designer.cs + [Migration("20240511234357_InitialCreate")] partial class InitialCreate { /// @@ -114,7 +110,7 @@ namespace CarpentryWorkshopDatabaseImplement.Migrations .HasColumnType("integer"); b.Property("DateDelivery") - .HasColumnType("timestamp with time zone"); + .HasColumnType("timestamp without time zone"); b.Property("SenderName") .IsRequired() @@ -146,10 +142,10 @@ namespace CarpentryWorkshopDatabaseImplement.Migrations .HasColumnType("integer"); b.Property("DateCreate") - .HasColumnType("timestamp with time zone"); + .HasColumnType("timestamp without time zone"); b.Property("DateImplement") - .HasColumnType("timestamp with time zone"); + .HasColumnType("timestamp without time zone"); b.Property("ImplementerId") .HasColumnType("integer"); diff --git a/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240428043913_InitialCreate.cs b/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240511234357_InitialCreate.cs similarity index 98% rename from CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240428043913_InitialCreate.cs rename to CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240511234357_InitialCreate.cs index 9af448a..e0fc93d 100644 --- a/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240428043913_InitialCreate.cs +++ b/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/20240511234357_InitialCreate.cs @@ -78,7 +78,7 @@ namespace CarpentryWorkshopDatabaseImplement.Migrations MessageId = table.Column(type: "text", nullable: false), ClientId = table.Column(type: "integer", nullable: true), SenderName = table.Column(type: "text", nullable: false), - DateDelivery = table.Column(type: "timestamp with time zone", nullable: false), + DateDelivery = table.Column(type: "timestamp without time zone", nullable: false), Subject = table.Column(type: "text", nullable: false), Body = table.Column(type: "text", nullable: false) }, @@ -104,8 +104,8 @@ namespace CarpentryWorkshopDatabaseImplement.Migrations Count = table.Column(type: "integer", nullable: false), Sum = table.Column(type: "double precision", nullable: false), Status = table.Column(type: "integer", nullable: false), - DateCreate = table.Column(type: "timestamp with time zone", nullable: false), - DateImplement = table.Column(type: "timestamp with time zone", nullable: true) + DateCreate = table.Column(type: "timestamp without time zone", nullable: false), + DateImplement = table.Column(type: "timestamp without time zone", nullable: true) }, constraints: table => { diff --git a/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/CarpentryWorkshopDatabaseModelSnapshot.cs b/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/CarpentryWorkshopDatabaseModelSnapshot.cs index 4ae69cd..ce95923 100644 --- a/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/CarpentryWorkshopDatabaseModelSnapshot.cs +++ b/CarpentryWorkshop/CarpentryWorkshopDatabaseImplement/Migrations/CarpentryWorkshopDatabaseModelSnapshot.cs @@ -107,7 +107,7 @@ namespace CarpentryWorkshopDatabaseImplement.Migrations .HasColumnType("integer"); b.Property("DateDelivery") - .HasColumnType("timestamp with time zone"); + .HasColumnType("timestamp without time zone"); b.Property("SenderName") .IsRequired() @@ -139,10 +139,10 @@ namespace CarpentryWorkshopDatabaseImplement.Migrations .HasColumnType("integer"); b.Property("DateCreate") - .HasColumnType("timestamp with time zone"); + .HasColumnType("timestamp without time zone"); b.Property("DateImplement") - .HasColumnType("timestamp with time zone"); + .HasColumnType("timestamp without time zone"); b.Property("ImplementerId") .HasColumnType("integer");