forked from ddrilling/AsbCloudServer
Add migration
This commit is contained in:
parent
c568fafa8f
commit
4791ab6db1
@ -1,11 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AsbCloudApp.Data
|
||||
namespace AsbCloudApp.Data
|
||||
{
|
||||
#nullable enable
|
||||
/// <summary>
|
||||
/// Описание данных для бурильщика
|
||||
/// </summary>
|
||||
@ -15,17 +10,21 @@ namespace AsbCloudApp.Data
|
||||
/// Идентификатор в БД
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Имя
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Фамилия
|
||||
/// </summary>
|
||||
public string Surname { get; set; }
|
||||
public string Surname { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Отчество
|
||||
/// </summary>
|
||||
public string Patronymic { get; set; }
|
||||
public string? Patronymic { get; set; }
|
||||
}
|
||||
#nullable disable
|
||||
}
|
||||
|
5883
AsbCloudDb/Migrations/20220531113336_Make_Driller_patronimic_nullable.Designer.cs
generated
Normal file
5883
AsbCloudDb/Migrations/20220531113336_Make_Driller_patronimic_nullable.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,41 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace AsbCloudDb.Migrations
|
||||
{
|
||||
public partial class Make_Driller_patronimic_nullable : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "patronymic",
|
||||
table: "t_driller",
|
||||
type: "character varying(255)",
|
||||
maxLength: 255,
|
||||
nullable: true,
|
||||
comment: "Отчество",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "character varying(255)",
|
||||
oldMaxLength: 255,
|
||||
oldComment: "Отчество");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "patronymic",
|
||||
table: "t_driller",
|
||||
type: "character varying(255)",
|
||||
maxLength: 255,
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
comment: "Отчество",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "character varying(255)",
|
||||
oldMaxLength: 255,
|
||||
oldNullable: true,
|
||||
oldComment: "Отчество");
|
||||
}
|
||||
}
|
||||
}
|
@ -268,7 +268,6 @@ namespace AsbCloudDb.Migrations
|
||||
.HasComment("Имя");
|
||||
|
||||
b.Property<string>("Patronymic")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("character varying(255)")
|
||||
.HasColumnName("patronymic")
|
||||
|
@ -23,7 +23,7 @@ namespace AsbCloudDb.Model
|
||||
|
||||
[Column("patronymic"), Comment("Отчество")]
|
||||
[StringLength(255)]
|
||||
public string Patronymic { get; set; } = null!;
|
||||
public string? Patronymic { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[InverseProperty(nameof(Model.Schedule.Driller))]
|
||||
|
Loading…
Reference in New Issue
Block a user