diff --git a/apps/server/Databases/AliasServerDb/AliasServerDb.csproj b/apps/server/Databases/AliasServerDb/AliasServerDb.csproj
index b53477485..1ad0bf84b 100644
--- a/apps/server/Databases/AliasServerDb/AliasServerDb.csproj
+++ b/apps/server/Databases/AliasServerDb/AliasServerDb.csproj
@@ -26,8 +26,6 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
diff --git a/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs b/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs
index dd970eec0..097def2f0 100644
--- a/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs
+++ b/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs
@@ -11,6 +11,7 @@ using AliasVault.WorkerStatus.Database;
using Microsoft.AspNetCore.DataProtection.EntityFrameworkCore;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Microsoft.Extensions.Configuration;
///
@@ -136,6 +137,32 @@ public class AliasServerDbContext : WorkerStatusDbContext, IDataProtectionKeyCon
///
public DbSet TaskRunnerJobs { get; set; }
+ ///
+ /// Sets up the connection string if it is not already configured.
+ ///
+ /// DbContextOptionsBuilder instance.
+ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+ {
+ AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
+
+ if (optionsBuilder.IsConfigured)
+ {
+ return;
+ }
+
+ var configuration = new ConfigurationBuilder()
+ .SetBasePath(Directory.GetCurrentDirectory())
+ .AddJsonFile("appsettings.json")
+ .Build();
+
+ // Add SQLite connection with enhanced settings
+ var connectionString = configuration.GetConnectionString("AliasServerDbContext");
+
+ optionsBuilder
+ .UseNpgsql(connectionString, options => options.CommandTimeout(60))
+ .UseLazyLoadingProxies();
+ }
+
///
/// The OnModelCreating method.
///
@@ -144,19 +171,21 @@ public class AliasServerDbContext : WorkerStatusDbContext, IDataProtectionKeyCon
{
base.OnModelCreating(modelBuilder);
- // NOTE: This is a workaround for SQLite. Add conditional check if SQLite is used.
- // NOTE: SQL server doesn't need this override.
- if (Database.IsSqlite())
+ // Configure all DateTime properties to use timestamp with time zone in UTC
+ foreach (var entityType in modelBuilder.Model.GetEntityTypes())
{
- foreach (var entity in modelBuilder.Model.GetEntityTypes())
+ foreach (var property in entityType.GetProperties())
{
- foreach (var property in entity.GetProperties())
+ if (property.ClrType == typeof(DateTime) || property.ClrType == typeof(DateTime?))
{
- // SQLite does not support varchar(max) so we use TEXT.
- if (property.ClrType == typeof(string) && property.GetMaxLength() == null)
- {
- property.SetColumnType("TEXT");
- }
+ property.SetColumnType("timestamp with time zone");
+
+ // Add value converter for DateTime properties
+ var converter = new ValueConverter(
+ v => v.ToUniversalTime(),
+ v => v.ToUniversalTime());
+
+ property.SetValueConverter(converter);
}
}
}
diff --git a/apps/server/Databases/AliasServerDb/AliasServerDbContextPostgresql.cs b/apps/server/Databases/AliasServerDb/AliasServerDbContextPostgresql.cs
deleted file mode 100644
index 736569ff2..000000000
--- a/apps/server/Databases/AliasServerDb/AliasServerDbContextPostgresql.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-//-----------------------------------------------------------------------
-//
-// Copyright (c) lanedirt. All rights reserved.
-// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
-//
-//-----------------------------------------------------------------------
-
-namespace AliasServerDb;
-
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Microsoft.Extensions.Configuration;
-
-///
-/// PostgreSQL implementation of the AliasServerDbContext.
-///
-public class AliasServerDbContextPostgresql : AliasServerDbContext
-{
- ///
- /// Initializes a new instance of the class.
- ///
- public AliasServerDbContextPostgresql()
- {
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// DbContextOptions.
- public AliasServerDbContextPostgresql(DbContextOptions options)
- : base(options)
- {
- }
-
- ///
- /// Sets up the connection string if it is not already configured.
- ///
- /// DbContextOptionsBuilder instance.
- protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
- {
- AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
-
- if (optionsBuilder.IsConfigured)
- {
- return;
- }
-
- var configuration = new ConfigurationBuilder()
- .SetBasePath(Directory.GetCurrentDirectory())
- .AddJsonFile("appsettings.json")
- .Build();
-
- // Add SQLite connection with enhanced settings
- var connectionString = configuration.GetConnectionString("AliasServerDbContext");
-
- optionsBuilder
- .UseNpgsql(connectionString, options => options.CommandTimeout(60))
- .UseLazyLoadingProxies();
- }
-
- ///
- protected override void OnModelCreating(ModelBuilder modelBuilder)
- {
- base.OnModelCreating(modelBuilder);
-
- // Configure all DateTime properties to use timestamp with time zone in UTC
- foreach (var entityType in modelBuilder.Model.GetEntityTypes())
- {
- foreach (var property in entityType.GetProperties())
- {
- if (property.ClrType == typeof(DateTime) || property.ClrType == typeof(DateTime?))
- {
- property.SetColumnType("timestamp with time zone");
-
- // Add value converter for DateTime properties
- var converter = new ValueConverter(
- v => v.ToUniversalTime(),
- v => v.ToUniversalTime());
-
- property.SetValueConverter(converter);
- }
- }
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/AliasServerDbContextSqlite.cs b/apps/server/Databases/AliasServerDb/AliasServerDbContextSqlite.cs
deleted file mode 100644
index bc7937532..000000000
--- a/apps/server/Databases/AliasServerDb/AliasServerDbContextSqlite.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-//-----------------------------------------------------------------------
-//
-// Copyright (c) lanedirt. All rights reserved.
-// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
-//
-//-----------------------------------------------------------------------
-
-namespace AliasServerDb;
-
-using Microsoft.EntityFrameworkCore;
-using Microsoft.Extensions.Configuration;
-
-///
-/// SQLite implementation of the AliasServerDbContext.
-///
-public class AliasServerDbContextSqlite : AliasServerDbContext
-{
- ///
- /// Initializes a new instance of the class.
- ///
- public AliasServerDbContextSqlite()
- {
- SetPragmaSettings();
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// DbContextOptions.
- public AliasServerDbContextSqlite(DbContextOptions options)
- : base(options)
- {
- SetPragmaSettings();
- }
-
- ///
- /// The OnModelCreating method.
- ///
- /// ModelBuilder instance.
- protected override void OnModelCreating(ModelBuilder modelBuilder)
- {
- base.OnModelCreating(modelBuilder);
-
- // Set TEXT as default column type for string properties because
- // SQLite does not support varchar(max).
- foreach (var entity in modelBuilder.Model.GetEntityTypes())
- {
- foreach (var property in entity.GetProperties())
- {
- // SQLite does not support varchar(max) so we use TEXT.
- if (property.ClrType == typeof(string) && property.GetMaxLength() == null)
- {
- property.SetColumnType("TEXT");
- }
- }
- }
- }
-
- ///
- /// Sets up the connection string if it is not already configured.
- ///
- /// DbContextOptionsBuilder instance.
- protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
- {
- if (optionsBuilder.IsConfigured)
- {
- return;
- }
-
- var configuration = new ConfigurationBuilder()
- .SetBasePath(Directory.GetCurrentDirectory())
- .AddJsonFile("appsettings.json")
- .Build();
-
- // Add SQLite connection with enhanced settings
- var connectionString = configuration.GetConnectionString("AliasServerDbContext") +
- ";Mode=ReadWriteCreate;Cache=Shared";
-
- optionsBuilder
- .UseSqlite(connectionString, options => options.CommandTimeout(60))
- .UseLazyLoadingProxies();
- }
-
- ///
- /// Sets up the PRAGMA settings for SQLite.
- ///
- private void SetPragmaSettings()
- {
- var connection = Database.GetDbConnection();
- if (connection.State != System.Data.ConnectionState.Open)
- {
- connection.Open();
- }
-
- using (var command = connection.CreateCommand())
- {
- // Increase busy timeout
- command.CommandText = @"
- PRAGMA busy_timeout = 30000;
- PRAGMA journal_mode = WAL;
- PRAGMA synchronous = NORMAL;
- PRAGMA temp_store = MEMORY;
- PRAGMA mmap_size = 1073741824;";
- command.ExecuteNonQuery();
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Configuration/DatabaseConfiguration.cs b/apps/server/Databases/AliasServerDb/Configuration/DatabaseConfiguration.cs
index 728ab4ed6..609aaaca5 100644
--- a/apps/server/Databases/AliasServerDb/Configuration/DatabaseConfiguration.cs
+++ b/apps/server/Databases/AliasServerDb/Configuration/DatabaseConfiguration.cs
@@ -47,15 +47,9 @@ public static class DatabaseConfiguration
}
// Add custom DbContextFactory registration which supports multiple database providers
- switch (dbProvider)
- {
- case "postgresql":
- services.AddSingleton();
- break;
- default:
- services.AddSingleton();
- break;
- }
+ // NOTE: previously we looked at the "dbProvider" flag for which factory to initiate,
+ // but as we dropped support for SQLite we now just have this one database provider.
+ services.AddSingleton();
// Updated DbContextFactory registration
services.AddDbContextFactory((sp, options) =>
diff --git a/apps/server/Databases/AliasServerDb/IAliasServerDbContextFactory.cs b/apps/server/Databases/AliasServerDb/IAliasServerDbContextFactory.cs
index eb1522097..1b001b4b9 100644
--- a/apps/server/Databases/AliasServerDb/IAliasServerDbContextFactory.cs
+++ b/apps/server/Databases/AliasServerDb/IAliasServerDbContextFactory.cs
@@ -10,7 +10,11 @@ namespace AliasServerDb;
using Microsoft.EntityFrameworkCore;
///
-/// The AliasServerDbContextFactory interface.
+/// The AliasServerDbContextFactory interface. This factory was primarily created to support the migration window
+/// from SQLite to PostgreSQL (where both were supported). Currently only PostgreSQL is supported, so this factory
+/// simply creates an instance of the now default AliasServerDbContext. This factory pattern has therefore became
+/// optional and does not actually has any benefits vs. just creating the DbContext directly. But we kept it for
+/// now as all clients already use this factory pattern.
///
public interface IAliasServerDbContextFactory
{
diff --git a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20241225220047_InitialMigration.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20241225220047_InitialMigration.Designer.cs
similarity index 99%
rename from apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20241225220047_InitialMigration.Designer.cs
rename to apps/server/Databases/AliasServerDb/Migrations/20241225220047_InitialMigration.Designer.cs
index d53285c3f..8654d65b9 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20241225220047_InitialMigration.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20241225220047_InitialMigration.Designer.cs
@@ -9,9 +9,9 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
-namespace AliasServerDb.Migrations.PostgresqlMigrations
+namespace AliasServerDb.Migrations
{
- [DbContext(typeof(AliasServerDbContextPostgresql))]
+ [DbContext(typeof(AliasServerDbContext))]
[Migration("20241225220047_InitialMigration")]
partial class InitialMigration
{
diff --git a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20241225220047_InitialMigration.cs b/apps/server/Databases/AliasServerDb/Migrations/20241225220047_InitialMigration.cs
similarity index 99%
rename from apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20241225220047_InitialMigration.cs
rename to apps/server/Databases/AliasServerDb/Migrations/20241225220047_InitialMigration.cs
index f796a0194..2bfc895b1 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20241225220047_InitialMigration.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20241225220047_InitialMigration.cs
@@ -5,7 +5,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
-namespace AliasServerDb.Migrations.PostgresqlMigrations
+namespace AliasServerDb.Migrations
{
///
public partial class InitialMigration : Migration
diff --git a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250210101233_AddAuthLogClientHeader.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20250210101233_AddAuthLogClientHeader.Designer.cs
similarity index 99%
rename from apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250210101233_AddAuthLogClientHeader.Designer.cs
rename to apps/server/Databases/AliasServerDb/Migrations/20250210101233_AddAuthLogClientHeader.Designer.cs
index 51419bf46..753cdb1dd 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250210101233_AddAuthLogClientHeader.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20250210101233_AddAuthLogClientHeader.Designer.cs
@@ -9,9 +9,9 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
-namespace AliasServerDb.Migrations.PostgresqlMigrations
+namespace AliasServerDb.Migrations
{
- [DbContext(typeof(AliasServerDbContextPostgresql))]
+ [DbContext(typeof(AliasServerDbContext))]
[Migration("20250210101233_AddAuthLogClientHeader")]
partial class AddAuthLogClientHeader
{
diff --git a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250210101233_AddAuthLogClientHeader.cs b/apps/server/Databases/AliasServerDb/Migrations/20250210101233_AddAuthLogClientHeader.cs
similarity index 93%
rename from apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250210101233_AddAuthLogClientHeader.cs
rename to apps/server/Databases/AliasServerDb/Migrations/20250210101233_AddAuthLogClientHeader.cs
index 755956e9c..fb7cacb06 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250210101233_AddAuthLogClientHeader.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20250210101233_AddAuthLogClientHeader.cs
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
-namespace AliasServerDb.Migrations.PostgresqlMigrations
+namespace AliasServerDb.Migrations
{
///
public partial class AddAuthLogClientHeader : Migration
diff --git a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250210122648_AddVaultClientColumn.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20250210122648_AddVaultClientColumn.Designer.cs
similarity index 99%
rename from apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250210122648_AddVaultClientColumn.Designer.cs
rename to apps/server/Databases/AliasServerDb/Migrations/20250210122648_AddVaultClientColumn.Designer.cs
index 479b442da..e14ede642 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250210122648_AddVaultClientColumn.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20250210122648_AddVaultClientColumn.Designer.cs
@@ -9,9 +9,9 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
-namespace AliasServerDb.Migrations.PostgresqlMigrations
+namespace AliasServerDb.Migrations
{
- [DbContext(typeof(AliasServerDbContextPostgresql))]
+ [DbContext(typeof(AliasServerDbContext))]
[Migration("20250210122648_AddVaultClientColumn")]
partial class AddVaultClientColumn
{
diff --git a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250210122648_AddVaultClientColumn.cs b/apps/server/Databases/AliasServerDb/Migrations/20250210122648_AddVaultClientColumn.cs
similarity index 93%
rename from apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250210122648_AddVaultClientColumn.cs
rename to apps/server/Databases/AliasServerDb/Migrations/20250210122648_AddVaultClientColumn.cs
index 5f4b8d696..7b2d0c325 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250210122648_AddVaultClientColumn.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20250210122648_AddVaultClientColumn.cs
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
-namespace AliasServerDb.Migrations.PostgresqlMigrations
+namespace AliasServerDb.Migrations
{
///
public partial class AddVaultClientColumn : Migration
diff --git a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250320101427_AddEmailClaimDisabledFlag.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20250320101427_AddEmailClaimDisabledFlag.Designer.cs
similarity index 99%
rename from apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250320101427_AddEmailClaimDisabledFlag.Designer.cs
rename to apps/server/Databases/AliasServerDb/Migrations/20250320101427_AddEmailClaimDisabledFlag.Designer.cs
index 029eaa0b9..7e3e9c082 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250320101427_AddEmailClaimDisabledFlag.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20250320101427_AddEmailClaimDisabledFlag.Designer.cs
@@ -9,9 +9,9 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
-namespace AliasServerDb.Migrations.PostgresqlMigrations
+namespace AliasServerDb.Migrations
{
- [DbContext(typeof(AliasServerDbContextPostgresql))]
+ [DbContext(typeof(AliasServerDbContext))]
[Migration("20250320101427_AddEmailClaimDisabledFlag")]
partial class AddEmailClaimDisabledFlag
{
diff --git a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250320101427_AddEmailClaimDisabledFlag.cs b/apps/server/Databases/AliasServerDb/Migrations/20250320101427_AddEmailClaimDisabledFlag.cs
similarity index 93%
rename from apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250320101427_AddEmailClaimDisabledFlag.cs
rename to apps/server/Databases/AliasServerDb/Migrations/20250320101427_AddEmailClaimDisabledFlag.cs
index 65517ce8c..6c556c962 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/20250320101427_AddEmailClaimDisabledFlag.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20250320101427_AddEmailClaimDisabledFlag.cs
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
-namespace AliasServerDb.Migrations.PostgresqlMigrations
+namespace AliasServerDb.Migrations
{
///
public partial class AddEmailClaimDisabledFlag : Migration
diff --git a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/AliasServerDbContextPostgresqlModelSnapshot.cs b/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextPostgresqlModelSnapshot.cs
similarity index 99%
rename from apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/AliasServerDbContextPostgresqlModelSnapshot.cs
rename to apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextPostgresqlModelSnapshot.cs
index 5885af7bc..75f1e071f 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/PostgresqlMigrations/AliasServerDbContextPostgresqlModelSnapshot.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextPostgresqlModelSnapshot.cs
@@ -8,10 +8,10 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
-namespace AliasServerDb.Migrations.PostgresqlMigrations
+namespace AliasServerDb.Migrations
{
- [DbContext(typeof(AliasServerDbContextPostgresql))]
- partial class AliasServerDbContextPostgresqlModelSnapshot : ModelSnapshot
+ [DbContext(typeof(AliasServerDbContext))]
+ partial class AliasServerDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240526135300_InitialMigration.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240526135300_InitialMigration.Designer.cs
deleted file mode 100644
index aab7ff0b6..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240526135300_InitialMigration.Designer.cs
+++ /dev/null
@@ -1,272 +0,0 @@
-//
-using System;
-using AliasServerDb;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- [DbContext(typeof(AliasServerDbContextSqlite))]
- [Migration("20240526135300_InitialMigration")]
- partial class InitialMigration
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.5")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property("Id")
- .HasColumnType("TEXT");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property("Name")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property("NormalizedName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex");
-
- b.ToTable("AspNetRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property("RoleId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
- {
- b.Property("Id")
- .HasColumnType("TEXT");
-
- b.Property("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property("Email")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property("UserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
-
- b.ToTable("AspNetUsers", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.Property("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.Property("UserId")
- .HasColumnType("TEXT");
-
- b.Property("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.Property("UserId")
- .HasColumnType("TEXT");
-
- b.Property("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property("Name")
- .HasColumnType("TEXT");
-
- b.Property("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240526135300_InitialMigration.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240526135300_InitialMigration.cs
deleted file mode 100644
index 5bf7dbdcc..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240526135300_InitialMigration.cs
+++ /dev/null
@@ -1,223 +0,0 @@
-//
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- ///
- public partial class InitialMigration : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "AspNetRoles",
- columns: table => new
- {
- Id = table.Column(type: "TEXT", nullable: false),
- Name = table.Column(type: "TEXT", maxLength: 256, nullable: true),
- NormalizedName = table.Column(type: "TEXT", maxLength: 256, nullable: true),
- ConcurrencyStamp = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetRoles", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUsers",
- columns: table => new
- {
- Id = table.Column(type: "TEXT", nullable: false),
- UserName = table.Column(type: "TEXT", maxLength: 256, nullable: true),
- NormalizedUserName = table.Column(type: "TEXT", maxLength: 256, nullable: true),
- Email = table.Column(type: "TEXT", maxLength: 256, nullable: true),
- NormalizedEmail = table.Column(type: "TEXT", maxLength: 256, nullable: true),
- EmailConfirmed = table.Column(type: "INTEGER", nullable: false),
- PasswordHash = table.Column(type: "TEXT", nullable: true),
- SecurityStamp = table.Column(type: "TEXT", nullable: true),
- ConcurrencyStamp = table.Column(type: "TEXT", nullable: true),
- PhoneNumber = table.Column(type: "TEXT", nullable: true),
- PhoneNumberConfirmed = table.Column(type: "INTEGER", nullable: false),
- TwoFactorEnabled = table.Column(type: "INTEGER", nullable: false),
- LockoutEnd = table.Column(type: "TEXT", nullable: true),
- LockoutEnabled = table.Column(type: "INTEGER", nullable: false),
- AccessFailedCount = table.Column(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUsers", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetRoleClaims",
- columns: table => new
- {
- Id = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- RoleId = table.Column(type: "TEXT", nullable: false),
- ClaimType = table.Column(type: "TEXT", nullable: true),
- ClaimValue = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
- table.ForeignKey(
- name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
- column: x => x.RoleId,
- principalTable: "AspNetRoles",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUserClaims",
- columns: table => new
- {
- Id = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- UserId = table.Column(type: "TEXT", nullable: false),
- ClaimType = table.Column(type: "TEXT", nullable: true),
- ClaimValue = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
- table.ForeignKey(
- name: "FK_AspNetUserClaims_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUserLogins",
- columns: table => new
- {
- LoginProvider = table.Column(type: "TEXT", nullable: false),
- ProviderKey = table.Column(type: "TEXT", nullable: false),
- ProviderDisplayName = table.Column(type: "TEXT", nullable: true),
- UserId = table.Column(type: "TEXT", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
- table.ForeignKey(
- name: "FK_AspNetUserLogins_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUserRoles",
- columns: table => new
- {
- UserId = table.Column(type: "TEXT", nullable: false),
- RoleId = table.Column(type: "TEXT", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
- table.ForeignKey(
- name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
- column: x => x.RoleId,
- principalTable: "AspNetRoles",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_AspNetUserRoles_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUserTokens",
- columns: table => new
- {
- UserId = table.Column(type: "TEXT", nullable: false),
- LoginProvider = table.Column(type: "TEXT", nullable: false),
- Name = table.Column(type: "TEXT", nullable: false),
- Value = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
- table.ForeignKey(
- name: "FK_AspNetUserTokens_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetRoleClaims_RoleId",
- table: "AspNetRoleClaims",
- column: "RoleId");
-
- migrationBuilder.CreateIndex(
- name: "RoleNameIndex",
- table: "AspNetRoles",
- column: "NormalizedName",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetUserClaims_UserId",
- table: "AspNetUserClaims",
- column: "UserId");
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetUserLogins_UserId",
- table: "AspNetUserLogins",
- column: "UserId");
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetUserRoles_RoleId",
- table: "AspNetUserRoles",
- column: "RoleId");
-
- migrationBuilder.CreateIndex(
- name: "EmailIndex",
- table: "AspNetUsers",
- column: "NormalizedEmail");
-
- migrationBuilder.CreateIndex(
- name: "UserNameIndex",
- table: "AspNetUsers",
- column: "NormalizedUserName",
- unique: true);
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "AspNetRoleClaims");
-
- migrationBuilder.DropTable(
- name: "AspNetUserClaims");
-
- migrationBuilder.DropTable(
- name: "AspNetUserLogins");
-
- migrationBuilder.DropTable(
- name: "AspNetUserRoles");
-
- migrationBuilder.DropTable(
- name: "AspNetUserTokens");
-
- migrationBuilder.DropTable(
- name: "AspNetRoles");
-
- migrationBuilder.DropTable(
- name: "AspNetUsers");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240527082514_BasicEntities.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240527082514_BasicEntities.Designer.cs
deleted file mode 100644
index 860dc61b7..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240527082514_BasicEntities.Designer.cs
+++ /dev/null
@@ -1,467 +0,0 @@
-//
-using System;
-using AliasServerDb;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- [DbContext(typeof(AliasServerDbContextSqlite))]
- [Migration("20240527082514_BasicEntities")]
- partial class BasicEntities
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.5")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.Identity", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property("AddressCity")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("AddressCountry")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("AddressState")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("AddressStreet")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("AddressZipCode")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("BankAccountIBAN")
- .HasColumnType("TEXT");
-
- b.Property("BirthDate")
- .HasColumnType("TEXT");
-
- b.Property("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property("DefaultPasswordId")
- .HasColumnType("TEXT");
-
- b.Property("EmailPrefix")
- .HasColumnType("TEXT");
-
- b.Property("FirstName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("Gender")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("Hobbies")
- .HasColumnType("TEXT");
-
- b.Property("LastName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("NickName")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("PhoneMobile")
- .HasColumnType("TEXT");
-
- b.Property("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("DefaultPasswordId");
-
- b.ToTable("Identities");
- });
-
- modelBuilder.Entity("AliasServerDb.Login", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property("Description")
- .HasColumnType("TEXT");
-
- b.Property("IdentityId")
- .HasColumnType("TEXT");
-
- b.Property("ServiceId")
- .HasColumnType("TEXT");
-
- b.Property("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("IdentityId");
-
- b.HasIndex("ServiceId");
-
- b.ToTable("Logins");
- });
-
- modelBuilder.Entity("AliasServerDb.Password", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property("LoginId")
- .HasColumnType("TEXT");
-
- b.Property("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("LoginId");
-
- b.ToTable("Passwords");
- });
-
- modelBuilder.Entity("AliasServerDb.Service", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property("Name")
- .HasColumnType("TEXT");
-
- b.Property("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("Services");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property("Id")
- .HasColumnType("TEXT");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property("Name")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property("NormalizedName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex");
-
- b.ToTable("AspNetRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property("RoleId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
- {
- b.Property("Id")
- .HasColumnType("TEXT");
-
- b.Property("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property("Email")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property("UserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
-
- b.ToTable("AspNetUsers", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.Property("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.Property("UserId")
- .HasColumnType("TEXT");
-
- b.Property("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.Property("UserId")
- .HasColumnType("TEXT");
-
- b.Property("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property("Name")
- .HasColumnType("TEXT");
-
- b.Property("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.Identity", b =>
- {
- b.HasOne("AliasServerDb.Password", "DefaultPassword")
- .WithMany()
- .HasForeignKey("DefaultPasswordId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("DefaultPassword");
- });
-
- modelBuilder.Entity("AliasServerDb.Login", b =>
- {
- b.HasOne("AliasServerDb.Identity", "Identity")
- .WithMany()
- .HasForeignKey("IdentityId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.Service", "Service")
- .WithMany()
- .HasForeignKey("ServiceId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Identity");
-
- b.Navigation("Service");
- });
-
- modelBuilder.Entity("AliasServerDb.Password", b =>
- {
- b.HasOne("AliasServerDb.Login", "Login")
- .WithMany("Passwords")
- .HasForeignKey("LoginId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Login");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("AliasServerDb.Login", b =>
- {
- b.Navigation("Passwords");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240527082514_BasicEntities.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240527082514_BasicEntities.cs
deleted file mode 100644
index 783fe83a5..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240527082514_BasicEntities.cs
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- ///
- public partial class BasicEntities : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Services",
- columns: table => new
- {
- Id = table.Column(type: "TEXT", nullable: false),
- Name = table.Column(type: "TEXT", nullable: true),
- CreatedAt = table.Column(type: "TEXT", nullable: false),
- UpdatedAt = table.Column(type: "TEXT", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Services", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "Identities",
- columns: table => new
- {
- Id = table.Column(type: "TEXT", nullable: false),
- Gender = table.Column(type: "VARCHAR", maxLength: 255, nullable: true),
- FirstName = table.Column(type: "VARCHAR", maxLength: 255, nullable: false),
- LastName = table.Column(type: "VARCHAR", maxLength: 255, nullable: false),
- NickName = table.Column(type: "VARCHAR", maxLength: 255, nullable: true),
- BirthDate = table.Column(type: "TEXT", nullable: false),
- AddressStreet = table.Column(type: "VARCHAR", maxLength: 255, nullable: true),
- AddressCity = table.Column(type: "VARCHAR", maxLength: 255, nullable: true),
- AddressState = table.Column(type: "VARCHAR", maxLength: 255, nullable: true),
- AddressZipCode = table.Column(type: "VARCHAR", maxLength: 255, nullable: true),
- AddressCountry = table.Column(type: "VARCHAR", maxLength: 255, nullable: true),
- Hobbies = table.Column(type: "TEXT", nullable: true),
- EmailPrefix = table.Column(type: "TEXT", nullable: true),
- PhoneMobile = table.Column(type: "TEXT", nullable: true),
- BankAccountIBAN = table.Column(type: "TEXT", nullable: true),
- CreatedAt = table.Column(type: "TEXT", nullable: false),
- UpdatedAt = table.Column(type: "TEXT", nullable: false),
- DefaultPasswordId = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Identities", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "Logins",
- columns: table => new
- {
- Id = table.Column(type: "TEXT", nullable: false),
- Description = table.Column(type: "TEXT", nullable: true),
- CreatedAt = table.Column(type: "TEXT", nullable: false),
- UpdatedAt = table.Column(type: "TEXT", nullable: false),
- IdentityId = table.Column(type: "TEXT", nullable: false),
- ServiceId = table.Column(type: "TEXT", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Logins", x => x.Id);
- table.ForeignKey(
- name: "FK_Logins_Identities_IdentityId",
- column: x => x.IdentityId,
- principalTable: "Identities",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_Logins_Services_ServiceId",
- column: x => x.ServiceId,
- principalTable: "Services",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "Passwords",
- columns: table => new
- {
- Id = table.Column(type: "TEXT", nullable: false),
- Value = table.Column(type: "TEXT", nullable: true),
- CreatedAt = table.Column(type: "TEXT", nullable: false),
- UpdatedAt = table.Column(type: "TEXT", nullable: false),
- LoginId = table.Column(type: "TEXT", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Passwords", x => x.Id);
- table.ForeignKey(
- name: "FK_Passwords_Logins_LoginId",
- column: x => x.LoginId,
- principalTable: "Logins",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_Identities_DefaultPasswordId",
- table: "Identities",
- column: "DefaultPasswordId");
-
- migrationBuilder.CreateIndex(
- name: "IX_Logins_IdentityId",
- table: "Logins",
- column: "IdentityId");
-
- migrationBuilder.CreateIndex(
- name: "IX_Logins_ServiceId",
- table: "Logins",
- column: "ServiceId");
-
- migrationBuilder.CreateIndex(
- name: "IX_Passwords_LoginId",
- table: "Passwords",
- column: "LoginId");
-
- migrationBuilder.AddForeignKey(
- name: "FK_Identities_Passwords_DefaultPasswordId",
- table: "Identities",
- column: "DefaultPasswordId",
- principalTable: "Passwords",
- principalColumn: "Id",
- onDelete: ReferentialAction.SetNull);
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_Identities_Passwords_DefaultPasswordId",
- table: "Identities");
-
- migrationBuilder.DropTable(
- name: "Passwords");
-
- migrationBuilder.DropTable(
- name: "Logins");
-
- migrationBuilder.DropTable(
- name: "Identities");
-
- migrationBuilder.DropTable(
- name: "Services");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240529140248_LoginUserId.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240529140248_LoginUserId.Designer.cs
deleted file mode 100644
index 65aed4168..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240529140248_LoginUserId.Designer.cs
+++ /dev/null
@@ -1,481 +0,0 @@
-//
-using System;
-using AliasServerDb;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- [DbContext(typeof(AliasServerDbContextSqlite))]
- [Migration("20240529140248_LoginUserId")]
- partial class LoginUserId
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.5")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.Identity", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property("AddressCity")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("AddressCountry")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("AddressState")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("AddressStreet")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("AddressZipCode")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("BankAccountIBAN")
- .HasColumnType("TEXT");
-
- b.Property("BirthDate")
- .HasColumnType("TEXT");
-
- b.Property("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property("DefaultPasswordId")
- .HasColumnType("TEXT");
-
- b.Property("EmailPrefix")
- .HasColumnType("TEXT");
-
- b.Property("FirstName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("Gender")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("Hobbies")
- .HasColumnType("TEXT");
-
- b.Property("LastName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("NickName")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property("PhoneMobile")
- .HasColumnType("TEXT");
-
- b.Property("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("DefaultPasswordId");
-
- b.ToTable("Identities");
- });
-
- modelBuilder.Entity("AliasServerDb.Login", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property("Description")
- .HasColumnType("TEXT");
-
- b.Property("IdentityId")
- .HasColumnType("TEXT");
-
- b.Property("ServiceId")
- .HasColumnType("TEXT");
-
- b.Property("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("IdentityId");
-
- b.HasIndex("ServiceId");
-
- b.HasIndex("UserId");
-
- b.ToTable("Logins");
- });
-
- modelBuilder.Entity("AliasServerDb.Password", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property("LoginId")
- .HasColumnType("TEXT");
-
- b.Property("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("LoginId");
-
- b.ToTable("Passwords");
- });
-
- modelBuilder.Entity("AliasServerDb.Service", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property("Name")
- .HasColumnType("TEXT");
-
- b.Property("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("Services");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property("Id")
- .HasColumnType("TEXT");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property("Name")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property("NormalizedName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex");
-
- b.ToTable("AspNetRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property("RoleId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
- {
- b.Property("Id")
- .HasColumnType("TEXT");
-
- b.Property("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property("Email")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property