UserSettings_rename_idUser

This commit is contained in:
ngfrolov 2022-07-28 10:37:05 +05:00
parent b7af07f995
commit 8d3a8a5885
4 changed files with 6181 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,49 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class UserSettings_rename_idUser : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_t_user_settings_t_user_idUser",
table: "t_user_settings");
migrationBuilder.RenameColumn(
name: "idUser",
table: "t_user_settings",
newName: "id_user");
migrationBuilder.AddForeignKey(
name: "FK_t_user_settings_t_user_id_user",
table: "t_user_settings",
column: "id_user",
principalTable: "t_user",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_t_user_settings_t_user_id_user",
table: "t_user_settings");
migrationBuilder.RenameColumn(
name: "id_user",
table: "t_user_settings",
newName: "idUser");
migrationBuilder.AddForeignKey(
name: "FK_t_user_settings_t_user_idUser",
table: "t_user_settings",
column: "idUser",
principalTable: "t_user",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@ -3876,7 +3876,7 @@ namespace AsbCloudDb.Migrations
{
b.Property<int>("IdUser")
.HasColumnType("integer")
.HasColumnName("idUser");
.HasColumnName("id_user");
b.Property<string>("Key")
.HasMaxLength(255)

View File

@ -9,7 +9,7 @@ namespace AsbCloudDb.Model
[Table("t_user_settings"), Comment("настройки интерфейса пользователя")]
public class UserSetting
{
[Column("idUser")]
[Column("id_user")]
public int IdUser { get; set; }
[Column("key"), Comment("Ключ настроек пользователя"), StringLength(255)]