edit column migration

This commit is contained in:
eugeniy_ivanov 2022-12-26 21:50:33 +05:00
parent e84d45693c
commit 50d6143366
5 changed files with 68 additions and 376 deletions

View File

@ -1,333 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class editTable_PlannedTrajectory : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "load_date",
table: "t_planned_trajectory",
newName: "update_date");
migrationBuilder.AlterColumn<double>(
name: "zenith_angle",
table: "t_planned_trajectory",
type: "double precision",
nullable: true,
comment: "Угол зенитный",
oldClrType: typeof(double),
oldType: "double precision",
oldComment: "Угол зенитный");
migrationBuilder.AlterColumn<double>(
name: "wellbore_depth",
table: "t_planned_trajectory",
type: "double precision",
nullable: true,
comment: "Глубина по стволу",
oldClrType: typeof(double),
oldType: "double precision",
oldComment: "Глубина по стволу");
migrationBuilder.AlterColumn<double>(
name: "vertical_depth",
table: "t_planned_trajectory",
type: "double precision",
nullable: true,
comment: "Глубина вертикальная",
oldClrType: typeof(double),
oldType: "double precision",
oldComment: "Глубина вертикальная");
migrationBuilder.AlterColumn<double>(
name: "spatial_intensity",
table: "t_planned_trajectory",
type: "double precision",
nullable: true,
comment: "Пространственная интенсивность",
oldClrType: typeof(double),
oldType: "double precision",
oldComment: "Пространственная интенсивность");
migrationBuilder.AlterColumn<double>(
name: "orifice_offset",
table: "t_planned_trajectory",
type: "double precision",
nullable: true,
comment: "Смещение от устья",
oldClrType: typeof(double),
oldType: "double precision",
oldComment: "Смещение от устья");
migrationBuilder.AlterColumn<double>(
name: "north_orifice",
table: "t_planned_trajectory",
type: "double precision",
nullable: true,
comment: "Север отн-но устья",
oldClrType: typeof(double),
oldType: "double precision",
oldComment: "Север отн-но устья");
migrationBuilder.AlterColumn<double>(
name: "north_cartographic",
table: "t_planned_trajectory",
type: "double precision",
nullable: true,
comment: "Север картографический",
oldClrType: typeof(double),
oldType: "double precision",
oldComment: "Север картографический");
migrationBuilder.AlterColumn<double>(
name: "east_orifice",
table: "t_planned_trajectory",
type: "double precision",
nullable: true,
comment: "Восток отн-но устья",
oldClrType: typeof(double),
oldType: "double precision",
oldComment: "Восток отн-но устья");
migrationBuilder.AlterColumn<double>(
name: "east_cartographic",
table: "t_planned_trajectory",
type: "double precision",
nullable: true,
comment: "Восток картографический",
oldClrType: typeof(double),
oldType: "double precision",
oldComment: "Восток картографический");
migrationBuilder.AlterColumn<double>(
name: "azimuth_magnetic",
table: "t_planned_trajectory",
type: "double precision",
nullable: true,
comment: "Азимут Магнитный",
oldClrType: typeof(double),
oldType: "double precision",
oldComment: "Азимут Магнитный");
migrationBuilder.AlterColumn<double>(
name: "azimuth_intensity",
table: "t_planned_trajectory",
type: "double precision",
nullable: true,
comment: "Интенсивность по азимуту",
oldClrType: typeof(double),
oldType: "double precision",
oldComment: "Интенсивность по азимуту");
migrationBuilder.AlterColumn<double>(
name: "azimuth_geo",
table: "t_planned_trajectory",
type: "double precision",
nullable: true,
comment: "Азимут Географ.",
oldClrType: typeof(double),
oldType: "double precision",
oldComment: "Азимут Географ.");
migrationBuilder.AlterColumn<double>(
name: "angle_intensity",
table: "t_planned_trajectory",
type: "double precision",
nullable: true,
comment: "Интенсивность по углу",
oldClrType: typeof(double),
oldType: "double precision",
oldComment: "Интенсивность по углу");
migrationBuilder.AlterColumn<double>(
name: "absolute_mark",
table: "t_planned_trajectory",
type: "double precision",
nullable: true,
comment: "Абсолютная отметка",
oldClrType: typeof(double),
oldType: "double precision",
oldComment: "Абсолютная отметка");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "update_date",
table: "t_planned_trajectory",
newName: "load_date");
migrationBuilder.AlterColumn<double>(
name: "zenith_angle",
table: "t_planned_trajectory",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Угол зенитный",
oldClrType: typeof(double),
oldType: "double precision",
oldNullable: true,
oldComment: "Угол зенитный");
migrationBuilder.AlterColumn<double>(
name: "wellbore_depth",
table: "t_planned_trajectory",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Глубина по стволу",
oldClrType: typeof(double),
oldType: "double precision",
oldNullable: true,
oldComment: "Глубина по стволу");
migrationBuilder.AlterColumn<double>(
name: "vertical_depth",
table: "t_planned_trajectory",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Глубина вертикальная",
oldClrType: typeof(double),
oldType: "double precision",
oldNullable: true,
oldComment: "Глубина вертикальная");
migrationBuilder.AlterColumn<double>(
name: "spatial_intensity",
table: "t_planned_trajectory",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Пространственная интенсивность",
oldClrType: typeof(double),
oldType: "double precision",
oldNullable: true,
oldComment: "Пространственная интенсивность");
migrationBuilder.AlterColumn<double>(
name: "orifice_offset",
table: "t_planned_trajectory",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Смещение от устья",
oldClrType: typeof(double),
oldType: "double precision",
oldNullable: true,
oldComment: "Смещение от устья");
migrationBuilder.AlterColumn<double>(
name: "north_orifice",
table: "t_planned_trajectory",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Север отн-но устья",
oldClrType: typeof(double),
oldType: "double precision",
oldNullable: true,
oldComment: "Север отн-но устья");
migrationBuilder.AlterColumn<double>(
name: "north_cartographic",
table: "t_planned_trajectory",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Север картографический",
oldClrType: typeof(double),
oldType: "double precision",
oldNullable: true,
oldComment: "Север картографический");
migrationBuilder.AlterColumn<double>(
name: "east_orifice",
table: "t_planned_trajectory",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Восток отн-но устья",
oldClrType: typeof(double),
oldType: "double precision",
oldNullable: true,
oldComment: "Восток отн-но устья");
migrationBuilder.AlterColumn<double>(
name: "east_cartographic",
table: "t_planned_trajectory",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Восток картографический",
oldClrType: typeof(double),
oldType: "double precision",
oldNullable: true,
oldComment: "Восток картографический");
migrationBuilder.AlterColumn<double>(
name: "azimuth_magnetic",
table: "t_planned_trajectory",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Азимут Магнитный",
oldClrType: typeof(double),
oldType: "double precision",
oldNullable: true,
oldComment: "Азимут Магнитный");
migrationBuilder.AlterColumn<double>(
name: "azimuth_intensity",
table: "t_planned_trajectory",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Интенсивность по азимуту",
oldClrType: typeof(double),
oldType: "double precision",
oldNullable: true,
oldComment: "Интенсивность по азимуту");
migrationBuilder.AlterColumn<double>(
name: "azimuth_geo",
table: "t_planned_trajectory",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Азимут Географ.",
oldClrType: typeof(double),
oldType: "double precision",
oldNullable: true,
oldComment: "Азимут Географ.");
migrationBuilder.AlterColumn<double>(
name: "angle_intensity",
table: "t_planned_trajectory",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Интенсивность по углу",
oldClrType: typeof(double),
oldType: "double precision",
oldNullable: true,
oldComment: "Интенсивность по углу");
migrationBuilder.AlterColumn<double>(
name: "absolute_mark",
table: "t_planned_trajectory",
type: "double precision",
nullable: false,
defaultValue: 0.0,
comment: "Абсолютная отметка",
oldClrType: typeof(double),
oldType: "double precision",
oldNullable: true,
oldComment: "Абсолютная отметка");
}
}
}

View File

@ -13,7 +13,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace AsbCloudDb.Migrations namespace AsbCloudDb.Migrations
{ {
[DbContext(typeof(AsbCloudDbContext))] [DbContext(typeof(AsbCloudDbContext))]
[Migration("20221226104823_editTable_PlannedTrajectory")] [Migration("20221226164803_editTable_PlannedTrajectory")]
partial class editTable_PlannedTrajectory partial class editTable_PlannedTrajectory
{ {
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -1773,27 +1773,27 @@ namespace AsbCloudDb.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<double?>("AbsoluteMark") b.Property<double>("AbsoluteMark")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("absolute_mark") .HasColumnName("absolute_mark")
.HasComment("Абсолютная отметка"); .HasComment("Абсолютная отметка");
b.Property<double?>("AngleIntensity") b.Property<double>("AngleIntensity")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("angle_intensity") .HasColumnName("angle_intensity")
.HasComment("Интенсивность по углу"); .HasComment("Интенсивность по углу");
b.Property<double?>("AzimuthGeo") b.Property<double>("AzimuthGeo")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("azimuth_geo") .HasColumnName("azimuth_geo")
.HasComment("Азимут Географ."); .HasComment("Азимут Географ.");
b.Property<double?>("AzimuthIntensity") b.Property<double>("AzimuthIntensity")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("azimuth_intensity") .HasColumnName("azimuth_intensity")
.HasComment("Интенсивность по азимуту"); .HasComment("Интенсивность по азимуту");
b.Property<double?>("AzimuthMagnetic") b.Property<double>("AzimuthMagnetic")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("azimuth_magnetic") .HasColumnName("azimuth_magnetic")
.HasComment("Азимут Магнитный"); .HasComment("Азимут Магнитный");
@ -1803,12 +1803,12 @@ namespace AsbCloudDb.Migrations
.HasColumnName("comment") .HasColumnName("comment")
.HasComment("Комментарии"); .HasComment("Комментарии");
b.Property<double?>("EastCartographic") b.Property<double>("EastCartographic")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("east_cartographic") .HasColumnName("east_cartographic")
.HasComment("Восток картографический"); .HasComment("Восток картографический");
b.Property<double?>("EastOrifice") b.Property<double>("EastOrifice")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("east_orifice") .HasColumnName("east_orifice")
.HasComment("Восток отн-но устья"); .HasComment("Восток отн-но устья");
@ -1823,22 +1823,22 @@ namespace AsbCloudDb.Migrations
.HasColumnName("id_well") .HasColumnName("id_well")
.HasComment("ID скважины"); .HasComment("ID скважины");
b.Property<double?>("NorthCartographic") b.Property<double>("NorthCartographic")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("north_cartographic") .HasColumnName("north_cartographic")
.HasComment("Север картографический"); .HasComment("Север картографический");
b.Property<double?>("NorthOrifice") b.Property<double>("NorthOrifice")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("north_orifice") .HasColumnName("north_orifice")
.HasComment("Север отн-но устья"); .HasComment("Север отн-но устья");
b.Property<double?>("OrificeOffset") b.Property<double>("OrificeOffset")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("orifice_offset") .HasColumnName("orifice_offset")
.HasComment("Смещение от устья"); .HasComment("Смещение от устья");
b.Property<double?>("SpatialIntensity") b.Property<double>("SpatialIntensity")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("spatial_intensity") .HasColumnName("spatial_intensity")
.HasComment("Пространственная интенсивность"); .HasComment("Пространственная интенсивность");
@ -1848,17 +1848,17 @@ namespace AsbCloudDb.Migrations
.HasColumnName("update_date") .HasColumnName("update_date")
.HasComment("Дата загрузки траектории"); .HasComment("Дата загрузки траектории");
b.Property<double?>("VerticalDepth") b.Property<double>("VerticalDepth")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("vertical_depth") .HasColumnName("vertical_depth")
.HasComment("Глубина вертикальная"); .HasComment("Глубина вертикальная");
b.Property<double?>("WellboreDepth") b.Property<double>("WellboreDepth")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("wellbore_depth") .HasColumnName("wellbore_depth")
.HasComment("Глубина по стволу"); .HasComment("Глубина по стволу");
b.Property<double?>("ZenithAngle") b.Property<double>("ZenithAngle")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("zenith_angle") .HasColumnName("zenith_angle")
.HasComment("Угол зенитный"); .HasComment("Угол зенитный");

View File

@ -0,0 +1,25 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class editTable_PlannedTrajectory : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "load_date",
table: "t_planned_trajectory",
newName: "update_date");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "update_date",
table: "t_planned_trajectory",
newName: "load_date");
}
}
}

View File

@ -1771,27 +1771,27 @@ namespace AsbCloudDb.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<double?>("AbsoluteMark") b.Property<double>("AbsoluteMark")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("absolute_mark") .HasColumnName("absolute_mark")
.HasComment("Абсолютная отметка"); .HasComment("Абсолютная отметка");
b.Property<double?>("AngleIntensity") b.Property<double>("AngleIntensity")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("angle_intensity") .HasColumnName("angle_intensity")
.HasComment("Интенсивность по углу"); .HasComment("Интенсивность по углу");
b.Property<double?>("AzimuthGeo") b.Property<double>("AzimuthGeo")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("azimuth_geo") .HasColumnName("azimuth_geo")
.HasComment("Азимут Географ."); .HasComment("Азимут Географ.");
b.Property<double?>("AzimuthIntensity") b.Property<double>("AzimuthIntensity")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("azimuth_intensity") .HasColumnName("azimuth_intensity")
.HasComment("Интенсивность по азимуту"); .HasComment("Интенсивность по азимуту");
b.Property<double?>("AzimuthMagnetic") b.Property<double>("AzimuthMagnetic")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("azimuth_magnetic") .HasColumnName("azimuth_magnetic")
.HasComment("Азимут Магнитный"); .HasComment("Азимут Магнитный");
@ -1801,12 +1801,12 @@ namespace AsbCloudDb.Migrations
.HasColumnName("comment") .HasColumnName("comment")
.HasComment("Комментарии"); .HasComment("Комментарии");
b.Property<double?>("EastCartographic") b.Property<double>("EastCartographic")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("east_cartographic") .HasColumnName("east_cartographic")
.HasComment("Восток картографический"); .HasComment("Восток картографический");
b.Property<double?>("EastOrifice") b.Property<double>("EastOrifice")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("east_orifice") .HasColumnName("east_orifice")
.HasComment("Восток отн-но устья"); .HasComment("Восток отн-но устья");
@ -1821,22 +1821,22 @@ namespace AsbCloudDb.Migrations
.HasColumnName("id_well") .HasColumnName("id_well")
.HasComment("ID скважины"); .HasComment("ID скважины");
b.Property<double?>("NorthCartographic") b.Property<double>("NorthCartographic")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("north_cartographic") .HasColumnName("north_cartographic")
.HasComment("Север картографический"); .HasComment("Север картографический");
b.Property<double?>("NorthOrifice") b.Property<double>("NorthOrifice")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("north_orifice") .HasColumnName("north_orifice")
.HasComment("Север отн-но устья"); .HasComment("Север отн-но устья");
b.Property<double?>("OrificeOffset") b.Property<double>("OrificeOffset")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("orifice_offset") .HasColumnName("orifice_offset")
.HasComment("Смещение от устья"); .HasComment("Смещение от устья");
b.Property<double?>("SpatialIntensity") b.Property<double>("SpatialIntensity")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("spatial_intensity") .HasColumnName("spatial_intensity")
.HasComment("Пространственная интенсивность"); .HasComment("Пространственная интенсивность");
@ -1846,17 +1846,17 @@ namespace AsbCloudDb.Migrations
.HasColumnName("update_date") .HasColumnName("update_date")
.HasComment("Дата загрузки траектории"); .HasComment("Дата загрузки траектории");
b.Property<double?>("VerticalDepth") b.Property<double>("VerticalDepth")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("vertical_depth") .HasColumnName("vertical_depth")
.HasComment("Глубина вертикальная"); .HasComment("Глубина вертикальная");
b.Property<double?>("WellboreDepth") b.Property<double>("WellboreDepth")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("wellbore_depth") .HasColumnName("wellbore_depth")
.HasComment("Глубина по стволу"); .HasComment("Глубина по стволу");
b.Property<double?>("ZenithAngle") b.Property<double>("ZenithAngle")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("zenith_angle") .HasColumnName("zenith_angle")
.HasComment("Угол зенитный"); .HasComment("Угол зенитный");

View File

@ -22,46 +22,46 @@ namespace AsbCloudDb.Model
public DateTimeOffset UpdateDate { get; set; } public DateTimeOffset UpdateDate { get; set; }
[Column("wellbore_depth"), Comment("Глубина по стволу")] [Column("wellbore_depth"), Comment("Глубина по стволу")]
public double? WellboreDepth { get; set; } public double WellboreDepth { get; set; }
[Column("zenith_angle"), Comment("Угол зенитный")] [Column("zenith_angle"), Comment("Угол зенитный")]
public double? ZenithAngle { get; set; } public double ZenithAngle { get; set; }
[Column("azimuth_geo"), Comment("Азимут Географ.")] [Column("azimuth_geo"), Comment("Азимут Географ.")]
public double? AzimuthGeo { get; set; } public double AzimuthGeo { get; set; }
[Column("azimuth_magnetic"), Comment("Азимут Магнитный")] [Column("azimuth_magnetic"), Comment("Азимут Магнитный")]
public double? AzimuthMagnetic { get; set; } public double AzimuthMagnetic { get; set; }
[Column("vertical_depth"), Comment("Глубина вертикальная")] [Column("vertical_depth"), Comment("Глубина вертикальная")]
public double? VerticalDepth { get; set; } public double VerticalDepth { get; set; }
[Column("absolute_mark"), Comment("Абсолютная отметка")] [Column("absolute_mark"), Comment("Абсолютная отметка")]
public double? AbsoluteMark { get; set; } public double AbsoluteMark { get; set; }
[Column("north_orifice"), Comment("Север отн-но устья")] [Column("north_orifice"), Comment("Север отн-но устья")]
public double? NorthOrifice { get; set; } public double NorthOrifice { get; set; }
[Column("east_orifice"), Comment("Восток отн-но устья")] [Column("east_orifice"), Comment("Восток отн-но устья")]
public double? EastOrifice { get; set; } public double EastOrifice { get; set; }
[Column("east_cartographic"), Comment("Восток картографический")] [Column("east_cartographic"), Comment("Восток картографический")]
public double? EastCartographic { get; set; } public double EastCartographic { get; set; }
[Column("north_cartographic"), Comment("Север картографический")] [Column("north_cartographic"), Comment("Север картографический")]
public double? NorthCartographic { get; set; } public double NorthCartographic { get; set; }
[Column("spatial_intensity"), Comment("Пространственная интенсивность")] [Column("spatial_intensity"), Comment("Пространственная интенсивность")]
public double? SpatialIntensity { get; set; } public double SpatialIntensity { get; set; }
[Column("angle_intensity"), Comment("Интенсивность по углу")] [Column("angle_intensity"), Comment("Интенсивность по углу")]
public double? AngleIntensity { get; set; } public double AngleIntensity { get; set; }
[Column("azimuth_intensity"), Comment("Интенсивность по азимуту")] [Column("azimuth_intensity"), Comment("Интенсивность по азимуту")]
public double? AzimuthIntensity { get; set; } public double AzimuthIntensity { get; set; }
[Column("orifice_offset"), Comment("Смещение от устья")] [Column("orifice_offset"), Comment("Смещение от устья")]
public double? OrificeOffset { get; set; } public double OrificeOffset { get; set; }
[Column("comment"), Comment("Комментарии")] [Column("comment"), Comment("Комментарии")]
public string? Comment { get; set; } public string? Comment { get; set; }