using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace AsbCloudDb.Migrations { public partial class AddTable_t_limiting_parameter : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "t_limiting_parameter", columns: table => new { id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), id_telemetry = table.Column(type: "integer", nullable: false), date_start = table.Column(type: "timestamp with time zone", nullable: true), date_end = table.Column(type: "timestamp with time zone", nullable: true), depth_start = table.Column(type: "real", nullable: true), depth_end = table.Column(type: "real", nullable: true), id_feed_regulator = table.Column(type: "smallint", nullable: false) }, constraints: table => { table.PrimaryKey("PK_t_limiting_parameter", x => x.id); table.ForeignKey( name: "FK_t_limiting_parameter_t_telemetry_id_telemetry", column: x => x.id_telemetry, principalTable: "t_telemetry", principalColumn: "id", onDelete: ReferentialAction.Cascade); }, comment: "Ограничения по параметрам телеметрии"); migrationBuilder.CreateIndex( name: "IX_t_limiting_parameter_id_telemetry", table: "t_limiting_parameter", column: "id_telemetry"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "t_limiting_parameter"); } } }