Create EF-Migration for NotificationSent-field

This commit is contained in:
Francesco Lorenzo D'Amico
2026-08-18 16:46:57 +02:00
parent c956c5b3b2
commit ee43dc60d8
3 changed files with 182 additions and 2 deletions
@@ -0,0 +1,49 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RazorPagesMovie.Migrations
{
/// <inheritdoc />
public partial class AddNotificationSentToContactMessage : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Message",
table: "ContactMessage",
type: "nvarchar(max)",
maxLength: 5000,
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(4000)",
oldMaxLength: 4000);
migrationBuilder.AddColumn<bool>(
name: "NotificationSent",
table: "ContactMessage",
type: "bit",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "NotificationSent",
table: "ContactMessage");
migrationBuilder.AlterColumn<string>(
name: "Message",
table: "ContactMessage",
type: "nvarchar(4000)",
maxLength: 4000,
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldMaxLength: 5000);
}
}
}