diff --git a/Directory.Packages.props b/Directory.Packages.props
index 0bb4310..6a101cb 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -15,7 +15,6 @@
-
all
diff --git a/src/Pandatech.CleanArchitecture.Core/Pandatech.CleanArchitecture.Core.csproj b/src/Pandatech.CleanArchitecture.Core/Pandatech.CleanArchitecture.Core.csproj
index d134658..3c9186d 100644
--- a/src/Pandatech.CleanArchitecture.Core/Pandatech.CleanArchitecture.Core.csproj
+++ b/src/Pandatech.CleanArchitecture.Core/Pandatech.CleanArchitecture.Core.csproj
@@ -7,7 +7,6 @@
-
diff --git a/src/Pandatech.CleanArchitecture.Infrastructure/Context/PostgresContext.cs b/src/Pandatech.CleanArchitecture.Infrastructure/Context/PostgresContext.cs
index 4153ada..b022bff 100644
--- a/src/Pandatech.CleanArchitecture.Infrastructure/Context/PostgresContext.cs
+++ b/src/Pandatech.CleanArchitecture.Infrastructure/Context/PostgresContext.cs
@@ -1,12 +1,11 @@
using Hangfire.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Design;
using Pandatech.CleanArchitecture.Core.Entities;
using PandaTech.IEnumerableFilters.PostgresContext;
namespace Pandatech.CleanArchitecture.Infrastructure.Context;
-//hint for migration: dotnet ef migrations add --project src\Pandatech.CleanArchitecture.Infrastructure\Pandatech.CleanArchitecture.Infrastructure.csproj --output-dir ․/Migrations
+//hint for migration: dotnet ef migrations add --project src\Pandatech.CleanArchitecture.Infrastructure\Pandatech.CleanArchitecture.Infrastructure.csproj --context Pandatech.CleanArchitecture.Infrastructure.Context.PostgresContext --configuration Debug --output-dir ./Migrations
public class PostgresContext(DbContextOptions options) : PostgresDbContext(options)
{
public DbSet UserTokens { get; set; } = null!;
@@ -20,15 +19,3 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.ApplyConfigurationsFromAssembly(typeof(AssemblyReference).Assembly);
}
}
-
-public class PostgresContextFactory : IDesignTimeDbContextFactory
-{
- public PostgresContext CreateDbContext(string[] args)
- {
- var optionsBuilder = new DbContextOptionsBuilder();
-
- optionsBuilder.UseNpgsql().UseSnakeCaseNamingConvention();
-
- return new PostgresContext(optionsBuilder.Options);
- }
-}
diff --git a/src/Pandatech.CleanArchitecture.Infrastructure/Context/PostgresContextFactory.cs b/src/Pandatech.CleanArchitecture.Infrastructure/Context/PostgresContextFactory.cs
new file mode 100644
index 0000000..a684e6d
--- /dev/null
+++ b/src/Pandatech.CleanArchitecture.Infrastructure/Context/PostgresContextFactory.cs
@@ -0,0 +1,16 @@
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Design;
+
+namespace Pandatech.CleanArchitecture.Infrastructure.Context;
+
+public class PostgresContextFactory : IDesignTimeDbContextFactory
+{
+ public PostgresContext CreateDbContext(string[] args)
+ {
+ var optionsBuilder = new DbContextOptionsBuilder();
+
+ optionsBuilder.UseNpgsql().UseSnakeCaseNamingConvention();
+
+ return new PostgresContext(optionsBuilder.Options);
+ }
+}
diff --git a/src/Pandatech.CleanArchitecture.Infrastructure/Migrations/20240320132329_Init.Designer.cs b/src/Pandatech.CleanArchitecture.Infrastructure/Migrations/20240320132329_Init.Designer.cs
new file mode 100644
index 0000000..7375872
--- /dev/null
+++ b/src/Pandatech.CleanArchitecture.Infrastructure/Migrations/20240320132329_Init.Designer.cs
@@ -0,0 +1,556 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using Pandatech.CleanArchitecture.Infrastructure.Context;
+
+#nullable disable
+
+namespace Pandatech.CleanArchitecture.Infrastructure.Migrations
+{
+ [DbContext(typeof(PostgresContext))]
+ [Migration("20240320132329_Init")]
+ partial class Init
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.3")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireCounter", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ExpireAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expire_at");
+
+ b.Property("Key")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("key");
+
+ b.Property("Value")
+ .HasColumnType("bigint")
+ .HasColumnName("value");
+
+ b.HasKey("Id")
+ .HasName("pk_hangfire_counter");
+
+ b.HasIndex("ExpireAt")
+ .HasDatabaseName("ix_hangfire_counter_expire_at");
+
+ b.HasIndex("Key", "Value")
+ .HasDatabaseName("ix_hangfire_counter_key_value");
+
+ b.ToTable("hangfire_counter", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireHash", b =>
+ {
+ b.Property("Key")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("key");
+
+ b.Property("Field")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("field");
+
+ b.Property("ExpireAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expire_at");
+
+ b.Property("Value")
+ .HasColumnType("text")
+ .HasColumnName("value");
+
+ b.HasKey("Key", "Field")
+ .HasName("pk_hangfire_hash");
+
+ b.HasIndex("ExpireAt")
+ .HasDatabaseName("ix_hangfire_hash_expire_at");
+
+ b.ToTable("hangfire_hash", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJob", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("ExpireAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expire_at");
+
+ b.Property("InvocationData")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("invocation_data");
+
+ b.Property("StateId")
+ .HasColumnType("bigint")
+ .HasColumnName("state_id");
+
+ b.Property("StateName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("state_name");
+
+ b.HasKey("Id")
+ .HasName("pk_hangfire_job");
+
+ b.HasIndex("ExpireAt")
+ .HasDatabaseName("ix_hangfire_job_expire_at");
+
+ b.HasIndex("StateId")
+ .HasDatabaseName("ix_hangfire_job_state_id");
+
+ b.HasIndex("StateName")
+ .HasDatabaseName("ix_hangfire_job_state_name");
+
+ b.ToTable("hangfire_job", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJobParameter", b =>
+ {
+ b.Property("JobId")
+ .HasColumnType("bigint")
+ .HasColumnName("job_id");
+
+ b.Property("Name")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("name");
+
+ b.Property("Value")
+ .HasColumnType("text")
+ .HasColumnName("value");
+
+ b.HasKey("JobId", "Name")
+ .HasName("pk_hangfire_job_parameter");
+
+ b.ToTable("hangfire_job_parameter", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireList", b =>
+ {
+ b.Property("Key")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("key");
+
+ b.Property("Position")
+ .HasColumnType("integer")
+ .HasColumnName("position");
+
+ b.Property("ExpireAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expire_at");
+
+ b.Property("Value")
+ .HasColumnType("text")
+ .HasColumnName("value");
+
+ b.HasKey("Key", "Position")
+ .HasName("pk_hangfire_list");
+
+ b.HasIndex("ExpireAt")
+ .HasDatabaseName("ix_hangfire_list_expire_at");
+
+ b.ToTable("hangfire_list", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireLock", b =>
+ {
+ b.Property("Id")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("id");
+
+ b.Property("AcquiredAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("acquired_at");
+
+ b.HasKey("Id")
+ .HasName("pk_hangfire_lock");
+
+ b.ToTable("hangfire_lock", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireQueuedJob", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("FetchedAt")
+ .IsConcurrencyToken()
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("fetched_at");
+
+ b.Property("JobId")
+ .HasColumnType("bigint")
+ .HasColumnName("job_id");
+
+ b.Property("Queue")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("queue");
+
+ b.HasKey("Id")
+ .HasName("pk_hangfire_queued_job");
+
+ b.HasIndex("JobId")
+ .HasDatabaseName("ix_hangfire_queued_job_job_id");
+
+ b.HasIndex("Queue", "FetchedAt")
+ .HasDatabaseName("ix_hangfire_queued_job_queue_fetched_at");
+
+ b.ToTable("hangfire_queued_job", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireServer", b =>
+ {
+ b.Property("Id")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("id");
+
+ b.Property("Heartbeat")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("heartbeat");
+
+ b.Property("Queues")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("queues");
+
+ b.Property("StartedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("started_at");
+
+ b.Property("WorkerCount")
+ .HasColumnType("integer")
+ .HasColumnName("worker_count");
+
+ b.HasKey("Id")
+ .HasName("pk_hangfire_server");
+
+ b.HasIndex("Heartbeat")
+ .HasDatabaseName("ix_hangfire_server_heartbeat");
+
+ b.ToTable("hangfire_server", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireSet", b =>
+ {
+ b.Property("Key")
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)")
+ .HasColumnName("key");
+
+ b.Property("Value")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("value");
+
+ b.Property("ExpireAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expire_at");
+
+ b.Property("Score")
+ .HasColumnType("double precision")
+ .HasColumnName("score");
+
+ b.HasKey("Key", "Value")
+ .HasName("pk_hangfire_set");
+
+ b.HasIndex("ExpireAt")
+ .HasDatabaseName("ix_hangfire_set_expire_at");
+
+ b.HasIndex("Key", "Score")
+ .HasDatabaseName("ix_hangfire_set_key_score");
+
+ b.ToTable("hangfire_set", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("Data")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("data");
+
+ b.Property("JobId")
+ .HasColumnType("bigint")
+ .HasColumnName("job_id");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("name");
+
+ b.Property("Reason")
+ .HasColumnType("text")
+ .HasColumnName("reason");
+
+ b.HasKey("Id")
+ .HasName("pk_hangfire_state");
+
+ b.HasIndex("JobId")
+ .HasDatabaseName("ix_hangfire_state_job_id");
+
+ b.ToTable("hangfire_state", (string)null);
+ });
+
+ modelBuilder.Entity("Pandatech.CleanArchitecture.Core.Entities.UserEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Comment")
+ .HasColumnType("text")
+ .HasColumnName("comment");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("ForcePasswordChange")
+ .HasColumnType("boolean")
+ .HasColumnName("force_password_change");
+
+ b.Property("FullName")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("full_name");
+
+ b.Property("PasswordHash")
+ .IsRequired()
+ .HasColumnType("bytea")
+ .HasColumnName("password_hash");
+
+ b.Property("Role")
+ .HasColumnType("integer")
+ .HasColumnName("role");
+
+ b.Property("Status")
+ .HasColumnType("integer")
+ .HasColumnName("status");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.Property("Username")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("username");
+
+ b.HasKey("Id")
+ .HasName("pk_users");
+
+ b.HasIndex("FullName")
+ .HasDatabaseName("ix_users_full_name");
+
+ b.HasIndex("Username")
+ .IsUnique()
+ .HasDatabaseName("ix_users_username");
+
+ b.ToTable("users", (string)null);
+ });
+
+ modelBuilder.Entity("Pandatech.CleanArchitecture.Core.Entities.UserTokenEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AccessTokenExpiresAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("access_token_expires_at");
+
+ b.Property("AccessTokenHash")
+ .IsRequired()
+ .HasColumnType("bytea")
+ .HasColumnName("access_token_hash");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("InitialRefreshTokenCreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("initial_refresh_token_created_at");
+
+ b.Property("PreviousUserTokenId")
+ .HasColumnType("bigint")
+ .HasColumnName("previous_user_token_id");
+
+ b.Property("RefreshTokenExpiresAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("refresh_token_expires_at");
+
+ b.Property("RefreshTokenHash")
+ .IsRequired()
+ .HasColumnType("bytea")
+ .HasColumnName("refresh_token_hash");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.Property("UserId")
+ .HasColumnType("bigint")
+ .HasColumnName("user_id");
+
+ b.HasKey("Id")
+ .HasName("pk_user_tokens");
+
+ b.HasIndex("AccessTokenHash")
+ .IsUnique()
+ .HasDatabaseName("ix_user_tokens_access_token_hash");
+
+ b.HasIndex("PreviousUserTokenId")
+ .IsUnique()
+ .HasDatabaseName("ix_user_tokens_previous_user_token_id");
+
+ b.HasIndex("RefreshTokenHash")
+ .IsUnique()
+ .HasDatabaseName("ix_user_tokens_refresh_token_hash");
+
+ b.HasIndex("UserId")
+ .HasDatabaseName("ix_user_tokens_user_id");
+
+ b.ToTable("user_tokens", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJob", b =>
+ {
+ b.HasOne("Hangfire.EntityFrameworkCore.HangfireState", "State")
+ .WithMany()
+ .HasForeignKey("StateId")
+ .HasConstraintName("fk_hangfire_job_hangfire_state_state_id");
+
+ b.Navigation("State");
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJobParameter", b =>
+ {
+ b.HasOne("Hangfire.EntityFrameworkCore.HangfireJob", "Job")
+ .WithMany("Parameters")
+ .HasForeignKey("JobId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired()
+ .HasConstraintName("fk_hangfire_job_parameter_hangfire_job_job_id");
+
+ b.Navigation("Job");
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireQueuedJob", b =>
+ {
+ b.HasOne("Hangfire.EntityFrameworkCore.HangfireJob", "Job")
+ .WithMany("QueuedJobs")
+ .HasForeignKey("JobId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired()
+ .HasConstraintName("fk_hangfire_queued_job_hangfire_job_job_id");
+
+ b.Navigation("Job");
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireState", b =>
+ {
+ b.HasOne("Hangfire.EntityFrameworkCore.HangfireJob", "Job")
+ .WithMany("States")
+ .HasForeignKey("JobId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired()
+ .HasConstraintName("fk_hangfire_state_hangfire_job_job_id");
+
+ b.Navigation("Job");
+ });
+
+ modelBuilder.Entity("Pandatech.CleanArchitecture.Core.Entities.UserTokenEntity", b =>
+ {
+ b.HasOne("Pandatech.CleanArchitecture.Core.Entities.UserTokenEntity", "PreviousUserTokenEntity")
+ .WithOne()
+ .HasForeignKey("Pandatech.CleanArchitecture.Core.Entities.UserTokenEntity", "PreviousUserTokenId")
+ .HasConstraintName("fk_user_tokens_user_tokens_previous_user_token_id");
+
+ b.HasOne("Pandatech.CleanArchitecture.Core.Entities.UserEntity", "User")
+ .WithMany("UserTokens")
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired()
+ .HasConstraintName("fk_user_tokens_users_user_id");
+
+ b.Navigation("PreviousUserTokenEntity");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJob", b =>
+ {
+ b.Navigation("Parameters");
+
+ b.Navigation("QueuedJobs");
+
+ b.Navigation("States");
+ });
+
+ modelBuilder.Entity("Pandatech.CleanArchitecture.Core.Entities.UserEntity", b =>
+ {
+ b.Navigation("UserTokens");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/Pandatech.CleanArchitecture.Infrastructure/Migrations/20240320132329_Init.cs b/src/Pandatech.CleanArchitecture.Infrastructure/Migrations/20240320132329_Init.cs
new file mode 100644
index 0000000..b9b7a81
--- /dev/null
+++ b/src/Pandatech.CleanArchitecture.Infrastructure/Migrations/20240320132329_Init.cs
@@ -0,0 +1,383 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace Pandatech.CleanArchitecture.Infrastructure.Migrations
+{
+ ///
+ public partial class Init : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "hangfire_counter",
+ columns: table => new
+ {
+ id = table.Column(type: "bigint", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ key = table.Column(type: "character varying(256)", maxLength: 256, nullable: false),
+ value = table.Column(type: "bigint", nullable: false),
+ expire_at = table.Column(type: "timestamp with time zone", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("pk_hangfire_counter", x => x.id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "hangfire_hash",
+ columns: table => new
+ {
+ key = table.Column(type: "character varying(256)", maxLength: 256, nullable: false),
+ field = table.Column(type: "character varying(256)", maxLength: 256, nullable: false),
+ value = table.Column(type: "text", nullable: true),
+ expire_at = table.Column(type: "timestamp with time zone", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("pk_hangfire_hash", x => new { x.key, x.field });
+ });
+
+ migrationBuilder.CreateTable(
+ name: "hangfire_list",
+ columns: table => new
+ {
+ key = table.Column(type: "character varying(256)", maxLength: 256, nullable: false),
+ position = table.Column(type: "integer", nullable: false),
+ value = table.Column(type: "text", nullable: true),
+ expire_at = table.Column(type: "timestamp with time zone", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("pk_hangfire_list", x => new { x.key, x.position });
+ });
+
+ migrationBuilder.CreateTable(
+ name: "hangfire_lock",
+ columns: table => new
+ {
+ id = table.Column(type: "character varying(256)", maxLength: 256, nullable: false),
+ acquired_at = table.Column(type: "timestamp with time zone", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("pk_hangfire_lock", x => x.id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "hangfire_server",
+ columns: table => new
+ {
+ id = table.Column(type: "character varying(256)", maxLength: 256, nullable: false),
+ started_at = table.Column(type: "timestamp with time zone", nullable: false),
+ heartbeat = table.Column(type: "timestamp with time zone", nullable: false),
+ worker_count = table.Column(type: "integer", nullable: false),
+ queues = table.Column(type: "text", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("pk_hangfire_server", x => x.id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "hangfire_set",
+ columns: table => new
+ {
+ key = table.Column(type: "character varying(100)", maxLength: 100, nullable: false),
+ value = table.Column(type: "character varying(256)", maxLength: 256, nullable: false),
+ score = table.Column(type: "double precision", nullable: false),
+ expire_at = table.Column(type: "timestamp with time zone", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("pk_hangfire_set", x => new { x.key, x.value });
+ });
+
+ migrationBuilder.CreateTable(
+ name: "users",
+ columns: table => new
+ {
+ id = table.Column(type: "bigint", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ username = table.Column(type: "text", nullable: false),
+ full_name = table.Column(type: "text", nullable: false),
+ password_hash = table.Column(type: "bytea", nullable: false),
+ role = table.Column(type: "integer", nullable: false),
+ status = table.Column(type: "integer", nullable: false),
+ force_password_change = table.Column(type: "boolean", nullable: false),
+ created_at = table.Column(type: "timestamp with time zone", nullable: false),
+ updated_at = table.Column(type: "timestamp with time zone", nullable: false),
+ comment = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("pk_users", x => x.id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "user_tokens",
+ columns: table => new
+ {
+ id = table.Column(type: "bigint", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ user_id = table.Column(type: "bigint", nullable: false),
+ previous_user_token_id = table.Column(type: "bigint", nullable: true),
+ access_token_hash = table.Column(type: "bytea", nullable: false),
+ refresh_token_hash = table.Column(type: "bytea", nullable: false),
+ access_token_expires_at = table.Column(type: "timestamp with time zone", nullable: false),
+ refresh_token_expires_at = table.Column(type: "timestamp with time zone", nullable: false),
+ initial_refresh_token_created_at = table.Column(type: "timestamp with time zone", nullable: false),
+ created_at = table.Column(type: "timestamp with time zone", nullable: false),
+ updated_at = table.Column(type: "timestamp with time zone", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("pk_user_tokens", x => x.id);
+ table.ForeignKey(
+ name: "fk_user_tokens_user_tokens_previous_user_token_id",
+ column: x => x.previous_user_token_id,
+ principalTable: "user_tokens",
+ principalColumn: "id");
+ table.ForeignKey(
+ name: "fk_user_tokens_users_user_id",
+ column: x => x.user_id,
+ principalTable: "users",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "hangfire_job",
+ columns: table => new
+ {
+ id = table.Column(type: "bigint", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ created_at = table.Column(type: "timestamp with time zone", nullable: false),
+ state_id = table.Column(type: "bigint", nullable: true),
+ state_name = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
+ expire_at = table.Column(type: "timestamp with time zone", nullable: true),
+ invocation_data = table.Column(type: "text", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("pk_hangfire_job", x => x.id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "hangfire_job_parameter",
+ columns: table => new
+ {
+ job_id = table.Column(type: "bigint", nullable: false),
+ name = table.Column(type: "character varying(256)", maxLength: 256, nullable: false),
+ value = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("pk_hangfire_job_parameter", x => new { x.job_id, x.name });
+ table.ForeignKey(
+ name: "fk_hangfire_job_parameter_hangfire_job_job_id",
+ column: x => x.job_id,
+ principalTable: "hangfire_job",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "hangfire_queued_job",
+ columns: table => new
+ {
+ id = table.Column(type: "bigint", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ job_id = table.Column(type: "bigint", nullable: false),
+ queue = table.Column(type: "character varying(256)", maxLength: 256, nullable: false),
+ fetched_at = table.Column(type: "timestamp with time zone", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("pk_hangfire_queued_job", x => x.id);
+ table.ForeignKey(
+ name: "fk_hangfire_queued_job_hangfire_job_job_id",
+ column: x => x.job_id,
+ principalTable: "hangfire_job",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "hangfire_state",
+ columns: table => new
+ {
+ id = table.Column(type: "bigint", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ job_id = table.Column(type: "bigint", nullable: false),
+ name = table.Column(type: "character varying(256)", maxLength: 256, nullable: false),
+ reason = table.Column(type: "text", nullable: true),
+ created_at = table.Column(type: "timestamp with time zone", nullable: false),
+ data = table.Column(type: "text", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("pk_hangfire_state", x => x.id);
+ table.ForeignKey(
+ name: "fk_hangfire_state_hangfire_job_job_id",
+ column: x => x.job_id,
+ principalTable: "hangfire_job",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "ix_hangfire_counter_expire_at",
+ table: "hangfire_counter",
+ column: "expire_at");
+
+ migrationBuilder.CreateIndex(
+ name: "ix_hangfire_counter_key_value",
+ table: "hangfire_counter",
+ columns: new[] { "key", "value" });
+
+ migrationBuilder.CreateIndex(
+ name: "ix_hangfire_hash_expire_at",
+ table: "hangfire_hash",
+ column: "expire_at");
+
+ migrationBuilder.CreateIndex(
+ name: "ix_hangfire_job_expire_at",
+ table: "hangfire_job",
+ column: "expire_at");
+
+ migrationBuilder.CreateIndex(
+ name: "ix_hangfire_job_state_id",
+ table: "hangfire_job",
+ column: "state_id");
+
+ migrationBuilder.CreateIndex(
+ name: "ix_hangfire_job_state_name",
+ table: "hangfire_job",
+ column: "state_name");
+
+ migrationBuilder.CreateIndex(
+ name: "ix_hangfire_list_expire_at",
+ table: "hangfire_list",
+ column: "expire_at");
+
+ migrationBuilder.CreateIndex(
+ name: "ix_hangfire_queued_job_job_id",
+ table: "hangfire_queued_job",
+ column: "job_id");
+
+ migrationBuilder.CreateIndex(
+ name: "ix_hangfire_queued_job_queue_fetched_at",
+ table: "hangfire_queued_job",
+ columns: new[] { "queue", "fetched_at" });
+
+ migrationBuilder.CreateIndex(
+ name: "ix_hangfire_server_heartbeat",
+ table: "hangfire_server",
+ column: "heartbeat");
+
+ migrationBuilder.CreateIndex(
+ name: "ix_hangfire_set_expire_at",
+ table: "hangfire_set",
+ column: "expire_at");
+
+ migrationBuilder.CreateIndex(
+ name: "ix_hangfire_set_key_score",
+ table: "hangfire_set",
+ columns: new[] { "key", "score" });
+
+ migrationBuilder.CreateIndex(
+ name: "ix_hangfire_state_job_id",
+ table: "hangfire_state",
+ column: "job_id");
+
+ migrationBuilder.CreateIndex(
+ name: "ix_user_tokens_access_token_hash",
+ table: "user_tokens",
+ column: "access_token_hash",
+ unique: true);
+
+ migrationBuilder.CreateIndex(
+ name: "ix_user_tokens_previous_user_token_id",
+ table: "user_tokens",
+ column: "previous_user_token_id",
+ unique: true);
+
+ migrationBuilder.CreateIndex(
+ name: "ix_user_tokens_refresh_token_hash",
+ table: "user_tokens",
+ column: "refresh_token_hash",
+ unique: true);
+
+ migrationBuilder.CreateIndex(
+ name: "ix_user_tokens_user_id",
+ table: "user_tokens",
+ column: "user_id");
+
+ migrationBuilder.CreateIndex(
+ name: "ix_users_full_name",
+ table: "users",
+ column: "full_name");
+
+ migrationBuilder.CreateIndex(
+ name: "ix_users_username",
+ table: "users",
+ column: "username",
+ unique: true);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_hangfire_job_hangfire_state_state_id",
+ table: "hangfire_job",
+ column: "state_id",
+ principalTable: "hangfire_state",
+ principalColumn: "id");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropForeignKey(
+ name: "fk_hangfire_job_hangfire_state_state_id",
+ table: "hangfire_job");
+
+ migrationBuilder.DropTable(
+ name: "hangfire_counter");
+
+ migrationBuilder.DropTable(
+ name: "hangfire_hash");
+
+ migrationBuilder.DropTable(
+ name: "hangfire_job_parameter");
+
+ migrationBuilder.DropTable(
+ name: "hangfire_list");
+
+ migrationBuilder.DropTable(
+ name: "hangfire_lock");
+
+ migrationBuilder.DropTable(
+ name: "hangfire_queued_job");
+
+ migrationBuilder.DropTable(
+ name: "hangfire_server");
+
+ migrationBuilder.DropTable(
+ name: "hangfire_set");
+
+ migrationBuilder.DropTable(
+ name: "user_tokens");
+
+ migrationBuilder.DropTable(
+ name: "users");
+
+ migrationBuilder.DropTable(
+ name: "hangfire_state");
+
+ migrationBuilder.DropTable(
+ name: "hangfire_job");
+ }
+ }
+}
diff --git a/src/Pandatech.CleanArchitecture.Infrastructure/Migrations/PostgresContextModelSnapshot.cs b/src/Pandatech.CleanArchitecture.Infrastructure/Migrations/PostgresContextModelSnapshot.cs
new file mode 100644
index 0000000..c076564
--- /dev/null
+++ b/src/Pandatech.CleanArchitecture.Infrastructure/Migrations/PostgresContextModelSnapshot.cs
@@ -0,0 +1,553 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using Pandatech.CleanArchitecture.Infrastructure.Context;
+
+#nullable disable
+
+namespace Pandatech.CleanArchitecture.Infrastructure.Migrations
+{
+ [DbContext(typeof(PostgresContext))]
+ partial class PostgresContextModelSnapshot : ModelSnapshot
+ {
+ protected override void BuildModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.3")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireCounter", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ExpireAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expire_at");
+
+ b.Property("Key")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("key");
+
+ b.Property("Value")
+ .HasColumnType("bigint")
+ .HasColumnName("value");
+
+ b.HasKey("Id")
+ .HasName("pk_hangfire_counter");
+
+ b.HasIndex("ExpireAt")
+ .HasDatabaseName("ix_hangfire_counter_expire_at");
+
+ b.HasIndex("Key", "Value")
+ .HasDatabaseName("ix_hangfire_counter_key_value");
+
+ b.ToTable("hangfire_counter", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireHash", b =>
+ {
+ b.Property("Key")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("key");
+
+ b.Property("Field")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("field");
+
+ b.Property("ExpireAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expire_at");
+
+ b.Property("Value")
+ .HasColumnType("text")
+ .HasColumnName("value");
+
+ b.HasKey("Key", "Field")
+ .HasName("pk_hangfire_hash");
+
+ b.HasIndex("ExpireAt")
+ .HasDatabaseName("ix_hangfire_hash_expire_at");
+
+ b.ToTable("hangfire_hash", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJob", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("ExpireAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expire_at");
+
+ b.Property("InvocationData")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("invocation_data");
+
+ b.Property("StateId")
+ .HasColumnType("bigint")
+ .HasColumnName("state_id");
+
+ b.Property("StateName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("state_name");
+
+ b.HasKey("Id")
+ .HasName("pk_hangfire_job");
+
+ b.HasIndex("ExpireAt")
+ .HasDatabaseName("ix_hangfire_job_expire_at");
+
+ b.HasIndex("StateId")
+ .HasDatabaseName("ix_hangfire_job_state_id");
+
+ b.HasIndex("StateName")
+ .HasDatabaseName("ix_hangfire_job_state_name");
+
+ b.ToTable("hangfire_job", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJobParameter", b =>
+ {
+ b.Property("JobId")
+ .HasColumnType("bigint")
+ .HasColumnName("job_id");
+
+ b.Property("Name")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("name");
+
+ b.Property("Value")
+ .HasColumnType("text")
+ .HasColumnName("value");
+
+ b.HasKey("JobId", "Name")
+ .HasName("pk_hangfire_job_parameter");
+
+ b.ToTable("hangfire_job_parameter", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireList", b =>
+ {
+ b.Property("Key")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("key");
+
+ b.Property("Position")
+ .HasColumnType("integer")
+ .HasColumnName("position");
+
+ b.Property("ExpireAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expire_at");
+
+ b.Property("Value")
+ .HasColumnType("text")
+ .HasColumnName("value");
+
+ b.HasKey("Key", "Position")
+ .HasName("pk_hangfire_list");
+
+ b.HasIndex("ExpireAt")
+ .HasDatabaseName("ix_hangfire_list_expire_at");
+
+ b.ToTable("hangfire_list", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireLock", b =>
+ {
+ b.Property("Id")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("id");
+
+ b.Property("AcquiredAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("acquired_at");
+
+ b.HasKey("Id")
+ .HasName("pk_hangfire_lock");
+
+ b.ToTable("hangfire_lock", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireQueuedJob", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("FetchedAt")
+ .IsConcurrencyToken()
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("fetched_at");
+
+ b.Property("JobId")
+ .HasColumnType("bigint")
+ .HasColumnName("job_id");
+
+ b.Property("Queue")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("queue");
+
+ b.HasKey("Id")
+ .HasName("pk_hangfire_queued_job");
+
+ b.HasIndex("JobId")
+ .HasDatabaseName("ix_hangfire_queued_job_job_id");
+
+ b.HasIndex("Queue", "FetchedAt")
+ .HasDatabaseName("ix_hangfire_queued_job_queue_fetched_at");
+
+ b.ToTable("hangfire_queued_job", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireServer", b =>
+ {
+ b.Property("Id")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("id");
+
+ b.Property("Heartbeat")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("heartbeat");
+
+ b.Property("Queues")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("queues");
+
+ b.Property("StartedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("started_at");
+
+ b.Property("WorkerCount")
+ .HasColumnType("integer")
+ .HasColumnName("worker_count");
+
+ b.HasKey("Id")
+ .HasName("pk_hangfire_server");
+
+ b.HasIndex("Heartbeat")
+ .HasDatabaseName("ix_hangfire_server_heartbeat");
+
+ b.ToTable("hangfire_server", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireSet", b =>
+ {
+ b.Property("Key")
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)")
+ .HasColumnName("key");
+
+ b.Property("Value")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("value");
+
+ b.Property("ExpireAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expire_at");
+
+ b.Property("Score")
+ .HasColumnType("double precision")
+ .HasColumnName("score");
+
+ b.HasKey("Key", "Value")
+ .HasName("pk_hangfire_set");
+
+ b.HasIndex("ExpireAt")
+ .HasDatabaseName("ix_hangfire_set_expire_at");
+
+ b.HasIndex("Key", "Score")
+ .HasDatabaseName("ix_hangfire_set_key_score");
+
+ b.ToTable("hangfire_set", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("Data")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("data");
+
+ b.Property("JobId")
+ .HasColumnType("bigint")
+ .HasColumnName("job_id");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("name");
+
+ b.Property("Reason")
+ .HasColumnType("text")
+ .HasColumnName("reason");
+
+ b.HasKey("Id")
+ .HasName("pk_hangfire_state");
+
+ b.HasIndex("JobId")
+ .HasDatabaseName("ix_hangfire_state_job_id");
+
+ b.ToTable("hangfire_state", (string)null);
+ });
+
+ modelBuilder.Entity("Pandatech.CleanArchitecture.Core.Entities.UserEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Comment")
+ .HasColumnType("text")
+ .HasColumnName("comment");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("ForcePasswordChange")
+ .HasColumnType("boolean")
+ .HasColumnName("force_password_change");
+
+ b.Property("FullName")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("full_name");
+
+ b.Property("PasswordHash")
+ .IsRequired()
+ .HasColumnType("bytea")
+ .HasColumnName("password_hash");
+
+ b.Property("Role")
+ .HasColumnType("integer")
+ .HasColumnName("role");
+
+ b.Property("Status")
+ .HasColumnType("integer")
+ .HasColumnName("status");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.Property("Username")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("username");
+
+ b.HasKey("Id")
+ .HasName("pk_users");
+
+ b.HasIndex("FullName")
+ .HasDatabaseName("ix_users_full_name");
+
+ b.HasIndex("Username")
+ .IsUnique()
+ .HasDatabaseName("ix_users_username");
+
+ b.ToTable("users", (string)null);
+ });
+
+ modelBuilder.Entity("Pandatech.CleanArchitecture.Core.Entities.UserTokenEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AccessTokenExpiresAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("access_token_expires_at");
+
+ b.Property("AccessTokenHash")
+ .IsRequired()
+ .HasColumnType("bytea")
+ .HasColumnName("access_token_hash");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_at");
+
+ b.Property("InitialRefreshTokenCreatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("initial_refresh_token_created_at");
+
+ b.Property("PreviousUserTokenId")
+ .HasColumnType("bigint")
+ .HasColumnName("previous_user_token_id");
+
+ b.Property("RefreshTokenExpiresAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("refresh_token_expires_at");
+
+ b.Property("RefreshTokenHash")
+ .IsRequired()
+ .HasColumnType("bytea")
+ .HasColumnName("refresh_token_hash");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_at");
+
+ b.Property("UserId")
+ .HasColumnType("bigint")
+ .HasColumnName("user_id");
+
+ b.HasKey("Id")
+ .HasName("pk_user_tokens");
+
+ b.HasIndex("AccessTokenHash")
+ .IsUnique()
+ .HasDatabaseName("ix_user_tokens_access_token_hash");
+
+ b.HasIndex("PreviousUserTokenId")
+ .IsUnique()
+ .HasDatabaseName("ix_user_tokens_previous_user_token_id");
+
+ b.HasIndex("RefreshTokenHash")
+ .IsUnique()
+ .HasDatabaseName("ix_user_tokens_refresh_token_hash");
+
+ b.HasIndex("UserId")
+ .HasDatabaseName("ix_user_tokens_user_id");
+
+ b.ToTable("user_tokens", (string)null);
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJob", b =>
+ {
+ b.HasOne("Hangfire.EntityFrameworkCore.HangfireState", "State")
+ .WithMany()
+ .HasForeignKey("StateId")
+ .HasConstraintName("fk_hangfire_job_hangfire_state_state_id");
+
+ b.Navigation("State");
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJobParameter", b =>
+ {
+ b.HasOne("Hangfire.EntityFrameworkCore.HangfireJob", "Job")
+ .WithMany("Parameters")
+ .HasForeignKey("JobId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired()
+ .HasConstraintName("fk_hangfire_job_parameter_hangfire_job_job_id");
+
+ b.Navigation("Job");
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireQueuedJob", b =>
+ {
+ b.HasOne("Hangfire.EntityFrameworkCore.HangfireJob", "Job")
+ .WithMany("QueuedJobs")
+ .HasForeignKey("JobId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired()
+ .HasConstraintName("fk_hangfire_queued_job_hangfire_job_job_id");
+
+ b.Navigation("Job");
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireState", b =>
+ {
+ b.HasOne("Hangfire.EntityFrameworkCore.HangfireJob", "Job")
+ .WithMany("States")
+ .HasForeignKey("JobId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired()
+ .HasConstraintName("fk_hangfire_state_hangfire_job_job_id");
+
+ b.Navigation("Job");
+ });
+
+ modelBuilder.Entity("Pandatech.CleanArchitecture.Core.Entities.UserTokenEntity", b =>
+ {
+ b.HasOne("Pandatech.CleanArchitecture.Core.Entities.UserTokenEntity", "PreviousUserTokenEntity")
+ .WithOne()
+ .HasForeignKey("Pandatech.CleanArchitecture.Core.Entities.UserTokenEntity", "PreviousUserTokenId")
+ .HasConstraintName("fk_user_tokens_user_tokens_previous_user_token_id");
+
+ b.HasOne("Pandatech.CleanArchitecture.Core.Entities.UserEntity", "User")
+ .WithMany("UserTokens")
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired()
+ .HasConstraintName("fk_user_tokens_users_user_id");
+
+ b.Navigation("PreviousUserTokenEntity");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("Hangfire.EntityFrameworkCore.HangfireJob", b =>
+ {
+ b.Navigation("Parameters");
+
+ b.Navigation("QueuedJobs");
+
+ b.Navigation("States");
+ });
+
+ modelBuilder.Entity("Pandatech.CleanArchitecture.Core.Entities.UserEntity", b =>
+ {
+ b.Navigation("UserTokens");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}