diff --git a/Identity.sln b/Identity.sln
index 15f86e9..5549e4c 100644
--- a/Identity.sln
+++ b/Identity.sln
@@ -34,7 +34,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Logitar.Identity.Infrastruc
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Logitar.Identity.Tests", "tests\Logitar.Identity.Tests\Logitar.Identity.Tests.csproj", "{D0781AC3-5827-4DAE-BBAD-481634FF3C0F}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logitar.Identity.Contracts", "src\Logitar.Identity.Contracts\Logitar.Identity.Contracts.csproj", "{0E9D9B1A-B62C-4036-91B8-6E34CAA5F938}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Logitar.Identity.Contracts", "src\Logitar.Identity.Contracts\Logitar.Identity.Contracts.csproj", "{0E9D9B1A-B62C-4036-91B8-6E34CAA5F938}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logitar.Identity.EntityFrameworkCore.PostgreSQL", "src\Logitar.Identity.EntityFrameworkCore.PostgreSQL\Logitar.Identity.EntityFrameworkCore.PostgreSQL.csproj", "{B06204BC-FE92-4C5E-9A70-25D100AB5857}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logitar.Identity.EFCore.Relational.IntegrationTests", "tests\Logitar.Identity.EFCore.Relational.IntegrationTests\Logitar.Identity.EFCore.Relational.IntegrationTests.csproj", "{5C6B80B4-D3BA-4DE0-928A-E4F5BA9529CA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logitar.Identity.EFCore.PostgreSQL.IntegrationTests", "tests\Logitar.Identity.EFCore.PostgreSQL.IntegrationTests\Logitar.Identity.EFCore.PostgreSQL.IntegrationTests.csproj", "{FBB0D3D5-0282-4E6A-9B03-144CC1347072}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -82,6 +88,18 @@ Global
{0E9D9B1A-B62C-4036-91B8-6E34CAA5F938}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E9D9B1A-B62C-4036-91B8-6E34CAA5F938}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0E9D9B1A-B62C-4036-91B8-6E34CAA5F938}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B06204BC-FE92-4C5E-9A70-25D100AB5857}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B06204BC-FE92-4C5E-9A70-25D100AB5857}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B06204BC-FE92-4C5E-9A70-25D100AB5857}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B06204BC-FE92-4C5E-9A70-25D100AB5857}.Release|Any CPU.Build.0 = Release|Any CPU
+ {5C6B80B4-D3BA-4DE0-928A-E4F5BA9529CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {5C6B80B4-D3BA-4DE0-928A-E4F5BA9529CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {5C6B80B4-D3BA-4DE0-928A-E4F5BA9529CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {5C6B80B4-D3BA-4DE0-928A-E4F5BA9529CA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FBB0D3D5-0282-4E6A-9B03-144CC1347072}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FBB0D3D5-0282-4E6A-9B03-144CC1347072}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FBB0D3D5-0282-4E6A-9B03-144CC1347072}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FBB0D3D5-0282-4E6A-9B03-144CC1347072}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -91,6 +109,8 @@ Global
{FA9AB722-026B-4842-B888-E9824568CBC1} = {BCB8A692-DF88-4E50-91A7-AD91E466559C}
{04C669C6-0B63-45A1-8F0F-16A7E7FC023E} = {BCB8A692-DF88-4E50-91A7-AD91E466559C}
{D0781AC3-5827-4DAE-BBAD-481634FF3C0F} = {BCB8A692-DF88-4E50-91A7-AD91E466559C}
+ {5C6B80B4-D3BA-4DE0-928A-E4F5BA9529CA} = {BCB8A692-DF88-4E50-91A7-AD91E466559C}
+ {FBB0D3D5-0282-4E6A-9B03-144CC1347072} = {BCB8A692-DF88-4E50-91A7-AD91E466559C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {45FD7647-C5AB-4CE1-A93C-59A73FDD2196}
diff --git a/docker-compose.yml b/docker-compose.yml
index 68e62c6..1688361 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -9,6 +9,14 @@ services:
ACCEPT_EULA: 'Y'
SA_PASSWORD: Ks875v3qctRxE6Z4
+ identity_postgres:
+ image: postgres
+ container_name: Logitar.Identity_postgres
+ ports:
+ - 5436:5432
+ environment:
+ POSTGRES_PASSWORD: zHSNLvy74Z3nUgcC
+
identity_demo:
build:
context: .
@@ -18,8 +26,9 @@ services:
depends_on:
- identity_mssql
restart: unless-stopped
+ ports:
+ - 8086:8080
environment:
ASPNETCORE_Environment: Development
+ POSTGRESQLCONNSTR_Identity: "User ID=postgres;Password=zHSNLvy74Z3nUgcC;Host=identity_postgres;Port=5432;Database=Identity;"
SQLCONNSTR_Identity: "Server=identity_mssql;Database=Identity;User Id=SA;Password=Ks875v3qctRxE6Z4;Persist Security Info=False;Encrypt=False;"
- ports:
- - 36190:8080
diff --git a/src/Logitar.Identity.Demo/DatabaseProvider.cs b/src/Logitar.Identity.Demo/DatabaseProvider.cs
new file mode 100644
index 0000000..826f75e
--- /dev/null
+++ b/src/Logitar.Identity.Demo/DatabaseProvider.cs
@@ -0,0 +1,7 @@
+namespace Logitar.Identity.Demo;
+
+internal enum DatabaseProvider
+{
+ EntityFrameworkCorePostgreSQL,
+ EntityFrameworkCoreSqlServer
+}
diff --git a/src/Logitar.Identity.Demo/DatabaseProviderNotSupportedException.cs b/src/Logitar.Identity.Demo/DatabaseProviderNotSupportedException.cs
new file mode 100644
index 0000000..25f657b
--- /dev/null
+++ b/src/Logitar.Identity.Demo/DatabaseProviderNotSupportedException.cs
@@ -0,0 +1,15 @@
+namespace Logitar.Identity.Demo;
+
+internal class DatabaseProviderNotSupportedException : NotSupportedException
+{
+ public DatabaseProvider DatabaseProvider
+ {
+ get => (DatabaseProvider)Data[nameof(DatabaseProvider)]!;
+ private set => Data[nameof(DatabaseProvider)] = value;
+ }
+
+ public DatabaseProviderNotSupportedException(DatabaseProvider databaseProvider) : base($"The database provider '{databaseProvider}' is not supported.")
+ {
+ DatabaseProvider = databaseProvider;
+ }
+}
diff --git a/src/Logitar.Identity.Demo/Logitar.Identity.Demo.csproj b/src/Logitar.Identity.Demo/Logitar.Identity.Demo.csproj
index fa7dfc1..241724a 100644
--- a/src/Logitar.Identity.Demo/Logitar.Identity.Demo.csproj
+++ b/src/Logitar.Identity.Demo/Logitar.Identity.Demo.csproj
@@ -17,6 +17,14 @@
True
+
+
+
+
+
+
+
+
all
@@ -27,6 +35,7 @@
+
diff --git a/src/Logitar.Identity.Demo/Logitar.Identity.Demo.http b/src/Logitar.Identity.Demo/Logitar.Identity.Demo.http
deleted file mode 100644
index 1fe8f03..0000000
--- a/src/Logitar.Identity.Demo/Logitar.Identity.Demo.http
+++ /dev/null
@@ -1,6 +0,0 @@
-@Logitar.Identity.Demo_HostAddress = http://localhost:5062
-
-GET {{Logitar.Identity.Demo_HostAddress}}/weatherforecast/
-Accept: application/json
-
-###
diff --git a/src/Logitar.Identity.Demo/Startup.cs b/src/Logitar.Identity.Demo/Startup.cs
index 8d63079..ae7f6be 100644
--- a/src/Logitar.Identity.Demo/Startup.cs
+++ b/src/Logitar.Identity.Demo/Startup.cs
@@ -1,4 +1,5 @@
-using Logitar.Identity.EntityFrameworkCore.SqlServer;
+using Logitar.Identity.EntityFrameworkCore.PostgreSQL;
+using Logitar.Identity.EntityFrameworkCore.SqlServer;
namespace Logitar.Identity.Demo;
@@ -26,8 +27,21 @@ public override void ConfigureServices(IServiceCollection services)
services.AddSwaggerGen();
}
- string connectionString = _configuration.GetValue("SQLCONNSTR_Identity") ?? string.Empty;
- services.AddLogitarIdentityWithEntityFrameworkCoreSqlServer(connectionString);
+ string connectionString;
+ DatabaseProvider databaseProvider = _configuration.GetValue("DatabaseProvider") ?? DatabaseProvider.EntityFrameworkCoreSqlServer;
+ switch (databaseProvider)
+ {
+ case DatabaseProvider.EntityFrameworkCorePostgreSQL:
+ connectionString = _configuration.GetValue("POSTGRESQLCONNSTR_Identity") ?? string.Empty;
+ services.AddLogitarIdentityWithEntityFrameworkCorePostgreSQL(connectionString);
+ break;
+ case DatabaseProvider.EntityFrameworkCoreSqlServer:
+ connectionString = _configuration.GetValue("SQLCONNSTR_Identity") ?? string.Empty;
+ services.AddLogitarIdentityWithEntityFrameworkCoreSqlServer(connectionString);
+ break;
+ default:
+ throw new DatabaseProviderNotSupportedException(databaseProvider);
+ }
}
public override void Configure(IApplicationBuilder builder)
diff --git a/src/Logitar.Identity.Demo/appsettings.Development.json b/src/Logitar.Identity.Demo/appsettings.Development.json
index c9e3b6e..ce253d4 100644
--- a/src/Logitar.Identity.Demo/appsettings.Development.json
+++ b/src/Logitar.Identity.Demo/appsettings.Development.json
@@ -29,5 +29,6 @@
"Microsoft.AspNetCore": "Warning"
}
},
+ "POSTGRESQLCONNSTR_Identity": "User ID=postgres;Password=zHSNLvy74Z3nUgcC;Host=host.docker.internal;Port=5436;Database=Identity;",
"SQLCONNSTR_Identity": "Server=host.docker.internal,1436;Database=Identity;User Id=SA;Password=Ks875v3qctRxE6Z4;Persist Security Info=False;Encrypt=False;"
}
diff --git a/src/Logitar.Identity.Demo/secrets.example.json b/src/Logitar.Identity.Demo/secrets.example.json
new file mode 100644
index 0000000..b3a31eb
--- /dev/null
+++ b/src/Logitar.Identity.Demo/secrets.example.json
@@ -0,0 +1,3 @@
+{
+ "DatabaseProvider": "EntityFrameworkCorePostgreSQL"
+}
\ No newline at end of file
diff --git a/src/Logitar.Identity.EntityFrameworkCore.PostgreSQL/DependencyInjectionExtensions.cs b/src/Logitar.Identity.EntityFrameworkCore.PostgreSQL/DependencyInjectionExtensions.cs
new file mode 100644
index 0000000..d7f0024
--- /dev/null
+++ b/src/Logitar.Identity.EntityFrameworkCore.PostgreSQL/DependencyInjectionExtensions.cs
@@ -0,0 +1,20 @@
+using Logitar.EventSourcing.EntityFrameworkCore.PostgreSQL;
+using Logitar.Identity.EntityFrameworkCore.Relational;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Logitar.Identity.EntityFrameworkCore.PostgreSQL;
+
+public static class DependencyInjectionExtensions
+{
+ public static IServiceCollection AddLogitarIdentityWithEntityFrameworkCorePostgreSQL(this IServiceCollection services, string connectionString)
+ {
+ return services
+ .AddDbContext(options => options.UseNpgsql(connectionString,
+ b => b.MigrationsAssembly("Logitar.Identity.EntityFrameworkCore.PostgreSQL")
+ ))
+ .AddLogitarEventSourcingWithEntityFrameworkCorePostgreSQL(connectionString)
+ .AddLogitarIdentityWithEntityFrameworkCoreRelational()
+ .AddSingleton();
+ }
+}
diff --git a/src/Logitar.Identity.EntityFrameworkCore.PostgreSQL/LICENSE b/src/Logitar.Identity.EntityFrameworkCore.PostgreSQL/LICENSE
new file mode 100644
index 0000000..0487f9b
--- /dev/null
+++ b/src/Logitar.Identity.EntityFrameworkCore.PostgreSQL/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2024 Logitar
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/src/Logitar.Identity.EntityFrameworkCore.PostgreSQL/Logitar.Identity.EntityFrameworkCore.PostgreSQL.csproj b/src/Logitar.Identity.EntityFrameworkCore.PostgreSQL/Logitar.Identity.EntityFrameworkCore.PostgreSQL.csproj
new file mode 100644
index 0000000..f6c8810
--- /dev/null
+++ b/src/Logitar.Identity.EntityFrameworkCore.PostgreSQL/Logitar.Identity.EntityFrameworkCore.PostgreSQL.csproj
@@ -0,0 +1,62 @@
+
+
+
+ net8.0
+ enable
+ enable
+ true
+ Logitar.Identity.EntityFrameworkCore.PostgreSQL
+ Francis Pion
+ Logitar
+ Logitar.Identity
+ Provides an implementation of a relational event store to be used with Identity management platform, Entity Framework Core and PostgreSQL.
+ © 2024 Logitar All Rights Reserved.
+ logitar.png
+ README.md
+ https://github.com/Logitar/Identity
+ git
+ 0.11.1.0
+ $(AssemblyVersion)
+ LICENSE
+ True
+ 0.11.1
+ en-CA
+ False
+ Updated NuGet packages.
+ logitar;net;framework;identity;entityframeworkcore;postgres
+ https://github.com/Logitar/Identity/tree/main/src/Logitar.Identity.EntityFrameworkCore.PostgreSQL
+
+
+
+ True
+
+
+
+ True
+
+
+
+
+ \
+ True
+
+
+ \
+ True
+
+
+ \
+ True
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Logitar.Identity.EntityFrameworkCore.SqlServer/Migrations/20240122000544_CreateOneTimePasswordTable.Designer.cs b/src/Logitar.Identity.EntityFrameworkCore.PostgreSQL/Migrations/20240305022651_LogitarIdentity_1_0_0.Designer.cs
similarity index 72%
rename from src/Logitar.Identity.EntityFrameworkCore.SqlServer/Migrations/20240122000544_CreateOneTimePasswordTable.Designer.cs
rename to src/Logitar.Identity.EntityFrameworkCore.PostgreSQL/Migrations/20240305022651_LogitarIdentity_1_0_0.Designer.cs
index fdf88bc..5c698bf 100644
--- a/src/Logitar.Identity.EntityFrameworkCore.SqlServer/Migrations/20240122000544_CreateOneTimePasswordTable.Designer.cs
+++ b/src/Logitar.Identity.EntityFrameworkCore.PostgreSQL/Migrations/20240305022651_LogitarIdentity_1_0_0.Designer.cs
@@ -1,19 +1,18 @@
//
-using System;
using Logitar.Identity.EntityFrameworkCore.Relational;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
-namespace Logitar.Identity.EntityFrameworkCore.SqlServer.Migrations
+namespace Logitar.Identity.EntityFrameworkCore.PostgreSQL.Migrations
{
[DbContext(typeof(IdentityContext))]
- [Migration("20240122000544_CreateOneTimePasswordTable")]
- partial class CreateOneTimePasswordTable
+ [Migration("20240305022651_LogitarIdentity_1_0_0")]
+ partial class LogitarIdentity_1_0_0
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -21,43 +20,43 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.1")
- .HasAnnotation("Relational:MaxIdentifierLength", 128);
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
- SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Logitar.Identity.EntityFrameworkCore.Relational.Entities.ActorEntity", b =>
{
b.Property("ActorId")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
+ .HasColumnType("integer");
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ActorId"));
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ActorId"));
b.Property("DisplayName")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("EmailAddress")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("Id")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("IsDeleted")
- .HasColumnType("bit");
+ .HasColumnType("boolean");
b.Property("PictureUrl")
.HasMaxLength(2048)
- .HasColumnType("nvarchar(2048)");
+ .HasColumnType("character varying(2048)");
b.Property("Type")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.HasKey("ActorId");
@@ -79,57 +78,57 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
b.Property("ApiKeyId")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
+ .HasColumnType("integer");
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ApiKeyId"));
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ApiKeyId"));
b.Property("AggregateId")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("AuthenticatedOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("CreatedBy")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("CreatedOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("CustomAttributesSerialized")
- .HasColumnType("nvarchar(max)")
+ .HasColumnType("text")
.HasColumnName("CustomAttributes");
b.Property("Description")
- .HasColumnType("nvarchar(max)");
+ .HasColumnType("text");
b.Property("DisplayName")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("ExpiresOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("SecretHash")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("TenantId")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("UpdatedBy")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("UpdatedOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("Version")
.HasColumnType("bigint");
@@ -163,10 +162,10 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
modelBuilder.Entity("Logitar.Identity.EntityFrameworkCore.Relational.Entities.ApiKeyRoleEntity", b =>
{
b.Property("ApiKeyId")
- .HasColumnType("int");
+ .HasColumnType("integer");
b.Property("RoleId")
- .HasColumnType("int");
+ .HasColumnType("integer");
b.HasKey("ApiKeyId", "RoleId");
@@ -179,17 +178,17 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
b.Property("BlacklistedTokenId")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
+ .HasColumnType("integer");
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("BlacklistedTokenId"));
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("BlacklistedTokenId"));
b.Property("ExpiresOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("TokenId")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.HasKey("BlacklistedTokenId");
@@ -205,31 +204,31 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
b.Property("CustomAttributeId")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
+ .HasColumnType("integer");
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("CustomAttributeId"));
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("CustomAttributeId"));
b.Property("EntityId")
- .HasColumnType("int");
+ .HasColumnType("integer");
b.Property("EntityType")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("Key")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("Value")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasColumnType("text");
b.Property("ValueShortened")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.HasKey("CustomAttributeId");
@@ -249,55 +248,55 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
b.Property("OneTimePasswordId")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
+ .HasColumnType("integer");
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("OneTimePasswordId"));
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("OneTimePasswordId"));
b.Property("AggregateId")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("AttemptCount")
- .HasColumnType("int");
+ .HasColumnType("integer");
b.Property("CreatedBy")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("CreatedOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("CustomAttributesSerialized")
- .HasColumnType("nvarchar(max)")
+ .HasColumnType("text")
.HasColumnName("CustomAttributes");
b.Property("ExpiresOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("HasValidationSucceeded")
- .HasColumnType("bit");
+ .HasColumnType("boolean");
b.Property("MaximumAttempts")
- .HasColumnType("int");
+ .HasColumnType("integer");
b.Property("PasswordHash")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("TenantId")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("UpdatedBy")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("UpdatedOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("Version")
.HasColumnType("bigint");
@@ -334,55 +333,55 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
b.Property("RoleId")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
+ .HasColumnType("integer");
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("RoleId"));
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("RoleId"));
b.Property("AggregateId")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("CreatedBy")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("CreatedOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("CustomAttributesSerialized")
- .HasColumnType("nvarchar(max)")
+ .HasColumnType("text")
.HasColumnName("CustomAttributes");
b.Property("Description")
- .HasColumnType("nvarchar(max)");
+ .HasColumnType("text");
b.Property("DisplayName")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("TenantId")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("UniqueName")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("UniqueNameNormalized")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("UpdatedBy")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("UpdatedOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("Version")
.HasColumnType("bigint");
@@ -409,8 +408,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
b.HasIndex("Version");
b.HasIndex("TenantId", "UniqueNameNormalized")
- .IsUnique()
- .HasFilter("[TenantId] IS NOT NULL");
+ .IsUnique();
b.ToTable("Roles", (string)null);
});
@@ -419,54 +417,54 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
b.Property("SessionId")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
+ .HasColumnType("integer");
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("SessionId"));
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("SessionId"));
b.Property("AggregateId")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("CreatedBy")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("CreatedOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("CustomAttributesSerialized")
- .HasColumnType("nvarchar(max)")
+ .HasColumnType("text")
.HasColumnName("CustomAttributes");
b.Property("IsActive")
- .HasColumnType("bit");
+ .HasColumnType("boolean");
b.Property("IsPersistent")
- .HasColumnType("bit");
+ .HasColumnType("boolean");
b.Property("SecretHash")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("SignedOutBy")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("SignedOutOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("UpdatedBy")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("UpdatedOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("UserId")
- .HasColumnType("int");
+ .HasColumnType("integer");
b.Property("Version")
.HasColumnType("bigint");
@@ -503,206 +501,206 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
b.Property("UserId")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
+ .HasColumnType("integer");
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("UserId"));
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("UserId"));
b.Property("AddressCountry")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("AddressFormatted")
.HasMaxLength(1279)
- .HasColumnType("nvarchar(1279)");
+ .HasColumnType("character varying(1279)");
b.Property("AddressLocality")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("AddressPostalCode")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("AddressRegion")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("AddressStreet")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("AddressVerifiedBy")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("AddressVerifiedOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("AggregateId")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("AuthenticatedOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("Birthdate")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("CreatedBy")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("CreatedOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("CustomAttributesSerialized")
- .HasColumnType("nvarchar(max)")
+ .HasColumnType("text")
.HasColumnName("CustomAttributes");
b.Property("DisabledBy")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("DisabledOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("EmailAddress")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("EmailAddressNormalized")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("EmailVerifiedBy")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("EmailVerifiedOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("FirstName")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("FullName")
.HasMaxLength(767)
- .HasColumnType("nvarchar(767)");
+ .HasColumnType("character varying(767)");
b.Property("Gender")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("HasPassword")
- .HasColumnType("bit");
+ .HasColumnType("boolean");
b.Property("IsAddressVerified")
- .HasColumnType("bit");
+ .HasColumnType("boolean");
b.Property("IsConfirmed")
- .HasColumnType("bit");
+ .HasColumnType("boolean");
b.Property("IsDisabled")
- .HasColumnType("bit");
+ .HasColumnType("boolean");
b.Property("IsEmailVerified")
- .HasColumnType("bit");
+ .HasColumnType("boolean");
b.Property("IsPhoneVerified")
- .HasColumnType("bit");
+ .HasColumnType("boolean");
b.Property("LastName")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("Locale")
.HasMaxLength(16)
- .HasColumnType("nvarchar(16)");
+ .HasColumnType("character varying(16)");
b.Property("MiddleName")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("Nickname")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("PasswordChangedBy")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("PasswordChangedOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("PasswordHash")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("PhoneCountryCode")
.HasMaxLength(2)
- .HasColumnType("nvarchar(2)");
+ .HasColumnType("character varying(2)");
b.Property("PhoneE164Formatted")
.HasMaxLength(40)
- .HasColumnType("nvarchar(40)");
+ .HasColumnType("character varying(40)");
b.Property("PhoneExtension")
.HasMaxLength(10)
- .HasColumnType("nvarchar(10)");
+ .HasColumnType("character varying(10)");
b.Property("PhoneNumber")
.HasMaxLength(20)
- .HasColumnType("nvarchar(20)");
+ .HasColumnType("character varying(20)");
b.Property("PhoneVerifiedBy")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("PhoneVerifiedOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("Picture")
.HasMaxLength(2048)
- .HasColumnType("nvarchar(2048)");
+ .HasColumnType("character varying(2048)");
b.Property("Profile")
.HasMaxLength(2048)
- .HasColumnType("nvarchar(2048)");
+ .HasColumnType("character varying(2048)");
b.Property("TenantId")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("TimeZone")
.HasMaxLength(32)
- .HasColumnType("nvarchar(32)");
+ .HasColumnType("character varying(32)");
b.Property("UniqueName")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("UniqueNameNormalized")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("UpdatedBy")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("UpdatedOn")
- .HasColumnType("datetime2");
+ .HasColumnType("timestamp with time zone");
b.Property("Version")
.HasColumnType("bigint");
b.Property("Website")
.HasMaxLength(2048)
- .HasColumnType("nvarchar(2048)");
+ .HasColumnType("character varying(2048)");
b.HasKey("UserId");
@@ -800,8 +798,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
b.HasIndex("TenantId", "EmailAddressNormalized");
b.HasIndex("TenantId", "UniqueNameNormalized")
- .IsUnique()
- .HasFilter("[TenantId] IS NOT NULL");
+ .IsUnique();
b.ToTable("Users", (string)null);
});
@@ -810,26 +807,26 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
b.Property("UserIdentifierId")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
+ .HasColumnType("integer");
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("UserIdentifierId"));
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("UserIdentifierId"));
b.Property("Key")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("TenantId")
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.Property("UserId")
- .HasColumnType("int");
+ .HasColumnType("integer");
b.Property("Value")
.IsRequired()
.HasMaxLength(255)
- .HasColumnType("nvarchar(255)");
+ .HasColumnType("character varying(255)");
b.HasKey("UserIdentifierId");
@@ -841,8 +838,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
.IsUnique();
b.HasIndex("TenantId", "Key", "Value")
- .IsUnique()
- .HasFilter("[TenantId] IS NOT NULL");
+ .IsUnique();
b.ToTable("UserIdentifiers", (string)null);
});
@@ -850,10 +846,10 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
modelBuilder.Entity("Logitar.Identity.EntityFrameworkCore.Relational.Entities.UserRoleEntity", b =>
{
b.Property("UserId")
- .HasColumnType("int");
+ .HasColumnType("integer");
b.Property("RoleId")
- .HasColumnType("int");
+ .HasColumnType("integer");
b.HasKey("UserId", "RoleId");
diff --git a/src/Logitar.Identity.EntityFrameworkCore.PostgreSQL/Migrations/20240305022651_LogitarIdentity_1_0_0.cs b/src/Logitar.Identity.EntityFrameworkCore.PostgreSQL/Migrations/20240305022651_LogitarIdentity_1_0_0.cs
new file mode 100644
index 0000000..632485f
--- /dev/null
+++ b/src/Logitar.Identity.EntityFrameworkCore.PostgreSQL/Migrations/20240305022651_LogitarIdentity_1_0_0.cs
@@ -0,0 +1,882 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace Logitar.Identity.EntityFrameworkCore.PostgreSQL.Migrations
+{
+ ///
+ public partial class LogitarIdentity_1_0_0 : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "Actors",
+ columns: table => new
+ {
+ ActorId = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ Id = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ Type = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ IsDeleted = table.Column(type: "boolean", nullable: false),
+ DisplayName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ EmailAddress = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ PictureUrl = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Actors", x => x.ActorId);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "ApiKeys",
+ columns: table => new
+ {
+ ApiKeyId = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ TenantId = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ SecretHash = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ DisplayName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ Description = table.Column(type: "text", nullable: true),
+ ExpiresOn = table.Column(type: "timestamp with time zone", nullable: true),
+ AuthenticatedOn = table.Column(type: "timestamp with time zone", nullable: true),
+ CustomAttributes = table.Column(type: "text", nullable: true),
+ AggregateId = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ Version = table.Column(type: "bigint", nullable: false),
+ CreatedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ CreatedOn = table.Column(type: "timestamp with time zone", nullable: false),
+ UpdatedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ UpdatedOn = table.Column(type: "timestamp with time zone", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_ApiKeys", x => x.ApiKeyId);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "CustomAttributes",
+ columns: table => new
+ {
+ CustomAttributeId = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ EntityType = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ EntityId = table.Column(type: "integer", nullable: false),
+ Key = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ Value = table.Column(type: "text", nullable: false),
+ ValueShortened = table.Column(type: "character varying(255)", maxLength: 255, nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_CustomAttributes", x => x.CustomAttributeId);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "OneTimePasswords",
+ columns: table => new
+ {
+ OneTimePasswordId = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ TenantId = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ PasswordHash = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ ExpiresOn = table.Column(type: "timestamp with time zone", nullable: true),
+ MaximumAttempts = table.Column(type: "integer", nullable: true),
+ AttemptCount = table.Column(type: "integer", nullable: false),
+ HasValidationSucceeded = table.Column(type: "boolean", nullable: false),
+ CustomAttributes = table.Column(type: "text", nullable: true),
+ AggregateId = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ Version = table.Column(type: "bigint", nullable: false),
+ CreatedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ CreatedOn = table.Column(type: "timestamp with time zone", nullable: false),
+ UpdatedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ UpdatedOn = table.Column(type: "timestamp with time zone", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_OneTimePasswords", x => x.OneTimePasswordId);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Roles",
+ columns: table => new
+ {
+ RoleId = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ TenantId = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ UniqueName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ UniqueNameNormalized = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ DisplayName = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ Description = table.Column(type: "text", nullable: true),
+ CustomAttributes = table.Column(type: "text", nullable: true),
+ AggregateId = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ Version = table.Column(type: "bigint", nullable: false),
+ CreatedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ CreatedOn = table.Column(type: "timestamp with time zone", nullable: false),
+ UpdatedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ UpdatedOn = table.Column(type: "timestamp with time zone", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Roles", x => x.RoleId);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "TokenBlacklist",
+ columns: table => new
+ {
+ BlacklistedTokenId = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ TokenId = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ ExpiresOn = table.Column(type: "timestamp with time zone", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_TokenBlacklist", x => x.BlacklistedTokenId);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Users",
+ columns: table => new
+ {
+ UserId = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ TenantId = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ UniqueName = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ UniqueNameNormalized = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
+ PasswordHash = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ PasswordChangedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ PasswordChangedOn = table.Column(type: "timestamp with time zone", nullable: true),
+ HasPassword = table.Column(type: "boolean", nullable: false),
+ DisabledBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ DisabledOn = table.Column(type: "timestamp with time zone", nullable: true),
+ IsDisabled = table.Column(type: "boolean", nullable: false),
+ AddressStreet = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ AddressLocality = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ AddressPostalCode = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ AddressRegion = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ AddressCountry = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ AddressFormatted = table.Column(type: "character varying(1279)", maxLength: 1279, nullable: true),
+ AddressVerifiedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ AddressVerifiedOn = table.Column(type: "timestamp with time zone", nullable: true),
+ IsAddressVerified = table.Column(type: "boolean", nullable: false),
+ EmailAddress = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ EmailAddressNormalized = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ EmailVerifiedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ EmailVerifiedOn = table.Column(type: "timestamp with time zone", nullable: true),
+ IsEmailVerified = table.Column(type: "boolean", nullable: false),
+ PhoneCountryCode = table.Column(type: "character varying(2)", maxLength: 2, nullable: true),
+ PhoneNumber = table.Column(type: "character varying(20)", maxLength: 20, nullable: true),
+ PhoneExtension = table.Column(type: "character varying(10)", maxLength: 10, nullable: true),
+ PhoneE164Formatted = table.Column(type: "character varying(40)", maxLength: 40, nullable: true),
+ PhoneVerifiedBy = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ PhoneVerifiedOn = table.Column(type: "timestamp with time zone", nullable: true),
+ IsPhoneVerified = table.Column(type: "boolean", nullable: false),
+ IsConfirmed = table.Column(type: "boolean", nullable: false),
+ FirstName = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ MiddleName = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ LastName = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ FullName = table.Column(type: "character varying(767)", maxLength: 767, nullable: true),
+ Nickname = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ Birthdate = table.Column(type: "timestamp with time zone", nullable: true),
+ Gender = table.Column(type: "character varying(255)", maxLength: 255, nullable: true),
+ Locale = table.Column