Миграции

This commit is contained in:
Olga Nemt 2024-07-01 10:18:19 +05:00
parent 8458f04bbe
commit 679575a49d
14 changed files with 13251 additions and 20 deletions

View File

@ -12,4 +12,10 @@ public class ProcessMapPlanStaticMeasurementOutputDto : ProcessMapPlanBaseDto
/// </summary>
[Range(0.0, 1800.0, ErrorMessage = "Время ожидания выхода сигнала с ТМС, сек., должно быть в пределах от 0 до 1800")]
public double SignalWaitingTime { get; set; }
/// <summary>
/// Примечание
/// </summary>
[StringLength(1024, ErrorMessage = "Примечание, должно быть не более 1024 символов")]
public string Note { get; set; } = string.Empty;
}

View File

@ -204,6 +204,4 @@ public class ProcessMapPlanReamingRotorDto : ProcessMapPlanBaseDto
/// </summary>
[StringLength(1024, ErrorMessage = "Примечание, должно быть не более 1024 символов")]
public string Note { get; set; } = string.Empty;
}

View File

@ -0,0 +1,40 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AsbCloudApp.Data.ProcessMaps.Operations;
/// <summary>
/// РТК план выход на обороты перед ротором
/// </summary>
public class ProcessMapPlanRotorRpmAccelerationDto : ProcessMapPlanBaseDto
{
/// <summary>
/// Момент на ВСП уставка, кН*м.
/// </summary>
[Range(0.0, 35.0, ErrorMessage = "Момент на ВСП уставка, кН*м., должно быть в пределах от 0 до 35")]
public double TopDriveTorque { get; set; }
/// <summary>
/// Момент на ВСП ограничение, кН*м.
/// </summary>
[Range(0.0, 35.0, ErrorMessage = "Момент на ВСП ограничение, кН*м., должно быть в пределах от 0 до 35")]
public double TopDriveTorqueMax { get; set; }
/// <summary>
/// Обороты на ВСП уставка, об/мин.
/// </summary>
[Range(0.0, 270.0, ErrorMessage = "Обороты на ВСП уставка, об/мин., должно быть в пределах от 0 до 270")]
public double Rpm { get; set; }
/// <summary>
/// Обороты на ВСП ограничение, об/мин.
/// </summary>
[Range(0.0, 270.0, ErrorMessage = "Обороты на ВСП ограничение, об/мин., должно быть в пределах от 0 до 270")]
public double RpmMax { get; set; }
/// <summary>
/// Примечание
/// </summary>
[StringLength(1024, ErrorMessage = "Примечание, должно быть не более 1024 символов")]
public string Note { get; set; } = string.Empty;
}

View File

@ -18,4 +18,10 @@ public class ProcessMapPlanSwitchingOffThePumpDto : ProcessMapPlanBaseDto
/// </summary>
[Range(0.0, 100.0, ErrorMessage = "Лимит остаточного давления, атм., должно быть в пределах от 0 до 100")]
public double ResidualPressureLimit { get; set; }
/// <summary>
/// Примечание
/// </summary>
[StringLength(1024, ErrorMessage = "Примечание, должно быть не более 1024 символов")]
public string Note { get; set; } = string.Empty;
}

View File

@ -90,4 +90,10 @@ public class ProcessMapPlanTFOrientationDto : ProcessMapPlanBaseDto
/// </summary>
[Range(0.0, 10.0, ErrorMessage = "Остановка над забоем, м., должно быть в пределах от 0 до 10")]
public double StopPointOffBottom { get; set; }
/// <summary>
/// Примечание
/// </summary>
[StringLength(1024, ErrorMessage = "Примечание, должно быть не более 1024 символов")]
public string Note { get; set; } = string.Empty;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,142 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
/// <inheritdoc />
public partial class Update_Tables_ProcessMapOperationsAndFunctions : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "buckling",
table: "t_process_map_plan_rotor_rpm_acceleration");
migrationBuilder.DropColumn(
name: "zenit_angle",
table: "t_process_map_plan_rotor_rpm_acceleration");
migrationBuilder.AddColumn<string>(
name: "note",
table: "t_process_map_plan_tf_orientation",
type: "character varying(1024)",
maxLength: 1024,
nullable: false,
defaultValue: "",
comment: "Примечание");
migrationBuilder.AddColumn<string>(
name: "note",
table: "t_process_map_plan_static_measurement_output",
type: "character varying(1024)",
maxLength: 1024,
nullable: false,
defaultValue: "",
comment: "Примечание");
migrationBuilder.AddColumn<double>(
name: "rpm",
table: "t_process_map_plan_rotor_rpm_acceleration",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Обороты на ВСП уставка, об/мин.");
migrationBuilder.AddColumn<double>(
name: "rpm_max",
table: "t_process_map_plan_rotor_rpm_acceleration",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Обороты на ВСП ограничение, об/мин.");
migrationBuilder.AddColumn<double>(
name: "top_drive_torque",
table: "t_process_map_plan_rotor_rpm_acceleration",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Момент на ВСП уставка, кН*м.");
migrationBuilder.AddColumn<double>(
name: "top_drive_torque_max",
table: "t_process_map_plan_rotor_rpm_acceleration",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Момент на ВСП ограничение, кН*м.");
migrationBuilder.AddColumn<string>(
name: "note",
table: "t_process_map_plan_operation_switching_off_the_pump",
type: "character varying(1024)",
maxLength: 1024,
nullable: false,
defaultValue: "",
comment: "Примечание");
migrationBuilder.AddColumn<string>(
name: "note",
table: "t_process_map_plan_anti_crash_rotation",
type: "character varying(1024)",
maxLength: 1024,
nullable: false,
defaultValue: "",
comment: "Примечание");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "note",
table: "t_process_map_plan_tf_orientation");
migrationBuilder.DropColumn(
name: "note",
table: "t_process_map_plan_static_measurement_output");
migrationBuilder.DropColumn(
name: "rpm",
table: "t_process_map_plan_rotor_rpm_acceleration");
migrationBuilder.DropColumn(
name: "rpm_max",
table: "t_process_map_plan_rotor_rpm_acceleration");
migrationBuilder.DropColumn(
name: "top_drive_torque",
table: "t_process_map_plan_rotor_rpm_acceleration");
migrationBuilder.DropColumn(
name: "top_drive_torque_max",
table: "t_process_map_plan_rotor_rpm_acceleration");
migrationBuilder.DropColumn(
name: "note",
table: "t_process_map_plan_operation_switching_off_the_pump");
migrationBuilder.DropColumn(
name: "note",
table: "t_process_map_plan_anti_crash_rotation");
migrationBuilder.AddColumn<double>(
name: "buckling",
table: "t_process_map_plan_rotor_rpm_acceleration",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Складывание, м");
migrationBuilder.AddColumn<double>(
name: "zenit_angle",
table: "t_process_map_plan_rotor_rpm_acceleration",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Зенитный угол, градусы");
}
}
}

View File

@ -2684,6 +2684,13 @@ namespace AsbCloudDb.Migrations
.HasColumnName("id_wellsection_type")
.HasComment("Тип секции");
b.Property<string>("Note")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)")
.HasColumnName("note")
.HasComment("Примечание");
b.Property<DateTimeOffset?>("Obsolete")
.HasColumnType("timestamp with time zone")
.HasColumnName("obsolete")
@ -3297,6 +3304,13 @@ namespace AsbCloudDb.Migrations
.HasColumnName("id_wellsection_type")
.HasComment("Тип секции");
b.Property<string>("Note")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)")
.HasColumnName("note")
.HasComment("Примечание");
b.Property<DateTimeOffset?>("Obsolete")
.HasColumnType("timestamp with time zone")
.HasColumnName("obsolete")
@ -4741,11 +4755,6 @@ namespace AsbCloudDb.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<double>("Buckling")
.HasColumnType("double precision")
.HasColumnName("buckling")
.HasComment("Складывание, м");
b.Property<DateTimeOffset>("Creation")
.HasColumnType("timestamp with time zone")
.HasColumnName("creation")
@ -4803,10 +4812,25 @@ namespace AsbCloudDb.Migrations
.HasColumnName("obsolete")
.HasComment("дата устаревания");
b.Property<double>("ZenithAngle")
b.Property<double>("Rpm")
.HasColumnType("double precision")
.HasColumnName("zenit_angle")
.HasComment("Зенитный угол, градусы");
.HasColumnName("rpm")
.HasComment("Обороты на ВСП уставка, об/мин.");
b.Property<double>("RpmMax")
.HasColumnType("double precision")
.HasColumnName("rpm_max")
.HasComment("Обороты на ВСП ограничение, об/мин.");
b.Property<double>("TopDriveTorque")
.HasColumnType("double precision")
.HasColumnName("top_drive_torque")
.HasComment("Момент на ВСП уставка, кН*м.");
b.Property<double>("TopDriveTorqueMax")
.HasColumnType("double precision")
.HasColumnName("top_drive_torque_max")
.HasComment("Момент на ВСП ограничение, кН*м.");
b.HasKey("Id");
@ -5126,6 +5150,13 @@ namespace AsbCloudDb.Migrations
.HasColumnName("id_wellsection_type")
.HasComment("Тип секции");
b.Property<string>("Note")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)")
.HasColumnName("note")
.HasComment("Примечание");
b.Property<DateTimeOffset?>("Obsolete")
.HasColumnType("timestamp with time zone")
.HasColumnName("obsolete")
@ -5329,6 +5360,13 @@ namespace AsbCloudDb.Migrations
.HasColumnName("interval")
.HasComment("Интервал расхаживания, м.");
b.Property<string>("Note")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)")
.HasColumnName("note")
.HasComment("Примечание");
b.Property<DateTimeOffset?>("Obsolete")
.HasColumnType("timestamp with time zone")
.HasColumnName("obsolete")

View File

@ -23,6 +23,9 @@ public class ProcessMapPlanAntiCrashRotation : ProcessMapPlanBase
[Required]
public double TopDriveTorqueMax { get; set; }
[Column("note"), Comment("Примечание"), StringLength(1024)]
public string Note { get; set; } = string.Empty;
[ForeignKey(nameof(IdPrevious))]
public virtual ProcessMapPlanAntiCrashRotation? Previous { get; set; }
}

View File

@ -13,6 +13,9 @@ public class ProcessMapPlanStaticMeasurementOutput : ProcessMapPlanBase
[Required]
public double SignalWaitingTime { get; set; }
[Column("note"), Comment("Примечание"), StringLength(1024)]
public string Note { get; set; } = string.Empty;
[ForeignKey(nameof(IdPrevious))]
public virtual ProcessMapPlanStaticMeasurementOutput? Previous { get; set; }
}

View File

@ -8,15 +8,25 @@ namespace AsbCloudDb.Model.ProcessMapPlan.Operations;
[Table("t_process_map_plan_rotor_rpm_acceleration"), Comment("Выход на обороты перед ротором")]
public class ProcessMapPlanRotorRpmAcceleration : ProcessMapPlanBase
{
[Column("zenit_angle"), Comment("Зенитный угол, градусы")]
[Range(0.0, 100.0)]
[Column("top_drive_torque"), Comment("Момент на ВСП уставка, кН*м.")]
[Range(0.0, 35.0)]
[Required]
public double ZenithAngle { get; set; }
public double TopDriveTorque { get; set; }
[Column("buckling"), Comment("Складывание, м")]
[Range(0.0, 20.0)]
[Column("top_drive_torque_max"), Comment("Момент на ВСП ограничение, кН*м.")]
[Range(0.0, 35.0)]
[Required]
public double Buckling { get; set; }
public double TopDriveTorqueMax { get; set; }
[Column("rpm"), Comment("Обороты на ВСП уставка, об/мин.")]
[Range(0.0, 270.0)]
[Required]
public double Rpm { get; set; }
[Column("rpm_max"), Comment("Обороты на ВСП ограничение, об/мин.")]
[Range(0.0, 270.0)]
[Required]
public double RpmMax { get; set; }
[Column("note"), Comment("Примечание"), StringLength(1024)]
public string Note { get; set; } = string.Empty;

View File

@ -17,6 +17,9 @@ public class ProcessMapPlanSwitchingOffThePump : ProcessMapPlanBase
[Range(0.0, 100.0)]
public double ResidualPressureLimit { get; set; }
[Column("note"), Comment("Примечание"), StringLength(1024)]
public string Note { get; set; } = string.Empty;
[ForeignKey(nameof(IdPrevious))]
public virtual ProcessMapPlanSwitchingOffThePump? Previous { get; set; }
}

View File

@ -78,6 +78,9 @@ public class ProcessMapPlanTFOrientation : ProcessMapPlanBase
[Required]
public double StopPointOffBottom { get; set; }
[Column("note"), Comment("Примечание"), StringLength(1024)]
public string Note { get; set; } = string.Empty;
[ForeignKey(nameof(IdPrevious))]
public virtual ProcessMapPlanTFOrientation? Previous { get; set; }
}

View File

@ -28,9 +28,7 @@ public class ProcessMapPlanRotorRpmAccelerationControllerTest :
DepthEnd = 2,
Id = 0,
IdWellSectionType = 1,
Buckling = 1,
Note = "1",
ZenithAngle = 1,
};
private readonly ProcessMapPlanRotorRpmAcceleration entity = new ProcessMapPlanRotorRpmAcceleration()
@ -43,9 +41,7 @@ public class ProcessMapPlanRotorRpmAccelerationControllerTest :
IdAuthor = 1,
IdEditor = 1,
Creation = DateTimeOffset.UtcNow,
Buckling = 1,
Note = "1",
ZenithAngle = 1,
};
[Fact]