using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace AsbCloudDb.Migrations { /// public partial class Add_Table_DataSaubStatDrillingQuality : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "t_data_saub_stat_drilling_quality", columns: table => new { id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), id_telemetry = table.Column(type: "integer", nullable: false, comment: "Ключ телеметрии"), date_start = table.Column(type: "timestamp with time zone", nullable: false, comment: "Дата и время начала"), date_end = table.Column(type: "timestamp with time zone", nullable: false, comment: "Дата и время окончания"), depth_start = table.Column(type: "double precision", nullable: false, comment: "Глубина забоя по стволу начальная"), depth_end = table.Column(type: "double precision", nullable: false, comment: "Глубина забоя по стволу конечная"), id_feed_regulator = table.Column(type: "integer", nullable: false, comment: "Флаг"), depth_drilling_quality = table.Column(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"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "t_data_saub_stat_drilling_quality"); } } }