Files
Aberwyn/Aberwyn/Migrations/20250921161413_AddMealWishUserRelation.cs
Elias Jansson 9299e29ea6
All checks were successful
continuous-integration/drone/push Build is passing
Wish and veckomeny fixes
2025-09-22 21:22:43 +02:00

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");
}
}
}