forked from ddrilling/AsbCloudServer
Added User model 'email', 'phone', 'position' columns
This commit is contained in:
parent
9ee6749c3c
commit
42b9849ae9
2028
AsbCloudDb/Migrations/20210907093457_AddUserColumns.Designer.cs
generated
Normal file
2028
AsbCloudDb/Migrations/20210907093457_AddUserColumns.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
49
AsbCloudDb/Migrations/20210907093457_AddUserColumns.cs
Normal file
49
AsbCloudDb/Migrations/20210907093457_AddUserColumns.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
@ -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")
|
||||
|
@ -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; }
|
||||
|
Loading…
Reference in New Issue
Block a user