Skip to content

Instantly share code, notes, and snippets.

@christiannagel
Created August 28, 2018 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christiannagel/79f2b5167228c5286f5d93641a7d980f to your computer and use it in GitHub Desktop.
Save christiannagel/79f2b5167228c5286f5d93641a7d980f to your computer and use it in GitHub Desktop.
AddPoints Migration - EF Core
public partial class AddPoints : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "Points",
table: "Racers",
nullable: false,
defaultValue: 0);
migrationBuilder.UpdateData(
table: "Racers",
keyColumn: "Id",
keyValue: 1,
column: "Points",
value: 231);
migrationBuilder.UpdateData(
table: "Racers",
keyColumn: "Id",
keyValue: 2,
column: "Points",
value: 214);
migrationBuilder.UpdateData(
table: "Racers",
keyColumn: "Id",
keyValue: 3,
column: "Points",
value: 146);
migrationBuilder.UpdateData(
table: "Racers",
keyColumn: "Id",
keyValue: 4,
column: "Points",
value: 144);
migrationBuilder.UpdateData(
table: "Racers",
keyColumn: "Id",
keyValue: 5,
column: "Points",
value: 120);
migrationBuilder.UpdateData(
table: "Racers",
keyColumn: "Id",
keyValue: 6,
column: "Points",
value: 118);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Points",
table: "Racers");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment