57 lines
1.9 KiB
C#
57 lines
1.9 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Aberwyn.Migrations
|
|
{
|
|
public partial class AddMealWishUserRelation : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "RequestedByUserId",
|
|
table: "MealWishes",
|
|
type: "varchar(255)",
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "longtext")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_MealWishes_RequestedByUserId",
|
|
table: "MealWishes",
|
|
column: "RequestedByUserId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_MealWishes_AspNetUsers_RequestedByUserId",
|
|
table: "MealWishes",
|
|
column: "RequestedByUserId",
|
|
principalTable: "AspNetUsers",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_MealWishes_AspNetUsers_RequestedByUserId",
|
|
table: "MealWishes");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_MealWishes_RequestedByUserId",
|
|
table: "MealWishes");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "RequestedByUserId",
|
|
table: "MealWishes",
|
|
type: "longtext",
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(255)")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
}
|
|
}
|
|
}
|