forked from ddrilling/AsbCloudServer
40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
|
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: "Набор уставок");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|