DD.WellWorkover.Cloud/AsbCloudDb/Migrations/20230220091227_Enable_nullable_on_setpoints_finalDocs.cs

40 lines
1.3 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class Enable_nullable_on_setpoints_finalDocs : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("update t_setpoints_rquest set setpoint_set = '{}' where setpoint_set is null;");
migrationBuilder.AlterColumn<string>(
name: "setpoint_set",
table: "t_setpoints_rquest",
type: "jsonb",
nullable: false,
defaultValue: "{}",
comment: "Набор уставок",
oldClrType: typeof(string),
oldType: "jsonb",
oldNullable: true,
oldComment: "Набор уставок");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "setpoint_set",
table: "t_setpoints_rquest",
type: "jsonb",
nullable: true,
comment: "Набор уставок",
oldClrType: typeof(string),
oldType: "jsonb",
oldComment: "Набор уставок");
}
}
}