using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RazorPagesMovie.Migrations
{
///
public partial class MakeContactMessageSubjectRequired : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("UPDATE ContactMessage SET Subject = '' WHERE Subject IS NULL;");
migrationBuilder.AlterColumn(
name: "Subject",
table: "ContactMessage",
type: "nvarchar(150)",
maxLength: 150,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(150)",
oldMaxLength: 150,
oldNullable: true);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn(
name: "Subject",
table: "ContactMessage",
type: "nvarchar(150)",
maxLength: 150,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(150)",
oldMaxLength: 150);
}
}
}