forked from ddrilling/AsbCloudServer
Изменение модели данных
This commit is contained in:
parent
7f43c951f5
commit
2734b674ce
9389
AsbCloudDb/Migrations/20240320074649_Update_ItemInfo.Designer.cs
generated
Normal file
9389
AsbCloudDb/Migrations/20240320074649_Update_ItemInfo.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
37
AsbCloudDb/Migrations/20240320074649_Update_ItemInfo.cs
Normal file
37
AsbCloudDb/Migrations/20240320074649_Update_ItemInfo.cs
Normal 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
@ -12,6 +12,6 @@ namespace AsbCloudDb.Model
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// дата последнего обновления блока
|
/// дата последнего обновления блока
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTimeOffset LastUpdateDate { get; set; } = DateTimeOffset.Now;
|
public DateTimeOffset? LastUpdateDate { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,12 @@ namespace AsbCloudDb.Model
|
|||||||
|
|
||||||
[Column("comment"), Comment("Комментарий")]
|
[Column("comment"), Comment("Комментарий")]
|
||||||
public string? Comment { get; set; }
|
public string? Comment { get; set; }
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
|
public double NptHours { get; set; }
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
|
public double Day { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ForeignKey(nameof(IdWell))]
|
[ForeignKey(nameof(IdWell))]
|
||||||
@ -67,23 +73,6 @@ namespace AsbCloudDb.Model
|
|||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ForeignKey(nameof(IdPlan))]
|
[ForeignKey(nameof(IdPlan))]
|
||||||
public virtual WellOperation? OperationPlan { get; set; } = null!;
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user