forked from ddrilling/AsbCloudServer
55 lines
2.9 KiB
C#
55 lines
2.9 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace AsbCloudDb.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class Add_Table_DataSaubStatDrillingQuality : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "t_data_saub_stat_drilling_quality",
|
|
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, comment: "Ключ телеметрии"),
|
|
date_start = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, comment: "Дата и время начала"),
|
|
date_end = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, comment: "Дата и время окончания"),
|
|
depth_start = table.Column<double>(type: "double precision", nullable: false, comment: "Глубина забоя по стволу начальная"),
|
|
depth_end = table.Column<double>(type: "double precision", nullable: false, comment: "Глубина забоя по стволу конечная"),
|
|
id_feed_regulator = table.Column<int>(type: "integer", nullable: false, comment: "Флаг"),
|
|
depth_drilling_quality = table.Column<double>(type: "double precision", nullable: false, comment: "Качественная проходка")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_t_data_saub_stat_drilling_quality", x => x.id);
|
|
table.ForeignKey(
|
|
name: "FK_t_data_saub_stat_drilling_quality_t_telemetry_id_telemetry",
|
|
column: x => x.id_telemetry,
|
|
principalTable: "t_telemetry",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
},
|
|
comment: "Кеш-таблица для хранения данных для построения страницы \"Качество\"");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_t_data_saub_stat_drilling_quality_id_telemetry",
|
|
table: "t_data_saub_stat_drilling_quality",
|
|
column: "id_telemetry");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "t_data_saub_stat_drilling_quality");
|
|
}
|
|
}
|
|
}
|