This commit is contained in:
Алексей Крюков 2024-05-20 01:33:33 +04:00
parent e0e490cefe
commit 4e41cc5e52
3 changed files with 0 additions and 677 deletions

View File

@ -1,248 +0,0 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using TypographyDatabaseImplements;
#nullable disable
namespace TypographyDatabaseImplements.Migrations
{
[DbContext(typeof(TypographyDatabase))]
[Migration("20240422081714_InitialCreate")]
partial class InitialCreate
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.16")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("TypographyDatabaseImplement.Models.Component", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ComponentName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<double>("Cost")
.HasColumnType("float");
b.HasKey("Id");
b.ToTable("Components");
});
modelBuilder.Entity("TypographyDatabaseImplement.Models.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("Count")
.HasColumnType("int");
b.Property<DateTime>("DateCreate")
.HasColumnType("datetime2");
b.Property<DateTime?>("DateImplement")
.HasColumnType("datetime2");
b.Property<int>("PrintedId")
.HasColumnType("int");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<double>("Sum")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("PrintedId");
b.ToTable("Orders");
});
modelBuilder.Entity("TypographyDatabaseImplement.Models.Shop", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Address")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateOpening")
.HasColumnType("datetime2");
b.Property<int>("MaxCountPrinteds")
.HasColumnType("int");
b.Property<string>("ShopName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Shops");
});
modelBuilder.Entity("TypographyDatabaseImplement.Models.ShopPrinted", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("Count")
.HasColumnType("int");
b.Property<int>("PrintedId")
.HasColumnType("int");
b.Property<int>("ShopId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("PrintedId");
b.HasIndex("ShopId");
b.ToTable("ShopPrinteds");
});
modelBuilder.Entity("TypographyDatabaseImplements.Models.Printed", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<double>("Price")
.HasColumnType("float");
b.Property<string>("PrintedName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Printeds");
});
modelBuilder.Entity("TypographyDatabaseImplements.Models.PrintedComponent", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ComponentId")
.HasColumnType("int");
b.Property<int>("Count")
.HasColumnType("int");
b.Property<int>("PrintedId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ComponentId");
b.HasIndex("PrintedId");
b.ToTable("PrintedComponents");
});
modelBuilder.Entity("TypographyDatabaseImplement.Models.Order", b =>
{
b.HasOne("TypographyDatabaseImplements.Models.Printed", "Printed")
.WithMany("Orders")
.HasForeignKey("PrintedId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Printed");
});
modelBuilder.Entity("TypographyDatabaseImplement.Models.ShopPrinted", b =>
{
b.HasOne("TypographyDatabaseImplements.Models.Printed", "Printed")
.WithMany()
.HasForeignKey("PrintedId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TypographyDatabaseImplement.Models.Shop", "Shop")
.WithMany("Printeds")
.HasForeignKey("ShopId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Printed");
b.Navigation("Shop");
});
modelBuilder.Entity("TypographyDatabaseImplements.Models.PrintedComponent", b =>
{
b.HasOne("TypographyDatabaseImplement.Models.Component", "Component")
.WithMany("PrintedComponents")
.HasForeignKey("ComponentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TypographyDatabaseImplements.Models.Printed", "Printed")
.WithMany("Components")
.HasForeignKey("PrintedId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Component");
b.Navigation("Printed");
});
modelBuilder.Entity("TypographyDatabaseImplement.Models.Component", b =>
{
b.Navigation("PrintedComponents");
});
modelBuilder.Entity("TypographyDatabaseImplement.Models.Shop", b =>
{
b.Navigation("Printeds");
});
modelBuilder.Entity("TypographyDatabaseImplements.Models.Printed", b =>
{
b.Navigation("Components");
b.Navigation("Orders");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,184 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace TypographyDatabaseImplements.Migrations
{
/// <inheritdoc />
public partial class InitialCreate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Components",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ComponentName = table.Column<string>(type: "nvarchar(max)", nullable: false),
Cost = table.Column<double>(type: "float", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Components", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Printeds",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
PrintedName = table.Column<string>(type: "nvarchar(max)", nullable: false),
Price = table.Column<double>(type: "float", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Printeds", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Shops",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ShopName = table.Column<string>(type: "nvarchar(max)", nullable: false),
Address = table.Column<string>(type: "nvarchar(max)", nullable: false),
DateOpening = table.Column<DateTime>(type: "datetime2", nullable: false),
MaxCountPrinteds = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Shops", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Orders",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
PrintedId = table.Column<int>(type: "int", nullable: false),
Count = table.Column<int>(type: "int", nullable: false),
Sum = table.Column<double>(type: "float", nullable: false),
Status = table.Column<int>(type: "int", nullable: false),
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
DateImplement = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Orders", x => x.Id);
table.ForeignKey(
name: "FK_Orders_Printeds_PrintedId",
column: x => x.PrintedId,
principalTable: "Printeds",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "PrintedComponents",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
PrintedId = table.Column<int>(type: "int", nullable: false),
ComponentId = table.Column<int>(type: "int", nullable: false),
Count = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PrintedComponents", x => x.Id);
table.ForeignKey(
name: "FK_PrintedComponents_Components_ComponentId",
column: x => x.ComponentId,
principalTable: "Components",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PrintedComponents_Printeds_PrintedId",
column: x => x.PrintedId,
principalTable: "Printeds",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "ShopPrinteds",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
PrintedId = table.Column<int>(type: "int", nullable: false),
ShopId = table.Column<int>(type: "int", nullable: false),
Count = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ShopPrinteds", x => x.Id);
table.ForeignKey(
name: "FK_ShopPrinteds_Printeds_PrintedId",
column: x => x.PrintedId,
principalTable: "Printeds",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ShopPrinteds_Shops_ShopId",
column: x => x.ShopId,
principalTable: "Shops",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Orders_PrintedId",
table: "Orders",
column: "PrintedId");
migrationBuilder.CreateIndex(
name: "IX_PrintedComponents_ComponentId",
table: "PrintedComponents",
column: "ComponentId");
migrationBuilder.CreateIndex(
name: "IX_PrintedComponents_PrintedId",
table: "PrintedComponents",
column: "PrintedId");
migrationBuilder.CreateIndex(
name: "IX_ShopPrinteds_PrintedId",
table: "ShopPrinteds",
column: "PrintedId");
migrationBuilder.CreateIndex(
name: "IX_ShopPrinteds_ShopId",
table: "ShopPrinteds",
column: "ShopId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Orders");
migrationBuilder.DropTable(
name: "PrintedComponents");
migrationBuilder.DropTable(
name: "ShopPrinteds");
migrationBuilder.DropTable(
name: "Components");
migrationBuilder.DropTable(
name: "Printeds");
migrationBuilder.DropTable(
name: "Shops");
}
}
}

View File

@ -1,245 +0,0 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using TypographyDatabaseImplements;
#nullable disable
namespace TypographyDatabaseImplements.Migrations
{
[DbContext(typeof(TypographyDatabase))]
partial class TypographyDatabaseModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.16")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("TypographyDatabaseImplement.Models.Component", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ComponentName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<double>("Cost")
.HasColumnType("float");
b.HasKey("Id");
b.ToTable("Components");
});
modelBuilder.Entity("TypographyDatabaseImplement.Models.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("Count")
.HasColumnType("int");
b.Property<DateTime>("DateCreate")
.HasColumnType("datetime2");
b.Property<DateTime?>("DateImplement")
.HasColumnType("datetime2");
b.Property<int>("PrintedId")
.HasColumnType("int");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<double>("Sum")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("PrintedId");
b.ToTable("Orders");
});
modelBuilder.Entity("TypographyDatabaseImplement.Models.Shop", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Address")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateOpening")
.HasColumnType("datetime2");
b.Property<int>("MaxCountPrinteds")
.HasColumnType("int");
b.Property<string>("ShopName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Shops");
});
modelBuilder.Entity("TypographyDatabaseImplement.Models.ShopPrinted", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("Count")
.HasColumnType("int");
b.Property<int>("PrintedId")
.HasColumnType("int");
b.Property<int>("ShopId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("PrintedId");
b.HasIndex("ShopId");
b.ToTable("ShopPrinteds");
});
modelBuilder.Entity("TypographyDatabaseImplements.Models.Printed", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<double>("Price")
.HasColumnType("float");
b.Property<string>("PrintedName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Printeds");
});
modelBuilder.Entity("TypographyDatabaseImplements.Models.PrintedComponent", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ComponentId")
.HasColumnType("int");
b.Property<int>("Count")
.HasColumnType("int");
b.Property<int>("PrintedId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ComponentId");
b.HasIndex("PrintedId");
b.ToTable("PrintedComponents");
});
modelBuilder.Entity("TypographyDatabaseImplement.Models.Order", b =>
{
b.HasOne("TypographyDatabaseImplements.Models.Printed", "Printed")
.WithMany("Orders")
.HasForeignKey("PrintedId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Printed");
});
modelBuilder.Entity("TypographyDatabaseImplement.Models.ShopPrinted", b =>
{
b.HasOne("TypographyDatabaseImplements.Models.Printed", "Printed")
.WithMany()
.HasForeignKey("PrintedId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TypographyDatabaseImplement.Models.Shop", "Shop")
.WithMany("Printeds")
.HasForeignKey("ShopId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Printed");
b.Navigation("Shop");
});
modelBuilder.Entity("TypographyDatabaseImplements.Models.PrintedComponent", b =>
{
b.HasOne("TypographyDatabaseImplement.Models.Component", "Component")
.WithMany("PrintedComponents")
.HasForeignKey("ComponentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TypographyDatabaseImplements.Models.Printed", "Printed")
.WithMany("Components")
.HasForeignKey("PrintedId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Component");
b.Navigation("Printed");
});
modelBuilder.Entity("TypographyDatabaseImplement.Models.Component", b =>
{
b.Navigation("PrintedComponents");
});
modelBuilder.Entity("TypographyDatabaseImplement.Models.Shop", b =>
{
b.Navigation("Printeds");
});
modelBuilder.Entity("TypographyDatabaseImplements.Models.Printed", b =>
{
b.Navigation("Components");
b.Navigation("Orders");
});
#pragma warning restore 612, 618
}
}
}