From 8044cadda1340474a75e9feb715ec7c68cd5998f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Wed, 8 Mar 2023 14:40:41 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BC=D0=B8=D0=B3=D1=80=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8F,=20=D1=81=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=D0=BC=20=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D0=B0,=20=D1=87=D1=82=D0=BE=D0=B1=D1=8B=20=D1=83=D0=B4=D0=B0?= =?UTF-8?q?=D0=BB=D1=8F=D0=BB=D0=B8=D1=81=D1=8C=20=D0=B2=D1=81=D0=B5=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BA=D0=B0=D0=B7=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... => 20230307072144_add_client.Designer.cs} | 4 +- ...client.cs => 20230307072144_add_client.cs} | 3 +- .../ConfectioneryDatabaseModelSnapshot.cs | 154 +++++++++--------- 3 files changed, 81 insertions(+), 80 deletions(-) rename ConfectioneryDatabaseImplement/Migrations/{20230304103151_add_entity_client.Designer.cs => 20230307072144_add_client.Designer.cs} (98%) rename ConfectioneryDatabaseImplement/Migrations/{20230304103151_add_entity_client.cs => 20230307072144_add_client.cs} (95%) diff --git a/ConfectioneryDatabaseImplement/Migrations/20230304103151_add_entity_client.Designer.cs b/ConfectioneryDatabaseImplement/Migrations/20230307072144_add_client.Designer.cs similarity index 98% rename from ConfectioneryDatabaseImplement/Migrations/20230304103151_add_entity_client.Designer.cs rename to ConfectioneryDatabaseImplement/Migrations/20230307072144_add_client.Designer.cs index d19d47f..9491b2a 100644 --- a/ConfectioneryDatabaseImplement/Migrations/20230304103151_add_entity_client.Designer.cs +++ b/ConfectioneryDatabaseImplement/Migrations/20230307072144_add_client.Designer.cs @@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace ConfectioneryDatabaseImplement.Migrations { [DbContext(typeof(ConfectioneryDatabase))] - [Migration("20230304103151_add_entity_client")] - partial class add_entity_client + [Migration("20230307072144_add_client")] + partial class add_client { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) diff --git a/ConfectioneryDatabaseImplement/Migrations/20230304103151_add_entity_client.cs b/ConfectioneryDatabaseImplement/Migrations/20230307072144_add_client.cs similarity index 95% rename from ConfectioneryDatabaseImplement/Migrations/20230304103151_add_entity_client.cs rename to ConfectioneryDatabaseImplement/Migrations/20230307072144_add_client.cs index 262ea63..df8a7e2 100644 --- a/ConfectioneryDatabaseImplement/Migrations/20230304103151_add_entity_client.cs +++ b/ConfectioneryDatabaseImplement/Migrations/20230307072144_add_client.cs @@ -5,11 +5,12 @@ namespace ConfectioneryDatabaseImplement.Migrations { /// - public partial class add_entity_client : Migration + public partial class add_client : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { + migrationBuilder.Sql("DELETE FROM Orders"); migrationBuilder.AddColumn( name: "ClientId", table: "Orders", diff --git a/ConfectioneryDatabaseImplement/Migrations/ConfectioneryDatabaseModelSnapshot.cs b/ConfectioneryDatabaseImplement/Migrations/ConfectioneryDatabaseModelSnapshot.cs index 2ca4154..a109493 100644 --- a/ConfectioneryDatabaseImplement/Migrations/ConfectioneryDatabaseModelSnapshot.cs +++ b/ConfectioneryDatabaseImplement/Migrations/ConfectioneryDatabaseModelSnapshot.cs @@ -10,17 +10,17 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace ConfectioneryDatabaseImplement.Migrations { - [DbContext(typeof(ConfectioneryDatabase))] - partial class ConfectioneryDatabaseModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { + [DbContext(typeof(ConfectioneryDatabase))] + partial class ConfectioneryDatabaseModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { #pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); + modelBuilder + .HasAnnotation("ProductVersion", "7.0.3") + .HasAnnotation("Relational:MaxIdentifierLength", 128); - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Client", b => { @@ -28,7 +28,7 @@ namespace ConfectioneryDatabaseImplement.Migrations .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ClientFIO") .IsRequired() @@ -59,21 +59,21 @@ namespace ConfectioneryDatabaseImplement.Migrations .IsRequired() .HasColumnType("nvarchar(max)"); - b.Property("Cost") - .HasColumnType("float"); + b.Property("Cost") + .HasColumnType("float"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("Components"); - }); + b.ToTable("Components"); + }); - modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); + modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("ClientId") .HasColumnType("int"); @@ -81,75 +81,75 @@ namespace ConfectioneryDatabaseImplement.Migrations b.Property("Count") .HasColumnType("int"); - b.Property("DateCreate") - .HasColumnType("datetime2"); + b.Property("DateCreate") + .HasColumnType("datetime2"); - b.Property("DateImplement") - .HasColumnType("datetime2"); + b.Property("DateImplement") + .HasColumnType("datetime2"); - b.Property("PastryId") - .HasColumnType("int"); + b.Property("PastryId") + .HasColumnType("int"); - b.Property("Status") - .HasColumnType("int"); + b.Property("Status") + .HasColumnType("int"); - b.Property("Sum") - .HasColumnType("float"); + b.Property("Sum") + .HasColumnType("float"); - b.HasKey("Id"); + b.HasKey("Id"); b.HasIndex("ClientId"); b.HasIndex("PastryId"); - b.ToTable("Orders"); - }); + b.ToTable("Orders"); + }); - modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Pastry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); + modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Pastry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - b.Property("PastryName") - .IsRequired() - .HasColumnType("nvarchar(max)"); + b.Property("PastryName") + .IsRequired() + .HasColumnType("nvarchar(max)"); - b.Property("Price") - .HasColumnType("float"); + b.Property("Price") + .HasColumnType("float"); - b.HasKey("Id"); + b.HasKey("Id"); b.ToTable("Pastries"); }); - modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.PastryComponent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); + modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.PastryComponent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - b.Property("ComponentId") - .HasColumnType("int"); + b.Property("ComponentId") + .HasColumnType("int"); - b.Property("Count") - .HasColumnType("int"); + b.Property("Count") + .HasColumnType("int"); - b.Property("PastryId") - .HasColumnType("int"); + b.Property("PastryId") + .HasColumnType("int"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("ComponentId"); + b.HasIndex("ComponentId"); - b.HasIndex("PastryId"); + b.HasIndex("PastryId"); - b.ToTable("PastryComponents"); - }); + b.ToTable("PastryComponents"); + }); modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Order", b => { @@ -178,16 +178,16 @@ namespace ConfectioneryDatabaseImplement.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("ConfectioneryDatabaseImplement.Models.Pastry", "Pastry") - .WithMany("Components") - .HasForeignKey("PastryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("ConfectioneryDatabaseImplement.Models.Pastry", "Pastry") + .WithMany("Components") + .HasForeignKey("PastryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); b.Navigation("Component"); - b.Navigation("Pastry"); - }); + b.Navigation("Pastry"); + }); modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Client", b => { @@ -199,13 +199,13 @@ namespace ConfectioneryDatabaseImplement.Migrations b.Navigation("PastryComponents"); }); - modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Pastry", b => - { - b.Navigation("Components"); + modelBuilder.Entity("ConfectioneryDatabaseImplement.Models.Pastry", b => + { + b.Navigation("Components"); - b.Navigation("Orders"); - }); + b.Navigation("Orders"); + }); #pragma warning restore 612, 618 - } - } + } + } }