Add Mse to telemetryDataSaub

This commit is contained in:
Фролов 2022-03-10 17:18:30 +05:00
parent b613cb5e1f
commit 8de73084f2
7 changed files with 5057 additions and 6 deletions

View File

@ -141,5 +141,7 @@ namespace AsbCloudApp.Data
/// Текущее состояние работы MSE /// Текущее состояние работы MSE
/// </summary> /// </summary>
public short? MseState { get; set; } public short? MseState { get; set; }
public float? Mse { get; set; }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class Add_Mse_to_dataSaub : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "t_relation_user_user_role",
keyColumns: new[] { "id_user", "id_user_role" },
keyValues: new object[] { 1, 2 });
migrationBuilder.AddColumn<float>(
name: "mse",
table: "t_telemetry_data_saub",
type: "real",
nullable: true,
comment: "MSE");
migrationBuilder.AlterColumn<int>(
name: "id_mark_type",
table: "t_file_mark",
type: "integer",
nullable: false,
comment: "0 - отклонен, 1 - согласован",
oldClrType: typeof(int),
oldType: "integer",
oldComment: "0 - Согласован");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "mse",
table: "t_telemetry_data_saub");
migrationBuilder.AlterColumn<int>(
name: "id_mark_type",
table: "t_file_mark",
type: "integer",
nullable: false,
comment: "0 - Согласован",
oldClrType: typeof(int),
oldType: "integer",
oldComment: "0 - отклонен, 1 - согласован");
migrationBuilder.InsertData(
table: "t_relation_user_user_role",
columns: new[] { "id_user", "id_user_role" },
values: new object[] { 1, 2 });
}
}
}

View File

@ -638,7 +638,7 @@ namespace AsbCloudDb.Migrations
b.Property<int>("IdMarkType") b.Property<int>("IdMarkType")
.HasColumnType("integer") .HasColumnType("integer")
.HasColumnName("id_mark_type") .HasColumnName("id_mark_type")
.HasComment("0 - Согласован"); .HasComment("0 - отклонен, 1 - согласован");
b.Property<int>("IdUser") b.Property<int>("IdUser")
.HasColumnType("integer") .HasColumnType("integer")
@ -1393,7 +1393,7 @@ namespace AsbCloudDb.Migrations
.HasColumnType("integer") .HasColumnType("integer")
.HasColumnName("id_drilling_program_part"); .HasColumnName("id_drilling_program_part");
b.Property<int>("IdDrillingProgramPartRole") b.Property<int>("IdUserRole")
.HasColumnType("integer") .HasColumnType("integer")
.HasColumnName("id_role") .HasColumnName("id_role")
.HasComment("1 - publisher, 2 - approver"); .HasComment("1 - publisher, 2 - approver");
@ -2303,7 +2303,7 @@ namespace AsbCloudDb.Migrations
new new
{ {
IdUser = 1, IdUser = 1,
IdUserRole = 2 IdUserRole = 1
}); });
}); });
@ -2677,6 +2677,11 @@ namespace AsbCloudDb.Migrations
.HasColumnName("mode") .HasColumnName("mode")
.HasComment("Режим САУБ"); .HasComment("Режим САУБ");
b.Property<float?>("Mse")
.HasColumnType("real")
.HasColumnName("mse")
.HasComment("MSE");
b.Property<short?>("MseState") b.Property<short?>("MseState")
.HasColumnType("smallint") .HasColumnType("smallint")
.HasColumnName("mse_state") .HasColumnName("mse_state")

View File

@ -1,6 +1,5 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System; using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
@ -125,6 +124,8 @@ namespace AsbCloudDb.Model
[Column("flow_delta_limit_max"), Comment("Расход. Аварийный макс.")] [Column("flow_delta_limit_max"), Comment("Расход. Аварийный макс.")]
public float? FlowDeltaLimitMax { get; set; } public float? FlowDeltaLimitMax { get; set; }
[Column("mse"), Comment("MSE")]
public float? Mse { get; set; }
[JsonIgnore] [JsonIgnore]
[ForeignKey(nameof(IdTelemetry))] [ForeignKey(nameof(IdTelemetry))]

View File

@ -32,7 +32,7 @@ dotnet ef migrations remove <MigrationName> --project AsbCloudDb
## Backup ## Backup
Terminal: Terminal:
``` ```
sudo -u postgres pg_dump -Fc -U postgres postgres -W > dump_2021-11-26.bak sudo -u postgres pg_dump -Fc -U postgres postgres -W > dump_2022-03-09.bak
``` ```
## Restore backup ## Restore backup

View File

@ -127,7 +127,8 @@ namespace AsbCloudWebApi
.Add(35, nameof(TelemetryDataSaubDto.FlowIdle)) .Add(35, nameof(TelemetryDataSaubDto.FlowIdle))
.Add(36, nameof(TelemetryDataSaubDto.FlowDeltaLimitMax)) .Add(36, nameof(TelemetryDataSaubDto.FlowDeltaLimitMax))
.Add(37, nameof(TelemetryDataSaubDto.IdFeedRegulator)) .Add(37, nameof(TelemetryDataSaubDto.IdFeedRegulator))
.Add(38, nameof(TelemetryDataSaubDto.MseState)); .Add(38, nameof(TelemetryDataSaubDto.MseState))
.Add(39, nameof(TelemetryDataSaubDto.Mse));
} }
} }
} }