Added User model 'email', 'phone', 'position' columns

This commit is contained in:
KharchenkoVV 2021-09-07 14:42:56 +05:00
parent 9ee6749c3c
commit 42b9849ae9
4 changed files with 2108 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,49 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace AsbCloudDb.Migrations
{
public partial class AddUserColumns : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "email",
table: "t_user",
type: "character varying(255)",
maxLength: 255,
nullable: true,
comment: "должность");
migrationBuilder.AddColumn<string>(
name: "phone",
table: "t_user",
type: "character varying(50)",
maxLength: 50,
nullable: true,
comment: "номер телефона");
migrationBuilder.AddColumn<string>(
name: "position",
table: "t_user",
type: "character varying(255)",
maxLength: 255,
nullable: true,
comment: "email");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "email",
table: "t_user");
migrationBuilder.DropColumn(
name: "phone",
table: "t_user");
migrationBuilder.DropColumn(
name: "position",
table: "t_user");
}
}
}

View File

@ -959,6 +959,12 @@ namespace AsbCloudDb.Migrations
.HasColumnName("id")
.UseIdentityByDefaultColumn();
b.Property<string>("Email")
.HasMaxLength(255)
.HasColumnType("character varying(255)")
.HasColumnName("email")
.HasComment("должность");
b.Property<int?>("IdCompany")
.HasColumnType("integer")
.HasColumnName("id_company");
@ -994,6 +1000,18 @@ namespace AsbCloudDb.Migrations
.HasColumnName("patronymic")
.HasComment("отчество");
b.Property<string>("Phone")
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("phone")
.HasComment("номер телефона");
b.Property<string>("Position")
.HasMaxLength(255)
.HasColumnType("character varying(255)")
.HasColumnName("position")
.HasComment("email");
b.Property<short?>("State")
.HasColumnType("smallint")
.HasColumnName("state")

View File

@ -47,6 +47,19 @@ namespace AsbCloudDb.Model
[StringLength(255)]
public string Patronymic { get; set; }
[Column("email"), Comment("должность")]
[StringLength(255)]
public string Email { get; set; }
[Column("phone"), Comment("номер телефона")]
[StringLength(50)]
public string Phone { get; set; }
[Column("position"), Comment("email")]
[StringLength(255)]
public string Position { get; set; }
[ForeignKey(nameof(IdCompany))]
[InverseProperty(nameof(Model.Company.Users))]
public virtual Company Company { get; set; }