using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace AsbCloudDb.Migrations { /// public partial class TelemetryDataWellWorkover : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "t_telemetry_data_well_workover", columns: table => new { id_telemetry = table.Column(type: "integer", nullable: false), date = table.Column(type: "timestamp with time zone", nullable: false, comment: "'2021-10-19 18:23:54+05'"), id_user = table.Column(type: "integer", nullable: true, comment: "Пользователь ТКРС"), bit_depth = table.Column(type: "real", nullable: false, comment: "Глубина инструмента, м "), block_position = table.Column(type: "real", nullable: false, comment: "Высота крюкоблока, м"), hook_load = table.Column(type: "real", nullable: false, comment: "Вес на крюке"), trip_in_out_speed = table.Column(type: "real", nullable: false, comment: "Скорость СПО, м/с"), trip_tank_volume = table.Column(type: "real", nullable: false, comment: "Объем доливной емкости (ДЕ), м3"), mud_density = table.Column(type: "real", nullable: false, comment: "Плотность жидкости в ДЕ, г/см3"), flow_rate = table.Column(type: "real", nullable: false, comment: "Расход доливаемой жидкости, м3/ч"), well_level = table.Column(type: "real", nullable: false, comment: "Уровень в скважине (по эхолоту), м"), mud_temperature_in_blow_out_preventor = table.Column(type: "real", nullable: false, comment: "Температура жидкости в отводе крестовины ПВО, С"), gas_indications_CH4 = table.Column(type: "real", nullable: false, comment: "Газопоказания (СН4), %"), gas_indications_H2S = table.Column(type: "real", nullable: false, comment: "Газопоказания (Н2S), %") }, constraints: table => { table.PrimaryKey("PK_t_telemetry_data_well_workover", x => new { x.id_telemetry, x.date }); table.ForeignKey( name: "t_telemetry_data_well_workover_t_telemetry_id_fk", column: x => x.id_telemetry, principalTable: "t_telemetry", principalColumn: "id", onDelete: ReferentialAction.Cascade); }, comment: "набор основных данных для ТКРС"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "t_telemetry_data_well_workover"); } } }