Спасение приложения
This commit is contained in:
parent
e934dc229f
commit
0d26301504
@ -12,7 +12,7 @@ using SushiBarDatabaseImplement;
|
|||||||
namespace SushiBarDatabaseImplement.Migrations
|
namespace SushiBarDatabaseImplement.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(SushiBarDatabase))]
|
[DbContext(typeof(SushiBarDatabase))]
|
||||||
[Migration("20230307133039_ShopMigration")]
|
[Migration("20230314085708_ShopMigration")]
|
||||||
partial class ShopMigration
|
partial class ShopMigration
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
@ -11,27 +11,6 @@ namespace SushiBarDatabaseImplement.Migrations
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Orders_SushiList_SushiId",
|
|
||||||
table: "Orders");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_SushiIngredients_SushiList_SushiId",
|
|
||||||
table: "SushiIngredients");
|
|
||||||
|
|
||||||
migrationBuilder.DropPrimaryKey(
|
|
||||||
name: "PK_SushiList",
|
|
||||||
table: "SushiList");
|
|
||||||
|
|
||||||
migrationBuilder.RenameTable(
|
|
||||||
name: "SushiList",
|
|
||||||
newName: "ListSushi");
|
|
||||||
|
|
||||||
migrationBuilder.AddPrimaryKey(
|
|
||||||
name: "PK_ListSushi",
|
|
||||||
table: "ListSushi",
|
|
||||||
column: "Id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Shops",
|
name: "Shops",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@ -84,69 +63,16 @@ namespace SushiBarDatabaseImplement.Migrations
|
|||||||
name: "IX_ShopSushi_SushiId",
|
name: "IX_ShopSushi_SushiId",
|
||||||
table: "ShopSushi",
|
table: "ShopSushi",
|
||||||
column: "SushiId");
|
column: "SushiId");
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Orders_ListSushi_SushiId",
|
|
||||||
table: "Orders",
|
|
||||||
column: "SushiId",
|
|
||||||
principalTable: "ListSushi",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_SushiIngredients_ListSushi_SushiId",
|
|
||||||
table: "SushiIngredients",
|
|
||||||
column: "SushiId",
|
|
||||||
principalTable: "ListSushi",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Orders_ListSushi_SushiId",
|
|
||||||
table: "Orders");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_SushiIngredients_ListSushi_SushiId",
|
|
||||||
table: "SushiIngredients");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "ShopSushi");
|
name: "ShopSushi");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Shops");
|
name: "Shops");
|
||||||
|
|
||||||
migrationBuilder.DropPrimaryKey(
|
|
||||||
name: "PK_ListSushi",
|
|
||||||
table: "ListSushi");
|
|
||||||
|
|
||||||
migrationBuilder.RenameTable(
|
|
||||||
name: "ListSushi",
|
|
||||||
newName: "SushiList");
|
|
||||||
|
|
||||||
migrationBuilder.AddPrimaryKey(
|
|
||||||
name: "PK_SushiList",
|
|
||||||
table: "SushiList",
|
|
||||||
column: "Id");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Orders_SushiList_SushiId",
|
|
||||||
table: "Orders",
|
|
||||||
column: "SushiId",
|
|
||||||
principalTable: "SushiList",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_SushiIngredients_SushiList_SushiId",
|
|
||||||
table: "SushiIngredients",
|
|
||||||
column: "SushiId",
|
|
||||||
principalTable: "SushiList",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user