diff --git a/Pizzeria/PizzeriaDatabaseImplement/Migrations/20230326163442_InitialCreate.Designer.cs b/Pizzeria/PizzeriaDatabaseImplement/Migrations/20230326163442_InitialCreate.Designer.cs deleted file mode 100644 index fdfe058..0000000 --- a/Pizzeria/PizzeriaDatabaseImplement/Migrations/20230326163442_InitialCreate.Designer.cs +++ /dev/null @@ -1,223 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using PizzeriaDatabaseImplement; - -#nullable disable - -namespace PizzeriaDatabaseImplement.Migrations -{ - [DbContext(typeof(PizzeriaDatabase))] - [Migration("20230326163442_InitialCreate")] - partial class InitialCreate - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("PizzeriaDatabaseImplement.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("PizzeriaDatabaseImplement.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("PizzeriaDatabaseImplement.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("PizzaId") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Sum") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.HasIndex("PizzaId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("PizzeriaDatabaseImplement.Models.Pizza", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("PizzaName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Price") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.ToTable("Pizzas"); - }); - - modelBuilder.Entity("PizzeriaDatabaseImplement.Models.PizzaComponent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClientId") - .HasColumnType("int"); - - b.Property("ComponentId") - .HasColumnType("int"); - - b.Property("Count") - .HasColumnType("int"); - - b.Property("PizzaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.HasIndex("ComponentId"); - - b.HasIndex("PizzaId"); - - b.ToTable("PizzaComponents"); - }); - - modelBuilder.Entity("PizzeriaDatabaseImplement.Models.Order", b => - { - b.HasOne("PizzeriaDatabaseImplement.Models.Client", "Client") - .WithMany() - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PizzeriaDatabaseImplement.Models.Pizza", "Pizza") - .WithMany("Orders") - .HasForeignKey("PizzaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Client"); - - b.Navigation("Pizza"); - }); - - modelBuilder.Entity("PizzeriaDatabaseImplement.Models.PizzaComponent", b => - { - b.HasOne("PizzeriaDatabaseImplement.Models.Client", null) - .WithMany("Components") - .HasForeignKey("ClientId"); - - b.HasOne("PizzeriaDatabaseImplement.Models.Component", "Component") - .WithMany("PizzaComponents") - .HasForeignKey("ComponentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PizzeriaDatabaseImplement.Models.Pizza", "Pizza") - .WithMany("Components") - .HasForeignKey("PizzaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Component"); - - b.Navigation("Pizza"); - }); - - modelBuilder.Entity("PizzeriaDatabaseImplement.Models.Client", b => - { - b.Navigation("Components"); - }); - - modelBuilder.Entity("PizzeriaDatabaseImplement.Models.Component", b => - { - b.Navigation("PizzaComponents"); - }); - - modelBuilder.Entity("PizzeriaDatabaseImplement.Models.Pizza", b => - { - b.Navigation("Components"); - - b.Navigation("Orders"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Pizzeria/PizzeriaDatabaseImplement/Migrations/20230326163442_InitialCreate.cs b/Pizzeria/PizzeriaDatabaseImplement/Migrations/20230326163442_InitialCreate.cs deleted file mode 100644 index 8b81e2f..0000000 --- a/Pizzeria/PizzeriaDatabaseImplement/Migrations/20230326163442_InitialCreate.cs +++ /dev/null @@ -1,166 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace PizzeriaDatabaseImplement.Migrations -{ - /// - public partial class InitialCreate : 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: "Pizzas", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - PizzaName = table.Column(type: "nvarchar(max)", nullable: false), - Price = table.Column(type: "float", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Pizzas", 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), - PizzaId = 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_Pizzas_PizzaId", - column: x => x.PizzaId, - principalTable: "Pizzas", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "PizzaComponents", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - PizzaId = table.Column(type: "int", nullable: false), - ComponentId = table.Column(type: "int", nullable: false), - Count = table.Column(type: "int", nullable: false), - ClientId = table.Column(type: "int", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PizzaComponents", x => x.Id); - table.ForeignKey( - name: "FK_PizzaComponents_Clients_ClientId", - column: x => x.ClientId, - principalTable: "Clients", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_PizzaComponents_Components_ComponentId", - column: x => x.ComponentId, - principalTable: "Components", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_PizzaComponents_Pizzas_PizzaId", - column: x => x.PizzaId, - principalTable: "Pizzas", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_Orders_ClientId", - table: "Orders", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_PizzaId", - table: "Orders", - column: "PizzaId"); - - migrationBuilder.CreateIndex( - name: "IX_PizzaComponents_ClientId", - table: "PizzaComponents", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_PizzaComponents_ComponentId", - table: "PizzaComponents", - column: "ComponentId"); - - migrationBuilder.CreateIndex( - name: "IX_PizzaComponents_PizzaId", - table: "PizzaComponents", - column: "PizzaId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Orders"); - - migrationBuilder.DropTable( - name: "PizzaComponents"); - - migrationBuilder.DropTable( - name: "Clients"); - - migrationBuilder.DropTable( - name: "Components"); - - migrationBuilder.DropTable( - name: "Pizzas"); - } - } -}