From 9e8625aea13fcf00050f0ccd01b74b0441dfde90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B0=D0=BB=D0=B8=D0=BC=D0=BE=D0=B2=20=D0=A0=D1=83?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BC?= Date: Tue, 7 Apr 2026 21:20:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B8=D0=B3=D1=80=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...260407181656_AddUserInfoFields.Designer.cs | 106 ++++++++++++++++++ .../20260407181656_AddUserInfoFields.cs | 67 +++++++++++ .../Migrations/AuthDbContextModelSnapshot.cs | 20 +++- .../SystemDbContextModelSnapshot.cs | 2 +- 4 files changed, 190 insertions(+), 5 deletions(-) create mode 100644 backend/src/Modules/Auth/Migrations/20260407181656_AddUserInfoFields.Designer.cs create mode 100644 backend/src/Modules/Auth/Migrations/20260407181656_AddUserInfoFields.cs diff --git a/backend/src/Modules/Auth/Migrations/20260407181656_AddUserInfoFields.Designer.cs b/backend/src/Modules/Auth/Migrations/20260407181656_AddUserInfoFields.Designer.cs new file mode 100644 index 0000000..9c36ea6 --- /dev/null +++ b/backend/src/Modules/Auth/Migrations/20260407181656_AddUserInfoFields.Designer.cs @@ -0,0 +1,106 @@ +// +using System; +using Knot.Modules.Auth.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Knot.Modules.Auth.Migrations +{ + [DbContext(typeof(AuthDbContext))] + [Migration("20260407181656_AddUserInfoFields")] + partial class AddUserInfoFields + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("identity") + .HasAnnotation("ProductVersion", "10.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Knot.Modules.Auth.Domain.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Avatar") + .HasColumnType("text"); + + b.Property("BannedUntil") + .HasColumnType("timestamp with time zone"); + + b.Property("Bio") + .HasColumnType("text"); + + b.Property("Birthday") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Domain") + .HasColumnType("text"); + + b.Property("Email") + .HasColumnType("text"); + + b.Property("HideStatus") + .HasColumnType("boolean"); + + b.Property("HideStoryViews") + .HasColumnType("boolean"); + + b.Property("IsBanned") + .HasColumnType("boolean"); + + b.Property("IsExternal") + .HasColumnType("boolean"); + + b.Property("IsOnline") + .HasColumnType("boolean"); + + b.Property("LastSeen") + .HasColumnType("timestamp with time zone"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("RefreshToken") + .HasColumnType("text"); + + b.Property("UserDomain") + .HasColumnType("text"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("Users", "identity"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/backend/src/Modules/Auth/Migrations/20260407181656_AddUserInfoFields.cs b/backend/src/Modules/Auth/Migrations/20260407181656_AddUserInfoFields.cs new file mode 100644 index 0000000..1d17877 --- /dev/null +++ b/backend/src/Modules/Auth/Migrations/20260407181656_AddUserInfoFields.cs @@ -0,0 +1,67 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Knot.Modules.Auth.Migrations +{ + /// + public partial class AddUserInfoFields : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "BannedUntil", + schema: "identity", + table: "Users", + type: "timestamp with time zone", + nullable: true); + + migrationBuilder.AddColumn( + name: "PhoneNumber", + schema: "identity", + table: "Users", + type: "text", + nullable: true); + + migrationBuilder.AddColumn( + name: "RefreshToken", + schema: "identity", + table: "Users", + type: "text", + nullable: true); + + migrationBuilder.AddColumn( + name: "UserDomain", + schema: "identity", + table: "Users", + type: "text", + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "BannedUntil", + schema: "identity", + table: "Users"); + + migrationBuilder.DropColumn( + name: "PhoneNumber", + schema: "identity", + table: "Users"); + + migrationBuilder.DropColumn( + name: "RefreshToken", + schema: "identity", + table: "Users"); + + migrationBuilder.DropColumn( + name: "UserDomain", + schema: "identity", + table: "Users"); + } + } +} diff --git a/backend/src/Modules/Auth/Migrations/AuthDbContextModelSnapshot.cs b/backend/src/Modules/Auth/Migrations/AuthDbContextModelSnapshot.cs index a5a9fa4..f4cc78b 100644 --- a/backend/src/Modules/Auth/Migrations/AuthDbContextModelSnapshot.cs +++ b/backend/src/Modules/Auth/Migrations/AuthDbContextModelSnapshot.cs @@ -1,4 +1,4 @@ -// +// using System; using Knot.Modules.Auth.Infrastructure.Persistence; using Microsoft.EntityFrameworkCore; @@ -23,7 +23,7 @@ namespace Knot.Modules.Auth.Migrations NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - modelBuilder.Entity("Knot.Contracts.Auth.Domain.User", b => + modelBuilder.Entity("Knot.Modules.Auth.Domain.User", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -32,6 +32,9 @@ namespace Knot.Modules.Auth.Migrations b.Property("Avatar") .HasColumnType("text"); + b.Property("BannedUntil") + .HasColumnType("timestamp with time zone"); + b.Property("Bio") .HasColumnType("text"); @@ -57,10 +60,10 @@ namespace Knot.Modules.Auth.Migrations b.Property("HideStoryViews") .HasColumnType("boolean"); - b.Property("IsExternal") + b.Property("IsBanned") .HasColumnType("boolean"); - b.Property("IsBanned") + b.Property("IsExternal") .HasColumnType("boolean"); b.Property("IsOnline") @@ -73,6 +76,15 @@ namespace Knot.Modules.Auth.Migrations .IsRequired() .HasColumnType("text"); + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("RefreshToken") + .HasColumnType("text"); + + b.Property("UserDomain") + .HasColumnType("text"); + b.Property("Username") .IsRequired() .HasMaxLength(50) diff --git a/backend/src/Shared/Knot.Shared.Infrastructure/Migrations/SystemDbContextModelSnapshot.cs b/backend/src/Shared/Knot.Shared.Infrastructure/Migrations/SystemDbContextModelSnapshot.cs index 2a52d26..4a134a5 100644 --- a/backend/src/Shared/Knot.Shared.Infrastructure/Migrations/SystemDbContextModelSnapshot.cs +++ b/backend/src/Shared/Knot.Shared.Infrastructure/Migrations/SystemDbContextModelSnapshot.cs @@ -1,4 +1,4 @@ -// +// using System; using Knot.Shared.Infrastructure.Persistence; using Microsoft.EntityFrameworkCore;