Enable nullable on DailyReport

This commit is contained in:
ngfrolov 2023-02-20 15:28:35 +05:00
parent 09d0d42688
commit 0c26c57d97
Signed by untrusted user who does not match committer: ng.frolov
GPG Key ID: E99907A0357B29A7
5 changed files with 7075 additions and 22 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,37 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class Enable_nullable_on_daylyReport : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "info",
table: "t_daily_report",
type: "jsonb",
nullable: false,
defaultValue: "{}",
comment: "Список параметров для отчёта",
oldClrType: typeof(string),
oldType: "jsonb",
oldNullable: true,
oldComment: "Список параметров для отчёта");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "info",
table: "t_daily_report",
type: "jsonb",
nullable: true,
comment: "Список параметров для отчёта",
oldClrType: typeof(string),
oldType: "jsonb",
oldComment: "Список параметров для отчёта");
}
}
}

View File

@ -154,6 +154,7 @@ namespace AsbCloudDb.Migrations
.HasComment("Дата отчёта");
b.Property<string>("Info")
.IsRequired()
.HasColumnType("jsonb")
.HasColumnName("info")
.HasComment("Список параметров для отчёта");

View File

@ -4,7 +4,6 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace AsbCloudDb.Model.DailyReport
{
#nullable disable
[Table("t_daily_report"), Comment("Ежедневные отчёты")]
public class DailyReport
{
@ -15,19 +14,9 @@ namespace AsbCloudDb.Model.DailyReport
public DateTimeOffset StartDate { get; set; }
[Column("info", TypeName = "jsonb"), Comment("Список параметров для отчёта")]
public DailyReportInfo Info { get; set; }
public DailyReportInfo Info { get; set; } = null!;
[ForeignKey(nameof(IdWell))]
public virtual Well Well { get; set; }
public virtual Well Well { get; set; } = null!;
}
}

View File

@ -2,15 +2,13 @@
namespace AsbCloudDb.Model
{
#nullable disable
public class DailyReportInfo
{
public Head Head { get; set; }
public Bha Bha { get; set; }
public NoDrilling NoDrilling { get; set; }
public TimeBalance TimeBalance { get; set; }
public Saub Saub { get; set; }
public Sign Sign { get; set; }
public Head Head { get; set; } = null!;
public Bha Bha { get; set; } = new();
public NoDrilling NoDrilling { get; set; } = new();
public TimeBalance TimeBalance { get; set; } = new();
public Saub Saub { get; set; } = new();
public Sign Sign { get; set; } = new();
}
}