Изменение модели данных

This commit is contained in:
Степанов Дмитрий 2024-03-20 10:48:50 +03:00
parent 7f43c951f5
commit 2734b674ce
5 changed files with 9834 additions and 359 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,37 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
/// <inheritdoc />
public partial class Update_ItemInfo : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTimeOffset>(
name: "LastUpdateDate",
table: "t_well_operation",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTimeOffset),
oldType: "timestamp with time zone");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTimeOffset>(
name: "LastUpdateDate",
table: "t_well_operation",
type: "timestamp with time zone",
nullable: false,
defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
oldClrType: typeof(DateTimeOffset),
oldType: "timestamp with time zone",
oldNullable: true);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,6 @@ namespace AsbCloudDb.Model
/// <summary>
/// дата последнего обновления блока
/// </summary>
public DateTimeOffset LastUpdateDate { get; set; } = DateTimeOffset.Now;
public DateTimeOffset? LastUpdateDate { get; set; }
}
}

View File

@ -51,6 +51,12 @@ namespace AsbCloudDb.Model
[Column("comment"), Comment("Комментарий")]
public string? Comment { get; set; }
[NotMapped]
public double NptHours { get; set; }
[NotMapped]
public double Day { get; set; }
[JsonIgnore]
[ForeignKey(nameof(IdWell))]
@ -67,23 +73,6 @@ namespace AsbCloudDb.Model
[JsonIgnore]
[ForeignKey(nameof(IdPlan))]
public virtual WellOperation? OperationPlan { get; set; } = null!;
public bool IsSame(WellOperation other)
{
var isSame = IdWell == other.IdWell &&
IdWellSectionType == other.IdWellSectionType &&
IdCategory == other.IdCategory &&
IdType == other.IdType &&
IdPlan == other.IdPlan &&
DepthStart == other.DepthStart &&
DepthEnd == other.DepthEnd &&
DateStart == other.DateStart &&
DurationHours == other.DurationHours &&
CategoryInfo == other.CategoryInfo &&
Comment == other.Comment;
return isSame;
}
}
}