53 lines
1.8 KiB
C#
53 lines
1.8 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
|
|
|
namespace DiaryApp.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddedSeedingDataDiaryEntries : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.InsertData(
|
|
table: "DiaryEntries",
|
|
columns: new[] { "Id", "Content", "DateCreated", "Title" },
|
|
values: new object[,]
|
|
{
|
|
{ 1, "Went hiking with Joe!", new DateTime(2026, 1, 1, 10, 32, 0, 0, DateTimeKind.Unspecified), "Went Hiking" },
|
|
{ 2, "Went Shoping with Joe!", new DateTime(2026, 1, 10, 8, 32, 0, 0, DateTimeKind.Unspecified), "Went Shoping" },
|
|
{ 3, "Went Swimming with Joe!", new DateTime(2026, 1, 15, 15, 42, 0, 0, DateTimeKind.Unspecified), "Went Swimming" },
|
|
{ 4, "Went Biking with Joe!", new DateTime(2026, 1, 17, 12, 0, 0, 0, DateTimeKind.Unspecified), "Went Biking" }
|
|
});
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DeleteData(
|
|
table: "DiaryEntries",
|
|
keyColumn: "Id",
|
|
keyValue: 1);
|
|
|
|
migrationBuilder.DeleteData(
|
|
table: "DiaryEntries",
|
|
keyColumn: "Id",
|
|
keyValue: 2);
|
|
|
|
migrationBuilder.DeleteData(
|
|
table: "DiaryEntries",
|
|
keyColumn: "Id",
|
|
keyValue: 3);
|
|
|
|
migrationBuilder.DeleteData(
|
|
table: "DiaryEntries",
|
|
keyColumn: "Id",
|
|
keyValue: 4);
|
|
}
|
|
}
|
|
}
|