using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Musify.Infrastructure.Persistence.Migrations
{
///
public partial class MakePlayListDescriptionOptional : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn(
name: "Description",
table: "PlayLists",
type: "character varying(256)",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(256)",
oldMaxLength: 256);
migrationBuilder.Sql(
"""
UPDATE "PlayLists" SET "Description" = NULL
WHERE "Description" = 'No description was provided.';
""");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn(
name: "Description",
table: "PlayLists",
type: "character varying(256)",
maxLength: 256,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(256)",
oldMaxLength: 256,
oldNullable: true);
}
}
}