You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.9 KiB
62 lines
1.9 KiB
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace StubbedContextLib.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class suprDailyQuote : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "dailyquotes");
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "quotes",
|
|
keyColumn: "Id",
|
|
keyValue: 10,
|
|
column: "IsValid",
|
|
value: false);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "dailyquotes",
|
|
columns: table => new
|
|
{
|
|
IdQuote = table.Column<int>(type: "int", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_dailyquotes", x => x.IdQuote);
|
|
table.ForeignKey(
|
|
name: "FK_dailyquotes_quotes_IdQuote",
|
|
column: x => x.IdQuote,
|
|
principalTable: "quotes",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.InsertData(
|
|
table: "dailyquotes",
|
|
column: "IdQuote",
|
|
values: new object[]
|
|
{
|
|
1,
|
|
5
|
|
});
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "quotes",
|
|
keyColumn: "Id",
|
|
keyValue: 10,
|
|
column: "IsValid",
|
|
value: true);
|
|
}
|
|
}
|
|
}
|