From f94aa5c332c4f7ebca92baab46d37f81e3a05f8c Mon Sep 17 00:00:00 2001 From: goblinrf Date: Tue, 16 Apr 2024 13:03:58 +0400 Subject: [PATCH] jkj --- Diner/DinerDataBaseImplement/DinerDatabase.cs | 2 +- .../20240402095625_Init.Designer.cs | 214 ------------------ .../Migrations/20240402095625_Init.cs | 155 ------------- .../Migrations/DinerDatabaseModelSnapshot.cs | 211 ----------------- 4 files changed, 1 insertion(+), 581 deletions(-) delete mode 100644 Diner/DinerDataBaseImplement/Migrations/20240402095625_Init.Designer.cs delete mode 100644 Diner/DinerDataBaseImplement/Migrations/20240402095625_Init.cs delete mode 100644 Diner/DinerDataBaseImplement/Migrations/DinerDatabaseModelSnapshot.cs diff --git a/Diner/DinerDataBaseImplement/DinerDatabase.cs b/Diner/DinerDataBaseImplement/DinerDatabase.cs index 0f8840b..e976ffa 100644 --- a/Diner/DinerDataBaseImplement/DinerDatabase.cs +++ b/Diner/DinerDataBaseImplement/DinerDatabase.cs @@ -9,7 +9,7 @@ namespace DinerDataBaseImplement { if (optionsBuilder.IsConfigured == false) { - optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS01;Initial Catalog=DinerDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); + optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS0;Initial Catalog=DinerDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); } base.OnConfiguring(optionsBuilder); } diff --git a/Diner/DinerDataBaseImplement/Migrations/20240402095625_Init.Designer.cs b/Diner/DinerDataBaseImplement/Migrations/20240402095625_Init.Designer.cs deleted file mode 100644 index 1a4b5a0..0000000 --- a/Diner/DinerDataBaseImplement/Migrations/20240402095625_Init.Designer.cs +++ /dev/null @@ -1,214 +0,0 @@ -// -using System; -using DinerDataBaseImplement; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace DinerDataBaseImplement.Migrations -{ - [DbContext(typeof(DinerDatabase))] - [Migration("20240402095625_Init")] - partial class Init - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("DinerDataBaseImplement.Models.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClientFIO") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Password") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Clients"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.Component", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ComponentName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Cost") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.ToTable("Components"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClientId") - .HasColumnType("int"); - - b.Property("Count") - .HasColumnType("int"); - - b.Property("DateCreate") - .HasColumnType("datetime2"); - - b.Property("DateImplement") - .HasColumnType("datetime2"); - - b.Property("SnackId") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Sum") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.HasIndex("SnackId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.Snack", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Price") - .HasColumnType("float"); - - b.Property("SnackName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Snacks"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.SnackComponent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ComponentId") - .HasColumnType("int"); - - b.Property("Count") - .HasColumnType("int"); - - b.Property("SnackId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ComponentId"); - - b.HasIndex("SnackId"); - - b.ToTable("SnackComponents"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.Order", b => - { - b.HasOne("DinerDataBaseImplement.Models.Client", "Client") - .WithMany("Orders") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("DinerDataBaseImplement.Models.Snack", "Snack") - .WithMany("Orders") - .HasForeignKey("SnackId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Client"); - - b.Navigation("Snack"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.SnackComponent", b => - { - b.HasOne("DinerDataBaseImplement.Models.Component", "Component") - .WithMany("SnackComponents") - .HasForeignKey("ComponentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("DinerDataBaseImplement.Models.Snack", "Snack") - .WithMany("Components") - .HasForeignKey("SnackId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Component"); - - b.Navigation("Snack"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.Client", b => - { - b.Navigation("Orders"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.Component", b => - { - b.Navigation("SnackComponents"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.Snack", b => - { - b.Navigation("Components"); - - b.Navigation("Orders"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Diner/DinerDataBaseImplement/Migrations/20240402095625_Init.cs b/Diner/DinerDataBaseImplement/Migrations/20240402095625_Init.cs deleted file mode 100644 index a64e759..0000000 --- a/Diner/DinerDataBaseImplement/Migrations/20240402095625_Init.cs +++ /dev/null @@ -1,155 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace DinerDataBaseImplement.Migrations -{ - /// - public partial class Init : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Clients", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ClientFIO = table.Column(type: "nvarchar(max)", nullable: false), - Email = table.Column(type: "nvarchar(max)", nullable: false), - Password = table.Column(type: "nvarchar(max)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Clients", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Components", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ComponentName = table.Column(type: "nvarchar(max)", nullable: false), - Cost = table.Column(type: "float", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Components", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Snacks", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - SnackName = table.Column(type: "nvarchar(max)", nullable: false), - Price = table.Column(type: "float", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Snacks", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Orders", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ClientId = table.Column(type: "int", nullable: false), - SnackId = table.Column(type: "int", nullable: false), - Count = table.Column(type: "int", nullable: false), - Sum = table.Column(type: "float", nullable: false), - Status = table.Column(type: "int", nullable: false), - DateCreate = table.Column(type: "datetime2", nullable: false), - DateImplement = table.Column(type: "datetime2", 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_Snacks_SnackId", - column: x => x.SnackId, - principalTable: "Snacks", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "SnackComponents", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - SnackId = table.Column(type: "int", nullable: false), - ComponentId = table.Column(type: "int", nullable: false), - Count = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_SnackComponents", x => x.Id); - table.ForeignKey( - name: "FK_SnackComponents_Components_ComponentId", - column: x => x.ComponentId, - principalTable: "Components", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_SnackComponents_Snacks_SnackId", - column: x => x.SnackId, - principalTable: "Snacks", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_Orders_ClientId", - table: "Orders", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_SnackId", - table: "Orders", - column: "SnackId"); - - migrationBuilder.CreateIndex( - name: "IX_SnackComponents_ComponentId", - table: "SnackComponents", - column: "ComponentId"); - - migrationBuilder.CreateIndex( - name: "IX_SnackComponents_SnackId", - table: "SnackComponents", - column: "SnackId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Orders"); - - migrationBuilder.DropTable( - name: "SnackComponents"); - - migrationBuilder.DropTable( - name: "Clients"); - - migrationBuilder.DropTable( - name: "Components"); - - migrationBuilder.DropTable( - name: "Snacks"); - } - } -} diff --git a/Diner/DinerDataBaseImplement/Migrations/DinerDatabaseModelSnapshot.cs b/Diner/DinerDataBaseImplement/Migrations/DinerDatabaseModelSnapshot.cs deleted file mode 100644 index 3976326..0000000 --- a/Diner/DinerDataBaseImplement/Migrations/DinerDatabaseModelSnapshot.cs +++ /dev/null @@ -1,211 +0,0 @@ -// -using System; -using DinerDataBaseImplement; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace DinerDataBaseImplement.Migrations -{ - [DbContext(typeof(DinerDatabase))] - partial class DinerDatabaseModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.14") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("DinerDataBaseImplement.Models.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClientFIO") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Password") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Clients"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.Component", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ComponentName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Cost") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.ToTable("Components"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClientId") - .HasColumnType("int"); - - b.Property("Count") - .HasColumnType("int"); - - b.Property("DateCreate") - .HasColumnType("datetime2"); - - b.Property("DateImplement") - .HasColumnType("datetime2"); - - b.Property("SnackId") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Sum") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.HasIndex("SnackId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.Snack", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Price") - .HasColumnType("float"); - - b.Property("SnackName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Snacks"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.SnackComponent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ComponentId") - .HasColumnType("int"); - - b.Property("Count") - .HasColumnType("int"); - - b.Property("SnackId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ComponentId"); - - b.HasIndex("SnackId"); - - b.ToTable("SnackComponents"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.Order", b => - { - b.HasOne("DinerDataBaseImplement.Models.Client", "Client") - .WithMany("Orders") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("DinerDataBaseImplement.Models.Snack", "Snack") - .WithMany("Orders") - .HasForeignKey("SnackId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Client"); - - b.Navigation("Snack"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.SnackComponent", b => - { - b.HasOne("DinerDataBaseImplement.Models.Component", "Component") - .WithMany("SnackComponents") - .HasForeignKey("ComponentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("DinerDataBaseImplement.Models.Snack", "Snack") - .WithMany("Components") - .HasForeignKey("SnackId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Component"); - - b.Navigation("Snack"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.Client", b => - { - b.Navigation("Orders"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.Component", b => - { - b.Navigation("SnackComponents"); - }); - - modelBuilder.Entity("DinerDataBaseImplement.Models.Snack", b => - { - b.Navigation("Components"); - - b.Navigation("Orders"); - }); -#pragma warning restore 612, 618 - } - } -}