Fix DB Models. Specify TypeName = "timestamp with time zone" on DateTime.

This commit is contained in:
Фролов 2021-12-27 10:53:18 +05:00
parent 46c244a7d7
commit a30c8883a5
7 changed files with 3185 additions and 8 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,94 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace AsbCloudDb.Migrations
{
public partial class Specify_type_for_datetime_props : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "date_start",
table: "t_well_operation",
type: "timestamp with time zone",
nullable: false,
comment: "Дата начала операции",
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldComment: "Дата начала операции");
migrationBuilder.AlterColumn<DateTime>(
name: "timestamp",
table: "t_measure",
type: "timestamp with time zone",
nullable: false,
comment: "время добавления",
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldComment: "время добавления");
migrationBuilder.AlterColumn<DateTime>(
name: "date_created",
table: "t_file_mark",
type: "timestamp with time zone",
nullable: false,
comment: "Дата совершенного действия",
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldComment: "Дата совершенного действия");
migrationBuilder.AlterColumn<DateTime>(
name: "last_update",
table: "t_drill_flow_chart",
type: "timestamp with time zone",
nullable: false,
comment: "Дата последнего изменения",
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldComment: "Дата последнего изменения");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "date_start",
table: "t_well_operation",
type: "timestamp without time zone",
nullable: false,
comment: "Дата начала операции",
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldComment: "Дата начала операции");
migrationBuilder.AlterColumn<DateTime>(
name: "timestamp",
table: "t_measure",
type: "timestamp without time zone",
nullable: false,
comment: "время добавления",
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldComment: "время добавления");
migrationBuilder.AlterColumn<DateTime>(
name: "date_created",
table: "t_file_mark",
type: "timestamp without time zone",
nullable: false,
comment: "Дата совершенного действия",
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldComment: "Дата совершенного действия");
migrationBuilder.AlterColumn<DateTime>(
name: "last_update",
table: "t_drill_flow_chart",
type: "timestamp without time zone",
nullable: false,
comment: "Дата последнего изменения",
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldComment: "Дата последнего изменения");
}
}
}

View File

@ -205,7 +205,7 @@ namespace AsbCloudDb.Migrations
.HasComment("Id типа операции");
b.Property<DateTime>("LastUpdate")
.HasColumnType("timestamp without time zone")
.HasColumnType("timestamp with time zone")
.HasColumnName("last_update")
.HasComment("Дата последнего изменения");
@ -548,7 +548,7 @@ namespace AsbCloudDb.Migrations
.HasComment("Комментарий");
b.Property<DateTime>("DateCreated")
.HasColumnType("timestamp without time zone")
.HasColumnType("timestamp with time zone")
.HasColumnName("date_created")
.HasComment("Дата совершенного действия");
@ -613,7 +613,7 @@ namespace AsbCloudDb.Migrations
.HasComment("Пометка удаленным");
b.Property<DateTime>("Timestamp")
.HasColumnType("timestamp without time zone")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestamp")
.HasComment("время добавления");
@ -1888,7 +1888,7 @@ namespace AsbCloudDb.Migrations
.HasComment("Комментарий");
b.Property<DateTime>("DateStart")
.HasColumnType("timestamp without time zone")
.HasColumnType("timestamp with time zone")
.HasColumnName("date_start")
.HasComment("Дата начала операции");

View File

@ -19,7 +19,7 @@ namespace AsbCloudDb.Model
[Column("id_operation_category"), Comment("Id типа операции")]
public int IdWellOperationCategory { get; set; }
[Column("last_update"), Comment("Дата последнего изменения")]
[Column("last_update", TypeName = "timestamp with time zone"), Comment("Дата последнего изменения")]
public DateTime LastUpdate { get; set; }
[Column("depth_start"), Comment("Стартовая глубина")]

View File

@ -19,7 +19,7 @@ namespace AsbCloudDb.Model
[Column("id_mark_type"), Comment("0 - Согласован")]
public int IdMarkType { get; set; }
[Column("date_created"), Comment("Дата совершенного действия")]
[Column("date_created", TypeName = "timestamp with time zone"), Comment("Дата совершенного действия")]
public DateTime DateCreated { get; set; }
[Column("id_user"), Comment("id пользователя")]

View File

@ -20,7 +20,7 @@ namespace AsbCloudDb.Model
[Column("id_category"), Comment("id категории")]
public int IdCategory { get; set; }
[Column("timestamp"), Comment("время добавления")]
[Column("timestamp", TypeName = "timestamp with time zone"), Comment("время добавления")]
public DateTime Timestamp { get; set; }
[Column("data", TypeName = "jsonb"), Comment("Данные таблицы последних данных")]

View File

@ -31,7 +31,7 @@ namespace AsbCloudDb.Model
[Column("depth_end"), Comment("Глубина после завершения операции, м")]
public double DepthEnd { get; set; }
[Column("date_start"), Comment("Дата начала операции")]
[Column("date_start", TypeName = "timestamp with time zone"), Comment("Дата начала операции")]
public DateTime DateStart { get; set; }
[Column("duration_hours"), Comment("Продолжительность, часы")]