using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace AsbCloudDb.Migrations { public partial class Add_ProcessMapWellboreDevelopment : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "t_process_map_wellbore_development", columns: table => new { id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), id_well = table.Column(type: "integer", nullable: false, comment: "Id скважины"), last_update = 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: "Окончательная глубина"), repeats = table.Column(type: "double precision", nullable: false, comment: "Количество повторений"), spin_upward = table.Column(type: "double precision", nullable: false, comment: "Вращение при движении вверх, об/мин"), spin_downward = table.Column(type: "double precision", nullable: false, comment: "Вращение при движении вниз, об/мин"), speed_upward = table.Column(type: "double precision", nullable: false, comment: "Скорость подъёма, м/ч"), speed_downward = table.Column(type: "double precision", nullable: false, comment: "Скорость спуска, м/ч"), setpoint_drags = table.Column(type: "double precision", nullable: false, comment: "Уставка зятяжки, т"), setpoint_tights = table.Column(type: "double precision", nullable: false, comment: "Уставка посадки, т"), pressure = table.Column(type: "double precision", nullable: false, comment: "Давление"), torque = table.Column(type: "double precision", nullable: false, comment: "Момент, кН м"), comment = table.Column(type: "text", nullable: true, comment: "Комментарий") }, constraints: table => { table.PrimaryKey("PK_t_process_map_wellbore_development", x => x.id); table.ForeignKey( name: "FK_t_process_map_wellbore_development_t_well_id_well", column: x => x.id_well, principalTable: "t_well", principalColumn: "id", onDelete: ReferentialAction.Cascade); }, comment: "Проработка скважины"); migrationBuilder.CreateIndex( name: "IX_t_process_map_wellbore_development_id_well", table: "t_process_map_wellbore_development", column: "id_well"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "t_process_map_wellbore_development"); } } }