75 lines
2.3 KiB
C#
75 lines
2.3 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace StockWebHistory.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class ReconcilingMigration : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropPrimaryKey(
|
|
name: "PK_StockEquities",
|
|
table: "StockEquities");
|
|
|
|
migrationBuilder.RenameTable(
|
|
name: "StockEquities",
|
|
newName: "Stocks");
|
|
|
|
migrationBuilder.RenameIndex(
|
|
name: "IX_StockEquities_Sold",
|
|
table: "Stocks",
|
|
newName: "IX_Stocks_Sold");
|
|
|
|
migrationBuilder.RenameIndex(
|
|
name: "IX_StockEquities_Bought_StockCode_Quantity",
|
|
table: "Stocks",
|
|
newName: "IX_Stocks_Bought_StockCode_Quantity");
|
|
|
|
migrationBuilder.RenameIndex(
|
|
name: "IX_StockEquities_Bought",
|
|
table: "Stocks",
|
|
newName: "IX_Stocks_Bought");
|
|
|
|
migrationBuilder.AddPrimaryKey(
|
|
name: "PK_Stocks",
|
|
table: "Stocks",
|
|
column: "Id");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropPrimaryKey(
|
|
name: "PK_Stocks",
|
|
table: "Stocks");
|
|
|
|
migrationBuilder.RenameTable(
|
|
name: "Stocks",
|
|
newName: "StockEquities");
|
|
|
|
migrationBuilder.RenameIndex(
|
|
name: "IX_Stocks_Sold",
|
|
table: "StockEquities",
|
|
newName: "IX_StockEquities_Sold");
|
|
|
|
migrationBuilder.RenameIndex(
|
|
name: "IX_Stocks_Bought_StockCode_Quantity",
|
|
table: "StockEquities",
|
|
newName: "IX_StockEquities_Bought_StockCode_Quantity");
|
|
|
|
migrationBuilder.RenameIndex(
|
|
name: "IX_Stocks_Bought",
|
|
table: "StockEquities",
|
|
newName: "IX_StockEquities_Bought");
|
|
|
|
migrationBuilder.AddPrimaryKey(
|
|
name: "PK_StockEquities",
|
|
table: "StockEquities",
|
|
column: "Id");
|
|
}
|
|
}
|
|
}
|