forked from ddrilling/AsbCloudServer
Added migrations.
This commit is contained in:
parent
e7129f0148
commit
5e757e9bbb
2010
AsbCloudDb/Migrations/20210907085527_Init.Designer.cs
generated
Normal file
2010
AsbCloudDb/Migrations/20210907085527_Init.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
956
AsbCloudDb/Migrations/20210907085527_Init.cs
Normal file
956
AsbCloudDb/Migrations/20210907085527_Init.cs
Normal file
@ -0,0 +1,956 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using AsbCloudDb.Model;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace AsbCloudDb.Migrations
|
||||
{
|
||||
public partial class Init : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterDatabase()
|
||||
.Annotation("Npgsql:PostgresExtension:adminpack", ",,");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_company_type",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
caption = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_company_type", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_deposit",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
caption = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
|
||||
latitude = table.Column<double>(type: "double precision", nullable: true),
|
||||
longitude = table.Column<double>(type: "double precision", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_deposit", x => x.id);
|
||||
},
|
||||
comment: "Месторождение");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_file_category",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
name = table.Column<string>(type: "text", nullable: true, comment: "Название категории"),
|
||||
short_name = table.Column<string>(type: "text", nullable: true, comment: "Короткое название категории")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_file_category", x => x.id);
|
||||
},
|
||||
comment: "Категории файлов");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_measure_category",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
name = table.Column<string>(type: "text", nullable: true, comment: "Название категории"),
|
||||
short_name = table.Column<string>(type: "text", nullable: true, comment: "Короткое название категории")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_measure_category", x => x.id);
|
||||
},
|
||||
comment: "Категория последних данных");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_telemetry",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
remote_uid = table.Column<string>(type: "text", nullable: true, comment: "Идентификатор передающего устройства. Может повторяться в списке, так как комплекты оборудования переезжают от скв. к скв."),
|
||||
info = table.Column<TelemetryInfo>(type: "jsonb", nullable: true, comment: "Информация с панели о скважине")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_telemetry", x => x.id);
|
||||
},
|
||||
comment: "таблица привязки телеметрии от комплектов к конкретной скважине.");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_user_role",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
caption = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true, comment: "Название")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_user_role", x => x.id);
|
||||
},
|
||||
comment: "Роли пользователей в системе");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_well_operation_category",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
name = table.Column<string>(type: "text", nullable: true, comment: "Название категории операции"),
|
||||
code = table.Column<int>(type: "integer", nullable: false, comment: "Код операции")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_well_operation_category", x => x.id);
|
||||
},
|
||||
comment: "Справочник операций на скважине");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_well_section_type",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
caption = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true, comment: "Название")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_well_section_type", x => x.id);
|
||||
},
|
||||
comment: "конструкция секции скважины");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_well_type",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
caption = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true, comment: "Название")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_well_type", x => x.id);
|
||||
},
|
||||
comment: "конструкция скважины");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_company",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
caption = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
|
||||
id_company_type = table.Column<int>(type: "integer", maxLength: 255, nullable: false, comment: "вид деятельности")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_company", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_t_company_t_company_type_id_company_type",
|
||||
column: x => x.id_company_type,
|
||||
principalTable: "t_company_type",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_cluster",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
caption = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true, comment: "Название"),
|
||||
id_deposit = table.Column<int>(type: "integer", nullable: true),
|
||||
latitude = table.Column<double>(type: "double precision", nullable: true),
|
||||
longitude = table.Column<double>(type: "double precision", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_cluster", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "t_cluster_t_deposit_id_fk",
|
||||
column: x => x.id_deposit,
|
||||
principalTable: "t_deposit",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
},
|
||||
comment: "Кусты");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_data_saub_base",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
id_telemetry = table.Column<int>(type: "integer", nullable: false),
|
||||
date = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, comment: "'2021-10-19 18:23:54+05'"),
|
||||
mode = table.Column<int>(type: "integer", nullable: true, comment: "Режим САУБ"),
|
||||
id_user = table.Column<int>(type: "integer", nullable: true, comment: "Пользователь САУБ"),
|
||||
well_depth = table.Column<double>(type: "double precision", nullable: true, comment: "Глубина забоя"),
|
||||
bit_depth = table.Column<double>(type: "double precision", nullable: true, comment: "Положение инструмента"),
|
||||
block_position = table.Column<double>(type: "double precision", nullable: true, comment: "Высота талевого блока"),
|
||||
block_position_min = table.Column<double>(type: "double precision", nullable: true, comment: "Талевый блок. Мин положение"),
|
||||
block_position_max = table.Column<double>(type: "double precision", nullable: true, comment: "Талевый блок. Макс положение"),
|
||||
block_speed = table.Column<double>(type: "double precision", nullable: true, comment: "Скорость талевого блока"),
|
||||
block_speed_sp = table.Column<double>(type: "double precision", nullable: true, comment: "Скорости талевого блока. Задание"),
|
||||
block_speed_sp_rotor = table.Column<double>(type: "double precision", nullable: true, comment: "Талевый блок. Задание скорости для роторного бурения"),
|
||||
block_speed_sp_slide = table.Column<double>(type: "double precision", nullable: true, comment: "Талевый блок. Задание скорости для режима слайда"),
|
||||
block_speed_sp_develop = table.Column<double>(type: "double precision", nullable: true, comment: "Талевый блок. Задание скорости для проработки"),
|
||||
pressure = table.Column<double>(type: "double precision", nullable: true, comment: "Давление"),
|
||||
pressure_idle = table.Column<double>(type: "double precision", nullable: true, comment: "Давление. Холостой ход"),
|
||||
pressure_sp = table.Column<double>(type: "double precision", nullable: true, comment: "Давление. Задание"),
|
||||
pressure_sp_rotor = table.Column<double>(type: "double precision", nullable: true, comment: "Давление. Задание для роторного бурения"),
|
||||
pressure_sp_slide = table.Column<double>(type: "double precision", nullable: true, comment: "Давление. Задание для режима слайда"),
|
||||
pressure_sp_develop = table.Column<double>(type: "double precision", nullable: true, comment: "Давление. Задание для проработки"),
|
||||
pressure_delta_limit_max = table.Column<double>(type: "double precision", nullable: true, comment: "Давление дифф. Аварийное макс."),
|
||||
axial_load = table.Column<double>(type: "double precision", nullable: true, comment: "Осевая нагрузка"),
|
||||
axial_load_sp = table.Column<double>(type: "double precision", nullable: true, comment: "Осевая нагрузка. Задание"),
|
||||
axial_load_limit_max = table.Column<double>(type: "double precision", nullable: true, comment: "Осевая нагрузка. Аварийная макс."),
|
||||
hook_weight = table.Column<double>(type: "double precision", nullable: true, comment: "Вес на крюке"),
|
||||
hook_weight_idle = table.Column<double>(type: "double precision", nullable: true, comment: "Вес на крюке. Холостой ход"),
|
||||
hook_weight_limit_min = table.Column<double>(type: "double precision", nullable: true, comment: "Вес на крюке. Посадка"),
|
||||
hook_weight_limit_max = table.Column<double>(type: "double precision", nullable: true, comment: "Вес на крюке. Затяжка"),
|
||||
rotor_torque = table.Column<double>(type: "double precision", nullable: true, comment: "Момент на роторе"),
|
||||
rotor_torque_idle = table.Column<double>(type: "double precision", nullable: true, comment: "Момент на роторе. Холостой ход"),
|
||||
rotor_torque_sp = table.Column<double>(type: "double precision", nullable: true, comment: "Момент на роторе. Задание"),
|
||||
rotor_torque_limit_max = table.Column<double>(type: "double precision", nullable: true, comment: "Момент на роторе. Аварийный макс."),
|
||||
rotor_speed = table.Column<double>(type: "double precision", nullable: true, comment: "Обороты ротора"),
|
||||
flow = table.Column<double>(type: "double precision", nullable: true, comment: "Расход"),
|
||||
flow_idle = table.Column<double>(type: "double precision", nullable: true, comment: "Расход. Холостой ход"),
|
||||
flow_delta_limit_max = table.Column<double>(type: "double precision", nullable: true, comment: "Расход. Аварийный макс."),
|
||||
id_feed_regulator = table.Column<double>(type: "double precision", nullable: true, comment: "Текущий критерий бурения"),
|
||||
mse_state = table.Column<double>(type: "double precision", nullable: true, comment: "Текущее состояние работы MSE")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_data_saub_base", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "t_data_saub_base_t_telemetry_id_fk",
|
||||
column: x => x.id_telemetry,
|
||||
principalTable: "t_telemetry",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
},
|
||||
comment: "набор основных данных по SAUB");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_telemetry_event",
|
||||
columns: table => new
|
||||
{
|
||||
id_event = table.Column<int>(type: "integer", nullable: false),
|
||||
id_telemetry = table.Column<int>(type: "integer", nullable: false),
|
||||
id_category = table.Column<int>(type: "integer", nullable: false),
|
||||
message_template = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_telemetry_event", x => new { x.id_telemetry, x.id_event });
|
||||
table.ForeignKey(
|
||||
name: "t_event_t_telemetry_id_fk",
|
||||
column: x => x.id_telemetry,
|
||||
principalTable: "t_telemetry",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "Справочник событий. События формируют сообщения. Разделено по версиям посылок от телеметрии.");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_telemetry_message",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
id_telemetry = table.Column<int>(type: "integer", nullable: false),
|
||||
id_event = table.Column<int>(type: "integer", nullable: false),
|
||||
id_telemetry_user = table.Column<int>(type: "integer", nullable: true, comment: "Пользователь панели отправляющей телеметрию. не пользователь облака."),
|
||||
date = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
arg0 = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true, comment: "Аргумент №0 для вставки в шаблон сообщения"),
|
||||
arg1 = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
|
||||
arg2 = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
|
||||
arg3 = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_telemetry_message", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "t_messages_t_telemetry_id_fk",
|
||||
column: x => x.id_telemetry,
|
||||
principalTable: "t_telemetry",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "Сообщения на буровых");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_telemetry_user",
|
||||
columns: table => new
|
||||
{
|
||||
id_user = table.Column<int>(type: "integer", nullable: false),
|
||||
id_telemetry = table.Column<int>(type: "integer", nullable: false),
|
||||
name = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
|
||||
surname = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
|
||||
patronymic = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
|
||||
level = table.Column<int>(type: "integer", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_telemetry_user", x => new { x.id_telemetry, x.id_user });
|
||||
table.ForeignKey(
|
||||
name: "t_telemetry_user_t_telemetry_id_fk",
|
||||
column: x => x.id_telemetry,
|
||||
principalTable: "t_telemetry",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
},
|
||||
comment: "Пользователи панели САУБ. Для сообщений.");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_telemetry_analysis",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
id_telemetry = table.Column<int>(type: "integer", nullable: false),
|
||||
id_operation = table.Column<int>(type: "integer", nullable: false),
|
||||
unix_date = table.Column<long>(type: "bigint", nullable: false, comment: "Unix timestamp для Linq запросов с вычислением дат"),
|
||||
duration_sec = table.Column<int>(type: "integer", nullable: false, comment: "Кол-во секунд после предыдущей операции"),
|
||||
operation_start_depth = table.Column<double>(type: "double precision", nullable: true, comment: "Глубина, на которой началась операция"),
|
||||
operation_end_depth = table.Column<double>(type: "double precision", nullable: true, comment: "Глубина, на которой закончилась операция"),
|
||||
is_well_depth_increasing = table.Column<bool>(type: "boolean", nullable: false, comment: "Глубина забоя увеличивается"),
|
||||
is_well_depth_decreasing = table.Column<bool>(type: "boolean", nullable: false, comment: "Глубина забоя не увеличивается"),
|
||||
is_bit_position_increasing = table.Column<bool>(type: "boolean", nullable: false, comment: "Долото спускается"),
|
||||
is_bit_position_decreasing = table.Column<bool>(type: "boolean", nullable: false, comment: "Долото поднимается"),
|
||||
is_bit_posision_lt_20 = table.Column<bool>(type: "boolean", nullable: false, comment: "Положение долота меньше 20м"),
|
||||
is_block_posision_incresing = table.Column<bool>(type: "boolean", nullable: false, comment: "Талевый блок спускается"),
|
||||
is_block_posision_decresing = table.Column<bool>(type: "boolean", nullable: false, comment: "Талевый блок поднимается"),
|
||||
is_rotor_speed_lt_3 = table.Column<bool>(type: "boolean", nullable: false, comment: "Обороты ротора ниже 3"),
|
||||
is_rotor_speed_gt_3 = table.Column<bool>(type: "boolean", nullable: false, comment: "Обороты ротора выше 3"),
|
||||
is_pressure_lt_20 = table.Column<bool>(type: "boolean", nullable: false, comment: "Давление менее 20"),
|
||||
is_pressure_gt_20 = table.Column<bool>(type: "boolean", nullable: false, comment: "Давоение более 20"),
|
||||
is_hook_weight_not_changes = table.Column<bool>(type: "boolean", nullable: false, comment: "Вес на крюке не меняется"),
|
||||
is_hook_weight_lt_3 = table.Column<bool>(type: "boolean", nullable: false, comment: "Вес на крюке менее 3т")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_telemetry_analysis", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "t_analysis_t_operation_id_fk",
|
||||
column: x => x.id_operation,
|
||||
principalTable: "t_well_operation_category",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
table.ForeignKey(
|
||||
name: "t_analysis_t_telemetry_id_fk",
|
||||
column: x => x.id_telemetry,
|
||||
principalTable: "t_telemetry",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "События на скважине");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_user",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
id_company = table.Column<int>(type: "integer", nullable: true),
|
||||
id_role = table.Column<int>(type: "integer", nullable: true),
|
||||
login = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
|
||||
password_hash = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true, comment: "соленый хэш пароля.\nпервые 5 символов - соль"),
|
||||
state = table.Column<short>(type: "smallint", nullable: true, comment: "состояние:\n100 - удален"),
|
||||
level = table.Column<int>(type: "integer", nullable: true),
|
||||
name = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true, comment: "имя"),
|
||||
surname = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true, comment: "фамилия"),
|
||||
patronymic = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true, comment: "отчество")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_user", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_t_user_t_user_role_id_role",
|
||||
column: x => x.id_role,
|
||||
principalTable: "t_user_role",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "t_user_t_company_id_fk",
|
||||
column: x => x.id_company,
|
||||
principalTable: "t_company",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
},
|
||||
comment: "Пользователи облака");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_well",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
caption = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
|
||||
id_cluster = table.Column<int>(type: "integer", nullable: true),
|
||||
id_telemetry = table.Column<int>(type: "integer", nullable: true),
|
||||
id_well_type = table.Column<int>(type: "integer", nullable: true),
|
||||
latitude = table.Column<double>(type: "double precision", nullable: true),
|
||||
longitude = table.Column<double>(type: "double precision", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_well", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_t_well_t_well_type_id_well_type",
|
||||
column: x => x.id_well_type,
|
||||
principalTable: "t_well_type",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "t_well_t_cluster_id_fk",
|
||||
column: x => x.id_cluster,
|
||||
principalTable: "t_cluster",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "t_well_t_telemetry_id_fk",
|
||||
column: x => x.id_telemetry,
|
||||
principalTable: "t_telemetry",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
},
|
||||
comment: "скважины");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_file_info",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
id_well = table.Column<int>(type: "integer", nullable: false, comment: "id скважины"),
|
||||
id_author = table.Column<int>(type: "integer", nullable: true, comment: "Id пользователя, загрузившего файл"),
|
||||
id_category = table.Column<int>(type: "integer", nullable: false, comment: "id категории файла"),
|
||||
name = table.Column<string>(type: "text", nullable: true, comment: "Название файла"),
|
||||
date = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
file_size = table.Column<long>(type: "bigint", nullable: false, comment: "Размер файла"),
|
||||
is_deleted = table.Column<bool>(type: "boolean", nullable: false, comment: "Удален ли файл")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_file_info", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_t_file_info_t_file_category_id_category",
|
||||
column: x => x.id_category,
|
||||
principalTable: "t_file_category",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_t_file_info_t_user_id_author",
|
||||
column: x => x.id_author,
|
||||
principalTable: "t_user",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_t_file_info_t_well_id_well",
|
||||
column: x => x.id_well,
|
||||
principalTable: "t_well",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "Файлы всех категорий");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_measure",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
id_well = table.Column<int>(type: "integer", nullable: false, comment: "id скважины"),
|
||||
id_category = table.Column<int>(type: "integer", nullable: false, comment: "id категории"),
|
||||
timestamp = table.Column<DateTime>(type: "timestamp without time zone", nullable: false, comment: "время добавления"),
|
||||
data = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true, comment: "Данные таблицы последних данных"),
|
||||
is_deleted = table.Column<bool>(type: "boolean", nullable: false, comment: "Пометка удаленным")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_measure", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_t_measure_t_measure_category_id_category",
|
||||
column: x => x.id_category,
|
||||
principalTable: "t_measure_category",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_t_measure_t_well_id_well",
|
||||
column: x => x.id_well,
|
||||
principalTable: "t_well",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "Таблица c данными для вкладки 'Последние данные'");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_relation_company_well",
|
||||
columns: table => new
|
||||
{
|
||||
id_well = table.Column<int>(type: "integer", nullable: false),
|
||||
id_company = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_relation_company_well", x => new { x.id_company, x.id_well });
|
||||
table.ForeignKey(
|
||||
name: "t_relation_company_well_t_company_id_fk",
|
||||
column: x => x.id_company,
|
||||
principalTable: "t_company",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "t_relation_company_well_t_well_id_fk",
|
||||
column: x => x.id_well,
|
||||
principalTable: "t_well",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "отношение скважин и компаний");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_well_operation",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
id_well = table.Column<int>(type: "integer", nullable: false, comment: "Id скважины"),
|
||||
id_well_section_type = table.Column<int>(type: "integer", nullable: false, comment: "Id тип секции скважины"),
|
||||
id_category = table.Column<int>(type: "integer", nullable: false, comment: "Id категории операции"),
|
||||
id_type = table.Column<int>(type: "integer", nullable: false, comment: "0 = План или 1 = Факт"),
|
||||
depth = table.Column<double>(type: "double precision", nullable: false, comment: "Глубина, на которой производилась операция"),
|
||||
date = table.Column<DateTime>(type: "timestamp without time zone", nullable: false, comment: "Дата начала операции"),
|
||||
duration_hours = table.Column<double>(type: "double precision", nullable: false, comment: "Продолжительность в часах"),
|
||||
category_info = table.Column<string>(type: "text", nullable: true, comment: "Доп. информация к выбраной категории"),
|
||||
comment = table.Column<string>(type: "text", nullable: true, comment: "Комментарий")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_well_operation", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_t_well_operation_t_well_id_well",
|
||||
column: x => x.id_well,
|
||||
principalTable: "t_well",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_t_well_operation_t_well_operation_category_id_category",
|
||||
column: x => x.id_category,
|
||||
principalTable: "t_well_operation_category",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_t_well_operation_t_well_section_type_id_well_section_type",
|
||||
column: x => x.id_well_section_type,
|
||||
principalTable: "t_well_section_type",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "Данные по операциям на скважине");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "t_report_property",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
id_well = table.Column<int>(type: "integer", nullable: false, comment: "id скважины"),
|
||||
id_file = table.Column<int>(type: "integer", nullable: false, comment: "id файла-родителя"),
|
||||
begin = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||
end = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, comment: "timestamp with time zone"),
|
||||
step = table.Column<int>(type: "integer", nullable: false, comment: "размер шага в секундах"),
|
||||
format = table.Column<int>(type: "integer", nullable: false, comment: "Формат отчета")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_t_report_property", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_t_report_property_t_file_info_id_file",
|
||||
column: x => x.id_file,
|
||||
principalTable: "t_file_info",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_t_report_property_t_well_id_well",
|
||||
column: x => x.id_well,
|
||||
principalTable: "t_well",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "Отчеты с данными по буровым");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "t_company_type",
|
||||
columns: new[] { "id", "caption" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, "Недрапользователь" },
|
||||
{ 2, "Буровой подрядчик" },
|
||||
{ 3, "Сервис автоматизации бурения" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "t_file_category",
|
||||
columns: new[] { "id", "name", "short_name" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 13, "Программа бурения, части", "ПБч" },
|
||||
{ 12, "Рапорт", "report" },
|
||||
{ 11, "Последние данные ННБ", "nnbLastData" },
|
||||
{ 10, "Последние данные Шламограммы", "mudLastData" },
|
||||
{ 9, "Последний замер бурового раствора ФАКТ", "fluidFactLastData" },
|
||||
{ 8, "Последний замер бурового раствора ПЛАН", "fluidPlanLastData" },
|
||||
{ 6, "Супервайзер", "supervisor" },
|
||||
{ 14, "Программа бурения", "ПБ" },
|
||||
{ 5, "Документы по скважине", "wellDocuments" },
|
||||
{ 4, "ГТИ", "gti" },
|
||||
{ 3, "ННБ", "nnb" },
|
||||
{ 2, "Цементирование", "cement" },
|
||||
{ 1, "Растворный сервис", "fluidService" },
|
||||
{ 7, "Мастер", "master" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "t_measure_category",
|
||||
columns: new[] { "id", "name", "short_name" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 3, "ННБ", "ННБ" },
|
||||
{ 2, "Шламограмма", "Шламограмма" },
|
||||
{ 1, "Показатели бурового раствора", "Раствор" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "t_user_role",
|
||||
columns: new[] { "id", "caption" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, "Администратор" },
|
||||
{ 2, "Пользователь" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "t_well_operation_category",
|
||||
columns: new[] { "id", "code", "name" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1031, 0, "Ремонт" },
|
||||
{ 1030, 0, "Разбуривание тех.оснастки" },
|
||||
{ 1029, 0, "Прокачка пачек" },
|
||||
{ 1028, 0, "Промежуточная промывка" },
|
||||
{ 1027, 0, "Промывка" },
|
||||
{ 1026, 0, "Разборка КНБК" },
|
||||
{ 1024, 0, "Подготовительные работы" },
|
||||
{ 1032, 0, "Спуск инструмента" },
|
||||
{ 1023, 0, "Сборка инструмента" },
|
||||
{ 1022, 0, "Обратная проработка" },
|
||||
{ 1021, 0, "Подъем инструмента с промывкой" },
|
||||
{ 1020, 0, "Подъем инструмента" },
|
||||
{ 1019, 0, "Перетяжка тальканата" },
|
||||
{ 1025, 0, "Сборка КНБК" },
|
||||
{ 1033, 0, "Спуск инструмента с промывкой" },
|
||||
{ 1044, 0, "ВМР" },
|
||||
{ 1035, 0, "Принудительная проработка" },
|
||||
{ 1036, 0, "Спуск обсадной колонны" },
|
||||
{ 1037, 0, "Тех СПО-подъем" },
|
||||
{ 1038, 0, "Тех СПО-спуск" },
|
||||
{ 1039, 0, "Техническое обслуживание" },
|
||||
{ 1040, 0, "Цементаж" },
|
||||
{ 1041, 0, "Шаблонировка ствола" },
|
||||
{ 1042, 0, "Геологическое осложнение" },
|
||||
{ 1043, 0, "НПВ" },
|
||||
{ 1018, 0, "Перетяжка талевого каната" },
|
||||
{ 1045, 0, "Прочее" },
|
||||
{ 1046, 0, "Спуск КНБК" },
|
||||
{ 1047, 0, "Подъем КНБК" },
|
||||
{ 1048, 0, "Спуск ОК" },
|
||||
{ 1034, 0, "Прямая проработка" },
|
||||
{ 1017, 0, "Перезапись каротажа" },
|
||||
{ 1009, 0, "Оборудование устья" },
|
||||
{ 1015, 0, "Опрессовка ВЗД" },
|
||||
{ 1, 0, "Невозможно определить операцию" },
|
||||
{ 2, 0, "Роторное бурение" },
|
||||
{ 3, 0, "Слайдирование" },
|
||||
{ 4, 0, "Подъем с проработкой" },
|
||||
{ 5, 0, "Спуск с проработкой" },
|
||||
{ 6, 0, "Подъем с промывкой" },
|
||||
{ 7, 0, "Спуск с промывкой" },
|
||||
{ 8, 0, "Спуск в скважину" },
|
||||
{ 9, 0, "Спуск с вращением" },
|
||||
{ 10, 0, "Подъем из скважины" },
|
||||
{ 11, 0, "Подъем с вращением" },
|
||||
{ 12, 0, "Промывка в покое" },
|
||||
{ 1016, 0, "Перевод скв на другой тип промывочной жидкости" },
|
||||
{ 14, 0, "Удержание в клиньях" },
|
||||
{ 15, 0, "Неподвижное состояние" },
|
||||
{ 13, 0, "Промывка с вращением" },
|
||||
{ 17, 0, "На поверхности" },
|
||||
{ 1014, 0, "Опресовка Ц.К." },
|
||||
{ 1013, 0, "Опрессовка ПВО" },
|
||||
{ 1012, 0, "Окончание цикла строительства скважины" },
|
||||
{ 16, 0, "Вращение без циркуляции" },
|
||||
{ 1010, 0, "ОЗЦ" },
|
||||
{ 1008, 0, "ОЗЦ" },
|
||||
{ 1011, 0, "Начало цикла строительства скважины" },
|
||||
{ 1006, 0, "Установка ФА" },
|
||||
{ 1005, 0, "Демонтаж ПВО" },
|
||||
{ 1004, 0, "Монтаж ПВО" },
|
||||
{ 1003, 0, "ГФР" },
|
||||
{ 1002, 0, "ГИС" },
|
||||
{ 1001, 0, "Бурение в интервале" },
|
||||
{ 1007, 0, "Оборудование устья" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "t_well_section_type",
|
||||
columns: new[] { "id", "caption" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, "Пилотный ствол" },
|
||||
{ 2, "Направление" },
|
||||
{ 3, "Кондуктор" },
|
||||
{ 4, "Эксплуатационная колонна" },
|
||||
{ 5, "Транспортный ствол" },
|
||||
{ 6, "Хвостовик" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "t_well_type",
|
||||
columns: new[] { "id", "caption" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, "Наклонно-направленная" },
|
||||
{ 2, "Горизонтальная" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "t_company",
|
||||
columns: new[] { "id", "caption", "id_company_type" },
|
||||
values: new object[] { 1, "ООО \"АСБ\"", 3 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "t_user",
|
||||
columns: new[] { "id", "id_company", "id_role", "level", "login", "name", "password_hash", "patronymic", "state", "surname" },
|
||||
values: new object[] { 1, 1, 1, 2147483647, "dev", "Разработчик", "Vlcj|4fa529103dde7ff72cfe76185f344d4aa87931f8e1b2044e8a7739947c3d18923464eaad93843e4f809c5e126d013072", null, null, null });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_cluster_id_deposit",
|
||||
table: "t_cluster",
|
||||
column: "id_deposit");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_company_id_company_type",
|
||||
table: "t_company",
|
||||
column: "id_company_type");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_data_saub_base_id_telemetry",
|
||||
table: "t_data_saub_base",
|
||||
column: "id_telemetry");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_file_info_id_author",
|
||||
table: "t_file_info",
|
||||
column: "id_author");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_file_info_id_category",
|
||||
table: "t_file_info",
|
||||
column: "id_category");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_file_info_id_well",
|
||||
table: "t_file_info",
|
||||
column: "id_well");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_measure_id_category",
|
||||
table: "t_measure",
|
||||
column: "id_category");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_measure_id_well",
|
||||
table: "t_measure",
|
||||
column: "id_well");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_relation_company_well_id_well",
|
||||
table: "t_relation_company_well",
|
||||
column: "id_well");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_report_property_id_file",
|
||||
table: "t_report_property",
|
||||
column: "id_file");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_report_property_id_well",
|
||||
table: "t_report_property",
|
||||
column: "id_well");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "t_telemetry_remote_uid_index",
|
||||
table: "t_telemetry",
|
||||
column: "remote_uid");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_telemetry_analysis_id_operation",
|
||||
table: "t_telemetry_analysis",
|
||||
column: "id_operation");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_telemetry_analysis_id_telemetry",
|
||||
table: "t_telemetry_analysis",
|
||||
column: "id_telemetry");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_telemetry_message_id_telemetry",
|
||||
table: "t_telemetry_message",
|
||||
column: "id_telemetry");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_user_id_company",
|
||||
table: "t_user",
|
||||
column: "id_company");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_user_id_role",
|
||||
table: "t_user",
|
||||
column: "id_role");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_user_login",
|
||||
table: "t_user",
|
||||
column: "login",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_well_id_cluster",
|
||||
table: "t_well",
|
||||
column: "id_cluster");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_well_id_telemetry",
|
||||
table: "t_well",
|
||||
column: "id_telemetry",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_well_id_well_type",
|
||||
table: "t_well",
|
||||
column: "id_well_type");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_well_operation_date",
|
||||
table: "t_well_operation",
|
||||
column: "date");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_well_operation_depth",
|
||||
table: "t_well_operation",
|
||||
column: "depth");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_well_operation_id_category",
|
||||
table: "t_well_operation",
|
||||
column: "id_category");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_well_operation_id_well",
|
||||
table: "t_well_operation",
|
||||
column: "id_well");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_t_well_operation_id_well_section_type",
|
||||
table: "t_well_operation",
|
||||
column: "id_well_section_type");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_data_saub_base");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_measure");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_relation_company_well");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_report_property");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_telemetry_analysis");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_telemetry_event");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_telemetry_message");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_telemetry_user");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_well_operation");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_measure_category");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_file_info");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_well_operation_category");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_well_section_type");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_file_category");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_user");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_well");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_user_role");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_company");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_well_type");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_cluster");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_telemetry");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_company_type");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "t_deposit");
|
||||
}
|
||||
}
|
||||
}
|
2008
AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs
Normal file
2008
AsbCloudDb/Migrations/AsbCloudDbContextModelSnapshot.cs
Normal file
File diff suppressed because it is too large
Load Diff
@ -40,19 +40,18 @@ namespace AsbCloudDb.Model
|
||||
// .Options;
|
||||
//var context = new AsbCloudDbContext(options);
|
||||
|
||||
public AsbCloudDbContext() : base()
|
||||
{ }
|
||||
|
||||
public AsbCloudDbContext(DbContextOptions<AsbCloudDbContext> options)
|
||||
: base(options)
|
||||
{
|
||||
Database.EnsureCreated();
|
||||
}
|
||||
{ }
|
||||
|
||||
//protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
//{
|
||||
// if (!optionsBuilder.IsConfigured)
|
||||
// {
|
||||
// optionsBuilder.UseNpgsql(connectionString);
|
||||
// }
|
||||
//}
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
if (!optionsBuilder.IsConfigured)
|
||||
optionsBuilder.UseNpgsql("Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True");
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
@ -164,9 +163,6 @@ namespace AsbCloudDb.Model
|
||||
});
|
||||
|
||||
FillData(modelBuilder);
|
||||
#if DEBUG
|
||||
FillDemoData(modelBuilder);
|
||||
#endif
|
||||
}
|
||||
|
||||
private static void FillData(ModelBuilder modelBuilder)
|
||||
@ -330,301 +326,6 @@ namespace AsbCloudDb.Model
|
||||
});
|
||||
}
|
||||
|
||||
// Эти данные не должны быть в релизе
|
||||
private static void FillDemoData(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<Deposit>(entity =>
|
||||
{
|
||||
entity.HasData(new List<Deposit> {
|
||||
new Deposit{Id = 1, Caption = "м/р 1", Latitude = 60.8705722222222, Longitude = 70.3811888888889 },
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Cluster>(entity =>
|
||||
{
|
||||
entity.HasData(new List<Cluster> {
|
||||
new Cluster{Id = 1, Caption = "к39.1", IdDeposit = 1, Latitude = 60.8705722222222, Longitude = 70.3811888888889},
|
||||
new Cluster{Id = 2, Caption = "к151", IdDeposit = 1, Latitude = 60.8205750000000, Longitude = 70.1343833333334},
|
||||
new Cluster{Id = 3, Caption = "к611", IdDeposit = 1, Latitude = 60.8100666666667, Longitude = 69.7778388888889},
|
||||
new Cluster{Id = 4, Caption = "к203", IdDeposit = 1, Latitude = 60.8928805555556, Longitude = 70.3272055555556},
|
||||
new Cluster{Id = 5, Caption = "к221", IdDeposit = 1, Latitude = 60.6672055555556, Longitude = 69.6603861111111},
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Measure>(entity => {
|
||||
entity.HasData(new List<Measure> {
|
||||
new Measure{ Id = 1, IdCategory = 1, IdWell = 1, Timestamp = DateTime.Now.AddHours(1), Data = new Dictionary<string, object>{ {"a", 1 }}},
|
||||
new Measure{ Id = 2, IdCategory = 1, IdWell = 1, Timestamp = DateTime.Now.AddHours(2), Data = new Dictionary<string, object>{ {"a", 2 }}},
|
||||
new Measure{ Id = 3, IdCategory = 2, IdWell = 1, Timestamp = DateTime.Now.AddHours(3), Data = new Dictionary<string, object>{ {"a", 3 }}},
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Telemetry>(entity =>
|
||||
{
|
||||
entity.HasData(new List<Telemetry>{
|
||||
new Telemetry{
|
||||
Id = 1,
|
||||
RemoteUid = "123",
|
||||
Info = new TelemetryInfo
|
||||
{
|
||||
Well = "1",
|
||||
Cluster = "1",
|
||||
Comment = "",
|
||||
Deposit = "1",
|
||||
Customer = "1",
|
||||
HmiVersion = "1",
|
||||
PlcVersion = "1",
|
||||
TimeZoneId = "1",
|
||||
DrillingStartDate = DateTime.Parse("2021-06-29T12:01:19.000000"),
|
||||
TimeZoneOffsetTotalHours = 5.0
|
||||
},
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Well>(entity =>
|
||||
{
|
||||
entity.HasData(new List<Well> {
|
||||
new Well{Id = 1, IdCluster = 1, IdWellType = 1, Caption = "скв 16314", Latitude = 60.8705722222222, Longitude = 70.3811888888889, IdTelemetry = 1, },
|
||||
new Well{Id = 2, IdCluster = 1, IdWellType = 2, Caption = "скв 16311", Latitude = 60.8705722222222, Longitude = 70.3811888888889},
|
||||
new Well{Id = 3, IdCluster = 2, IdWellType = 1, Caption = "скв 16315", Latitude = 60.8205750000000, Longitude = 70.1343833333334},
|
||||
new Well{Id = 4, IdCluster = 2, IdWellType = 1, Caption = "скв 16318", Latitude = 60.8205750000000, Longitude = 70.1343833333334},
|
||||
new Well{Id = 5, IdCluster = 3, IdWellType = 1, Caption = "скв 16310", Latitude = 60.8100666666667, Longitude = 69.7778388888889},
|
||||
new Well{Id = 6, IdCluster = 4, IdWellType = 1, Caption = "скв 16316", Latitude = 60.8928805555556, Longitude = 70.3272055555556},
|
||||
new Well{Id = 7, IdCluster = 5, IdWellType = 1, Caption = "скв 16312", Latitude = 60.6672055555556, Longitude = 69.6603861111111},
|
||||
new Well{Id = 8, IdCluster = 5, IdWellType = 1, Caption = "скв 16313", Latitude = 60.6672055555556, Longitude = 69.6603861111111},
|
||||
new Well{Id = 9, IdCluster = 5, IdWellType = 1, Caption = "скв 42669", Latitude = 60.6672055555556, Longitude = 69.6603861111111},
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity<RelationCompanyWell>(entity =>
|
||||
{
|
||||
entity.HasData(new List<RelationCompanyWell> {
|
||||
new RelationCompanyWell{ IdWell = 1, IdCompany = 1},
|
||||
new RelationCompanyWell{ IdWell = 2, IdCompany = 1},
|
||||
new RelationCompanyWell{ IdWell = 3, IdCompany = 1},
|
||||
new RelationCompanyWell{ IdWell = 4, IdCompany = 1},
|
||||
new RelationCompanyWell{ IdWell = 5, IdCompany = 1},
|
||||
new RelationCompanyWell{ IdWell = 6, IdCompany = 1},
|
||||
new RelationCompanyWell{ IdWell = 7, IdCompany = 1},
|
||||
new RelationCompanyWell{ IdWell = 8, IdCompany = 1},
|
||||
new RelationCompanyWell{ IdWell = 9, IdCompany = 1},
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity<WellOperation>(entity =>
|
||||
{
|
||||
entity.HasData(new List<WellOperation> {
|
||||
new WellOperation{ Id = 64049, IdWell = 1, IdWellSectionType = 2, IdCategory = 1025, IdType = 0, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-02 15:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 31502, IdWell = 1, IdWellSectionType = 1, IdCategory = 1027, IdType = 0, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 07:00"), DurationHours = 1.16666666666667},
|
||||
new WellOperation{ Id = 1531, IdWell = 5, IdWellSectionType = 2, IdCategory = 1025, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 00:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 44572, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 0, WellDepth = 1400, StartDate = DateTime.Parse("2021-08-27 05:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 44514, IdWell = 1, IdWellSectionType = 2, IdCategory = 1046, IdType = 0, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-02 19:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 53383, IdWell = 2, IdWellSectionType = 2, IdCategory = 1027, IdType = 1, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 07:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 3431, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-25 15:40"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 21460, IdWell = 1, IdWellSectionType = 1, IdCategory = 1025, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 01:10"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 30464, IdWell = 1, IdWellSectionType = 2, IdCategory = 1026, IdType = 0, WellDepth = 1500, StartDate = DateTime.Parse("2021-09-03 12:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 73111, IdWell = 1, IdWellSectionType = 2, IdCategory = 1026, IdType = 1, WellDepth = 1500, StartDate = DateTime.Parse("2021-09-04 13:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 81351, IdWell = 1, IdWellSectionType = 1, IdCategory = 1001, IdType = 1, WellDepth = 1110, StartDate = DateTime.Parse("2021-08-25 05:10"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 24480, IdWell = 1, IdWellSectionType = 2, IdCategory = 1027, IdType = 0, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-02 22:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 19101, IdWell = 1, IdWellSectionType = 1, IdCategory = 1026, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-25 21:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 34738, IdWell = 1, IdWellSectionType = 2, IdCategory = 1046, IdType = 1, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-04 02:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 37606, IdWell = 5, IdWellSectionType = 2, IdCategory = 1027, IdType = 1, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 07:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 71293, IdWell = 1, IdWellSectionType = 1, IdCategory = 1033, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-25 22:40"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 91696, IdWell = 1, IdWellSectionType = 1, IdCategory = 1025, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-26 18:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 77916, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-25 11:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 93585, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 0, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 10:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 42016, IdWell = 4, IdWellSectionType = 2, IdCategory = 1046, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 03:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 90466, IdWell = 1, IdWellSectionType = 1, IdCategory = 1048, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-26 09:10"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 15914, IdWell = 1, IdWellSectionType = 1, IdCategory = 1001, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-27 01:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 63469, IdWell = 4, IdWellSectionType = 2, IdCategory = 1026, IdType = 0, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-27 08:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 23659, IdWell = 1, IdWellSectionType = 2, IdCategory = 1001, IdType = 1, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-04 06:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 93508, IdWell = 1, IdWellSectionType = 2, IdCategory = 1027, IdType = 1, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-03 23:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 74346, IdWell = 2, IdWellSectionType = 2, IdCategory = 1026, IdType = 0, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-27 08:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 3139, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 1, WellDepth = 1110, StartDate = DateTime.Parse("2021-08-24 22:10"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 11429, IdWell = 2, IdWellSectionType = 2, IdCategory = 1046, IdType = 1, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 10:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 14542, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 0, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-24 21:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 70906, IdWell = 4, IdWellSectionType = 2, IdCategory = 1046, IdType = 0, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 10:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 82194, IdWell = 1, IdWellSectionType = 2, IdCategory = 1046, IdType = 0, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-03 02:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 13578, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-26 08:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 57798, IdWell = 1, IdWellSectionType = 1, IdCategory = 1033, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-25 14:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 37277, IdWell = 1, IdWellSectionType = 1, IdCategory = 1001, IdType = 0, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-25 00:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 23233, IdWell = 1, IdWellSectionType = 1, IdCategory = 1045, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-25 07:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 26075, IdWell = 2, IdWellSectionType = 2, IdCategory = 1046, IdType = 0, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 10:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 8230, IdWell = 1, IdWellSectionType = 1, IdCategory = 1027, IdType = 1, WellDepth = 800, StartDate = DateTime.Parse("2021-08-26 12:40"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 26414, IdWell = 1, IdWellSectionType = 1, IdCategory = 1026, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-26 15:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 92747, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-26 22:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 89559, IdWell = 1, IdWellSectionType = 1, IdCategory = 1027, IdType = 1, WellDepth = 800, StartDate = DateTime.Parse("2021-08-25 19:10"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 99336, IdWell = 1, IdWellSectionType = 1, IdCategory = 1027, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 08:10"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 80943, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-25 04:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 11934, IdWell = 1, IdWellSectionType = 1, IdCategory = 1006, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 08:10"), DurationHours = 2.33333333333333},
|
||||
new WellOperation{ Id = 88089, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 11:40"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 57116, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-25 18:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 57561, IdWell = 5, IdWellSectionType = 2, IdCategory = 1046, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 03:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 72783, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 1, WellDepth = 1110, StartDate = DateTime.Parse("2021-08-25 01:40"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 75549, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 03:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 60717, IdWell = 2, IdWellSectionType = 2, IdCategory = 1025, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 00:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 21171, IdWell = 1, IdWellSectionType = 1, IdCategory = 1025, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 00:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 13547, IdWell = 2, IdWellSectionType = 2, IdCategory = 1047, IdType = 1, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-24 17:30"), DurationHours = 15},
|
||||
new WellOperation{ Id = 83361, IdWell = 5, IdWellSectionType = 2, IdCategory = 1026, IdType = 1, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-27 08:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 58676, IdWell = 2, IdWellSectionType = 2, IdCategory = 1001, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 14:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 46864, IdWell = 1, IdWellSectionType = 2, IdCategory = 1025, IdType = 1, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-03 16:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 95276, IdWell = 1, IdWellSectionType = 1, IdCategory = 1027, IdType = 1, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 18:40"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 33478, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 0, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-24 17:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 85086, IdWell = 1, IdWellSectionType = 2, IdCategory = 1047, IdType = 1, WellDepth = 1500, StartDate = DateTime.Parse("2021-09-04 09:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 38808, IdWell = 1, IdWellSectionType = 2, IdCategory = 1001, IdType = 0, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-03 05:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 60045, IdWell = 5, IdWellSectionType = 2, IdCategory = 1001, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 14:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 82773, IdWell = 2, IdWellSectionType = 2, IdCategory = 1027, IdType = 0, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 07:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 38025, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-25 08:40"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 8312, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-26 02:10"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 84440, IdWell = 1, IdWellSectionType = 2, IdCategory = 1046, IdType = 1, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-03 19:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 78963, IdWell = 1, IdWellSectionType = 1, IdCategory = 1026, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-26 05:40"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 39690, IdWell = 2, IdWellSectionType = 2, IdCategory = 1046, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 03:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 88719, IdWell = 2, IdWellSectionType = 2, IdCategory = 1001, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 14:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 64890, IdWell = 1, IdWellSectionType = 1, IdCategory = 1001, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 15:10"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 95476, IdWell = 1, IdWellSectionType = 1, IdCategory = 1025, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-26 04:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 78257, IdWell = 4, IdWellSectionType = 2, IdCategory = 1027, IdType = 0, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 07:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 41260, IdWell = 1, IdWellSectionType = 2, IdCategory = 1047, IdType = 0, WellDepth = 1500, StartDate = DateTime.Parse("2021-09-03 09:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 41055, IdWell = 5, IdWellSectionType = 2, IdCategory = 1047, IdType = 1, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-24 17:30"), DurationHours = 15},
|
||||
new WellOperation{ Id = 47051, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 04:40"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 14068, IdWell = 1, IdWellSectionType = 1, IdCategory = 1045, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-25 12:10"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 96039, IdWell = 4, IdWellSectionType = 2, IdCategory = 1047, IdType = 0, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-24 17:30"), DurationHours = 15},
|
||||
new WellOperation{ Id = 34668, IdWell = 1, IdWellSectionType = 1, IdCategory = 1001, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 14:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 43146, IdWell = 2, IdWellSectionType = 2, IdCategory = 1026, IdType = 1, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-27 08:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 15263, IdWell = 2, IdWellSectionType = 2, IdCategory = 1046, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 03:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 20802, IdWell = 2, IdWellSectionType = 2, IdCategory = 1025, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 00:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 81320, IdWell = 4, IdWellSectionType = 2, IdCategory = 1001, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 14:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 43902, IdWell = 2, IdWellSectionType = 2, IdCategory = 1047, IdType = 0, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-24 17:30"), DurationHours = 15},
|
||||
new WellOperation{ Id = 62958, IdWell = 4, IdWellSectionType = 2, IdCategory = 1025, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 00:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 74174, IdWell = 5, IdWellSectionType = 2, IdCategory = 1046, IdType = 1, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 10:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 76347, IdWell = 1, IdWellSectionType = 1, IdCategory = 1048, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-26 01:00"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 51329, IdWell = 1, IdWellSectionType = 1, IdCategory = 1026, IdType = 0, WellDepth = 1400, StartDate = DateTime.Parse("2021-08-27 08:30"), DurationHours = 3.5},
|
||||
new WellOperation{ Id = 76341, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-26 11:30"), DurationHours = 3.5},
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity<TelemetryAnalysis>(entity =>
|
||||
{
|
||||
entity.HasData(new List<TelemetryAnalysis>{
|
||||
new TelemetryAnalysis
|
||||
{
|
||||
Id = 1,
|
||||
IdTelemetry = 1,
|
||||
IdOperation = 17,
|
||||
UnixDate = 1626870355,
|
||||
DurationSec = 10,
|
||||
OperationStartDepth = null,
|
||||
OperationEndDepth = 206,
|
||||
IsWellDepthIncreasing = false,
|
||||
IsWellDepthDecreasing = false,
|
||||
IsBitPositionIncreasing = false,
|
||||
IsBitPositionDecreasing = false,
|
||||
IsBitPositionLt20 = true,
|
||||
IsBlockPositionIncreasing = false,
|
||||
IsBlockPositionDecreasing = false,
|
||||
IsRotorSpeedLt3 = true,
|
||||
IsRotorSpeedGt3 = false,
|
||||
IsPressureLt20 = true,
|
||||
IsPressureGt20 = false,
|
||||
IsHookWeightNotChanges = true,
|
||||
IsHookWeightLt3 = true
|
||||
},
|
||||
new TelemetryAnalysis
|
||||
{
|
||||
Id = 2,
|
||||
IdTelemetry = 1,
|
||||
IdOperation = 8,
|
||||
UnixDate = 1626870364,
|
||||
DurationSec = 6,
|
||||
OperationStartDepth = 206,
|
||||
OperationEndDepth = 206,
|
||||
IsWellDepthIncreasing = false,
|
||||
IsWellDepthDecreasing = false,
|
||||
IsBitPositionIncreasing = true,
|
||||
IsBitPositionDecreasing = false,
|
||||
IsBitPositionLt20 = true,
|
||||
IsBlockPositionIncreasing = true,
|
||||
IsBlockPositionDecreasing = false,
|
||||
IsRotorSpeedLt3 = true,
|
||||
IsRotorSpeedGt3 = false,
|
||||
IsPressureLt20 = true,
|
||||
IsPressureGt20 = false,
|
||||
IsHookWeightNotChanges = true,
|
||||
IsHookWeightLt3 = true
|
||||
},
|
||||
new TelemetryAnalysis
|
||||
{
|
||||
Id = 3,
|
||||
IdTelemetry = 1,
|
||||
IdOperation = 10,
|
||||
UnixDate = 1626870370,
|
||||
DurationSec = 2,
|
||||
OperationStartDepth = 206,
|
||||
OperationEndDepth = 206,
|
||||
IsWellDepthIncreasing = false,
|
||||
IsWellDepthDecreasing = false,
|
||||
IsBitPositionIncreasing = false,
|
||||
IsBitPositionDecreasing = true,
|
||||
IsBitPositionLt20 = true,
|
||||
IsBlockPositionIncreasing = false,
|
||||
IsBlockPositionDecreasing = true,
|
||||
IsRotorSpeedLt3 = true,
|
||||
IsRotorSpeedGt3 = false,
|
||||
IsPressureLt20 = true,
|
||||
IsPressureGt20 = false,
|
||||
IsHookWeightNotChanges = true,
|
||||
IsHookWeightLt3 = true
|
||||
},
|
||||
new TelemetryAnalysis
|
||||
{
|
||||
Id = 4,
|
||||
IdTelemetry = 1,
|
||||
IdOperation = 17,
|
||||
UnixDate = 1626870372,
|
||||
DurationSec = 7,
|
||||
OperationStartDepth = 206,
|
||||
OperationEndDepth = 206,
|
||||
IsWellDepthIncreasing = false,
|
||||
IsWellDepthDecreasing = false,
|
||||
IsBitPositionIncreasing = false,
|
||||
IsBitPositionDecreasing = false,
|
||||
IsBitPositionLt20 = true,
|
||||
IsBlockPositionIncreasing = false,
|
||||
IsBlockPositionDecreasing = false,
|
||||
IsRotorSpeedLt3 = true,
|
||||
IsRotorSpeedGt3 = false,
|
||||
IsPressureLt20 = true,
|
||||
IsPressureGt20 = false,
|
||||
IsHookWeightNotChanges = true,
|
||||
IsHookWeightLt3 = true
|
||||
},
|
||||
new TelemetryAnalysis
|
||||
{
|
||||
Id = 5,
|
||||
IdTelemetry = 1,
|
||||
IdOperation = 8,
|
||||
UnixDate = 1626870379,
|
||||
DurationSec = 7,
|
||||
OperationStartDepth = 206,
|
||||
OperationEndDepth = 206,
|
||||
IsWellDepthIncreasing = false,
|
||||
IsWellDepthDecreasing = false,
|
||||
IsBitPositionIncreasing = true,
|
||||
IsBitPositionDecreasing = false,
|
||||
IsBitPositionLt20 = true,
|
||||
IsBlockPositionIncreasing = true,
|
||||
IsBlockPositionDecreasing = false,
|
||||
IsRotorSpeedLt3 = true,
|
||||
IsRotorSpeedGt3 = false,
|
||||
IsPressureLt20 = true,
|
||||
IsPressureGt20 = false,
|
||||
IsHookWeightNotChanges = true,
|
||||
IsHookWeightLt3 = true
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public IQueryable<Well> GetWellsForCompany(int idCompany)
|
||||
{
|
||||
return from well in Wells
|
||||
|
Loading…
Reference in New Issue
Block a user