Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Remove SQLite server database implementation in code (#494)

Leendert de Borste34b5f586c7a
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 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="9.0.4" />
- <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.4" />
- <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.4" />
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;
/// <summary>
@@ -136,6 +137,32 @@ public class AliasServerDbContext : WorkerStatusDbContext, IDataProtectionKeyCon
/// </summary>
public DbSet<TaskRunnerJob> TaskRunnerJobs { get; set; }
+ /// <summary>
+ /// Sets up the connection string if it is not already configured.
+ /// </summary>
+ /// <param name="optionsBuilder">DbContextOptionsBuilder instance.</param>
+ 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();
+ }
+
/// <summary>
/// The OnModelCreating method.
/// </summary>
@@ -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<DateTime, DateTime>(
+ 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 file="AliasServerDbContextPostgresql.cs" company="lanedirt">
-// Copyright (c) lanedirt. All rights reserved.
-// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
-// </copyright>
-//-----------------------------------------------------------------------
-
-namespace AliasServerDb;
-
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Microsoft.Extensions.Configuration;
-
-/// <summary>
-/// PostgreSQL implementation of the AliasServerDbContext.
-/// </summary>
-public class AliasServerDbContextPostgresql : AliasServerDbContext
-{
- /// <summary>
- /// Initializes a new instance of the <see cref="AliasServerDbContextPostgresql"/> class.
- /// </summary>
- public AliasServerDbContextPostgresql()
- {
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="AliasServerDbContextPostgresql"/> class.
- /// </summary>
- /// <param name="options">DbContextOptions.</param>
- public AliasServerDbContextPostgresql(DbContextOptions<AliasServerDbContext> options)
- : base(options)
- {
- }
-
- /// <summary>
- /// Sets up the connection string if it is not already configured.
- /// </summary>
- /// <param name="optionsBuilder">DbContextOptionsBuilder instance.</param>
- 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();
- }
-
- /// <inheritdoc/>
- 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<DateTime, DateTime>(
- 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 file="AliasServerDbContextSqlite.cs" company="lanedirt">
-// Copyright (c) lanedirt. All rights reserved.
-// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
-// </copyright>
-//-----------------------------------------------------------------------
-
-namespace AliasServerDb;
-
-using Microsoft.EntityFrameworkCore;
-using Microsoft.Extensions.Configuration;
-
-/// <summary>
-/// SQLite implementation of the AliasServerDbContext.
-/// </summary>
-public class AliasServerDbContextSqlite : AliasServerDbContext
-{
- /// <summary>
- /// Initializes a new instance of the <see cref="AliasServerDbContextSqlite"/> class.
- /// </summary>
- public AliasServerDbContextSqlite()
- {
- SetPragmaSettings();
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="AliasServerDbContextSqlite"/> class.
- /// </summary>
- /// <param name="options">DbContextOptions.</param>
- public AliasServerDbContextSqlite(DbContextOptions<AliasServerDbContext> options)
- : base(options)
- {
- SetPragmaSettings();
- }
-
- /// <summary>
- /// The OnModelCreating method.
- /// </summary>
- /// <param name="modelBuilder">ModelBuilder instance.</param>
- 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");
- }
- }
- }
- }
-
- /// <summary>
- /// Sets up the connection string if it is not already configured.
- /// </summary>
- /// <param name="optionsBuilder">DbContextOptionsBuilder instance.</param>
- 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();
- }
-
- /// <summary>
- /// Sets up the PRAGMA settings for SQLite.
- /// </summary>
- 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<IAliasServerDbContextFactory, PostgresqlDbContextFactory>();
- break;
- default:
- services.AddSingleton<IAliasServerDbContextFactory, SqliteDbContextFactory>();
- 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<IAliasServerDbContextFactory, PostgresqlDbContextFactory>();
// Updated DbContextFactory registration
services.AddDbContextFactory<AliasServerDbContext>((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;
/// <summary>
-/// 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.
/// </summary>
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
{
/// <inheritdoc />
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
{
/// <inheritdoc />
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
{
/// <inheritdoc />
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
{
/// <inheritdoc />
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 @@
-// <auto-generated />
-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
- {
- /// <inheritdoc />
- 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<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", 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<string>", 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 @@
-// <auto-generated/>
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class InitialMigration : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "AspNetRoles",
- columns: table => new
- {
- Id = table.Column<string>(type: "TEXT", nullable: false),
- Name = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
- NormalizedName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
- ConcurrencyStamp = table.Column<string>(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetRoles", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUsers",
- columns: table => new
- {
- Id = table.Column<string>(type: "TEXT", nullable: false),
- UserName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
- NormalizedUserName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
- Email = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
- NormalizedEmail = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
- EmailConfirmed = table.Column<bool>(type: "INTEGER", nullable: false),
- PasswordHash = table.Column<string>(type: "TEXT", nullable: true),
- SecurityStamp = table.Column<string>(type: "TEXT", nullable: true),
- ConcurrencyStamp = table.Column<string>(type: "TEXT", nullable: true),
- PhoneNumber = table.Column<string>(type: "TEXT", nullable: true),
- PhoneNumberConfirmed = table.Column<bool>(type: "INTEGER", nullable: false),
- TwoFactorEnabled = table.Column<bool>(type: "INTEGER", nullable: false),
- LockoutEnd = table.Column<DateTimeOffset>(type: "TEXT", nullable: true),
- LockoutEnabled = table.Column<bool>(type: "INTEGER", nullable: false),
- AccessFailedCount = table.Column<int>(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUsers", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetRoleClaims",
- columns: table => new
- {
- Id = table.Column<int>(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- RoleId = table.Column<string>(type: "TEXT", nullable: false),
- ClaimType = table.Column<string>(type: "TEXT", nullable: true),
- ClaimValue = table.Column<string>(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<int>(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- UserId = table.Column<string>(type: "TEXT", nullable: false),
- ClaimType = table.Column<string>(type: "TEXT", nullable: true),
- ClaimValue = table.Column<string>(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<string>(type: "TEXT", nullable: false),
- ProviderKey = table.Column<string>(type: "TEXT", nullable: false),
- ProviderDisplayName = table.Column<string>(type: "TEXT", nullable: true),
- UserId = table.Column<string>(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<string>(type: "TEXT", nullable: false),
- RoleId = table.Column<string>(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<string>(type: "TEXT", nullable: false),
- LoginProvider = table.Column<string>(type: "TEXT", nullable: false),
- Name = table.Column<string>(type: "TEXT", nullable: false),
- Value = table.Column<string>(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);
- }
-
- /// <inheritdoc />
- 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 @@
-// <auto-generated />
-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
- {
- /// <inheritdoc />
- 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<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressCity")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressCountry")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressState")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressStreet")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressZipCode")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("BankAccountIBAN")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("BirthDate")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid?>("DefaultPasswordId")
- .HasColumnType("TEXT");
-
- b.Property<string>("EmailPrefix")
- .HasColumnType("TEXT");
-
- b.Property<string>("FirstName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("Gender")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("Hobbies")
- .HasColumnType("TEXT");
-
- b.Property<string>("LastName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("NickName")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("PhoneMobile")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("DefaultPasswordId");
-
- b.ToTable("Identities");
- });
-
- modelBuilder.Entity("AliasServerDb.Login", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Description")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("IdentityId")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("ServiceId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("IdentityId");
-
- b.HasIndex("ServiceId");
-
- b.ToTable("Logins");
- });
-
- modelBuilder.Entity("AliasServerDb.Password", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("LoginId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("LoginId");
-
- b.ToTable("Passwords");
- });
-
- modelBuilder.Entity("AliasServerDb.Service", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("Services");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("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<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", 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<string>", 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 @@
-// <auto-generated/>
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class BasicEntities : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Services",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "TEXT", nullable: false),
- Name = table.Column<string>(type: "TEXT", nullable: true),
- CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Services", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "Identities",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "TEXT", nullable: false),
- Gender = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: true),
- FirstName = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: false),
- LastName = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: false),
- NickName = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: true),
- BirthDate = table.Column<DateTime>(type: "TEXT", nullable: false),
- AddressStreet = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: true),
- AddressCity = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: true),
- AddressState = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: true),
- AddressZipCode = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: true),
- AddressCountry = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: true),
- Hobbies = table.Column<string>(type: "TEXT", nullable: true),
- EmailPrefix = table.Column<string>(type: "TEXT", nullable: true),
- PhoneMobile = table.Column<string>(type: "TEXT", nullable: true),
- BankAccountIBAN = table.Column<string>(type: "TEXT", nullable: true),
- CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- DefaultPasswordId = table.Column<Guid>(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Identities", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "Logins",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "TEXT", nullable: false),
- Description = table.Column<string>(type: "TEXT", nullable: true),
- CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- IdentityId = table.Column<Guid>(type: "TEXT", nullable: false),
- ServiceId = table.Column<Guid>(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<Guid>(type: "TEXT", nullable: false),
- Value = table.Column<string>(type: "TEXT", nullable: true),
- CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- LoginId = table.Column<Guid>(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);
- }
-
- /// <inheritdoc />
- 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 @@
-// <auto-generated />
-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
- {
- /// <inheritdoc />
- 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<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressCity")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressCountry")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressState")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressStreet")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressZipCode")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("BankAccountIBAN")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("BirthDate")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid?>("DefaultPasswordId")
- .HasColumnType("TEXT");
-
- b.Property<string>("EmailPrefix")
- .HasColumnType("TEXT");
-
- b.Property<string>("FirstName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("Gender")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("Hobbies")
- .HasColumnType("TEXT");
-
- b.Property<string>("LastName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("NickName")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("PhoneMobile")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("DefaultPasswordId");
-
- b.ToTable("Identities");
- });
-
- modelBuilder.Entity("AliasServerDb.Login", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Description")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("IdentityId")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("ServiceId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("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<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("LoginId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("LoginId");
-
- b.ToTable("Passwords");
- });
-
- modelBuilder.Entity("AliasServerDb.Service", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("Services");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("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.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Identity");
-
- b.Navigation("Service");
-
- b.Navigation("User");
- });
-
- 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<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", 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<string>", 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/20240529140248_LoginUserId.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240529140248_LoginUserId.cs
deleted file mode 100644
index a311874a8..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240529140248_LoginUserId.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-// <auto-generated/>
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class LoginUserId : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- // Add the new UserId column
- migrationBuilder.AddColumn<string>(
- name: "UserId",
- table: "Logins",
- type: "TEXT",
- nullable: false,
- defaultValue: "");
-
- // Fetch the first UserId from the AspNetUsers table and update the Logins table
- migrationBuilder.Sql(@"
- UPDATE Logins
- SET UserId = (SELECT Id FROM AspNetUsers LIMIT 1)
- WHERE UserId = ''
- ");
-
- // Create the index on the UserId column
- migrationBuilder.CreateIndex(
- name: "IX_Logins_UserId",
- table: "Logins",
- column: "UserId");
-
- // Add the foreign key constraint
- migrationBuilder.AddForeignKey(
- name: "FK_Logins_AspNetUsers_UserId",
- table: "Logins",
- column: "UserId",
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_Logins_AspNetUsers_UserId",
- table: "Logins");
-
- migrationBuilder.DropIndex(
- name: "IX_Logins_UserId",
- table: "Logins");
-
- migrationBuilder.DropColumn(
- name: "UserId",
- table: "Logins");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240531142952_AddServiceLogo.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240531142952_AddServiceLogo.Designer.cs
deleted file mode 100644
index c1c137ba3..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240531142952_AddServiceLogo.Designer.cs
+++ /dev/null
@@ -1,496 +0,0 @@
-// <auto-generated />
-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("20240531142952_AddServiceLogo")]
- partial class AddServiceLogo
- {
- /// <inheritdoc />
- 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<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressCity")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressCountry")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressState")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressStreet")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressZipCode")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("BankAccountIBAN")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("BirthDate")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid?>("DefaultPasswordId")
- .HasColumnType("TEXT");
-
- b.Property<string>("EmailPrefix")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("FirstName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("Gender")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("Hobbies")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("LastName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("NickName")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("PhoneMobile")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("DefaultPasswordId");
-
- b.ToTable("Identities");
- });
-
- modelBuilder.Entity("AliasServerDb.Login", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Description")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<Guid>("IdentityId")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("ServiceId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("IdentityId");
-
- b.HasIndex("ServiceId");
-
- b.HasIndex("UserId");
-
- b.ToTable("Logins");
- });
-
- modelBuilder.Entity("AliasServerDb.Password", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("LoginId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("LoginId");
-
- b.ToTable("Passwords");
- });
-
- modelBuilder.Entity("AliasServerDb.Service", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<byte[]>("Logo")
- .HasColumnType("BLOB");
-
- b.Property<string>("Name")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Url")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("Services");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("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.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Identity");
-
- b.Navigation("Service");
-
- b.Navigation("User");
- });
-
- 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<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", 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<string>", 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/20240531142952_AddServiceLogo.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240531142952_AddServiceLogo.cs
deleted file mode 100644
index cf20be6fe..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240531142952_AddServiceLogo.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// <auto-generated/>
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddServiceLogo : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<byte[]>(
- name: "Logo",
- table: "Services",
- type: "BLOB",
- nullable: true);
-
- migrationBuilder.AddColumn<string>(
- name: "Url",
- table: "Services",
- type: "TEXT",
- maxLength: 255,
- nullable: true);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "Logo",
- table: "Services");
-
- migrationBuilder.DropColumn(
- name: "Url",
- table: "Services");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240603175245_AddAspNetUserRefreshTokens.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240603175245_AddAspNetUserRefreshTokens.Designer.cs
deleted file mode 100644
index 1a63b693e..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240603175245_AddAspNetUserRefreshTokens.Designer.cs
+++ /dev/null
@@ -1,542 +0,0 @@
-// <auto-generated />
-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("20240603175245_AddAspNetUserRefreshTokens")]
- partial class AddAspNetUserRefreshTokens
- {
- /// <inheritdoc />
- 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.AspNetUserRefreshTokens", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.Identity", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressCity")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressCountry")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressState")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressStreet")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressZipCode")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("BankAccountIBAN")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("BirthDate")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid?>("DefaultPasswordId")
- .HasColumnType("TEXT");
-
- b.Property<string>("EmailPrefix")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("FirstName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("Gender")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("Hobbies")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("LastName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("NickName")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("PhoneMobile")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("DefaultPasswordId");
-
- b.ToTable("Identities");
- });
-
- modelBuilder.Entity("AliasServerDb.Login", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Description")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<Guid>("IdentityId")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("ServiceId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("IdentityId");
-
- b.HasIndex("ServiceId");
-
- b.HasIndex("UserId");
-
- b.ToTable("Logins");
- });
-
- modelBuilder.Entity("AliasServerDb.Password", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("LoginId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("LoginId");
-
- b.ToTable("Passwords");
- });
-
- modelBuilder.Entity("AliasServerDb.Service", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<byte[]>("Logo")
- .HasColumnType("BLOB");
-
- b.Property<string>("Name")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Url")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("Services");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AspNetUserRefreshTokens", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- 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.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Identity");
-
- b.Navigation("Service");
-
- b.Navigation("User");
- });
-
- 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<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", 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<string>", 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/20240603175245_AddAspNetUserRefreshTokens.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240603175245_AddAspNetUserRefreshTokens.cs
deleted file mode 100644
index 517a453ab..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240603175245_AddAspNetUserRefreshTokens.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-// <auto-generated/>
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddAspNetUserRefreshTokens : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "AspNetUserRefreshTokens",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "TEXT", nullable: false),
- UserId = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- DeviceIdentifier = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- Value = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- ExpireDate = table.Column<DateTime>(type: "TEXT", maxLength: 255, nullable: false),
- CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUserRefreshTokens", x => x.Id);
- table.ForeignKey(
- name: "FK_AspNetUserRefreshTokens_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetUserRefreshTokens_UserId",
- table: "AspNetUserRefreshTokens",
- column: "UserId");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "AspNetUserRefreshTokens");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240616200303_ChangeColumnDefinitions.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240616200303_ChangeColumnDefinitions.Designer.cs
deleted file mode 100644
index debf65a4a..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240616200303_ChangeColumnDefinitions.Designer.cs
+++ /dev/null
@@ -1,540 +0,0 @@
-// <auto-generated />
-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("20240616200303_ChangeColumnDefinitions")]
- partial class ChangeColumnDefinitions
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.6")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AspNetUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.Identity", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressCity")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressCountry")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressState")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressStreet")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressZipCode")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("BankAccountIBAN")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("BirthDate")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid?>("DefaultPasswordId")
- .HasColumnType("TEXT");
-
- b.Property<string>("EmailPrefix")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("FirstName")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("Gender")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("Hobbies")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("LastName")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("NickName")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("PhoneMobile")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("DefaultPasswordId");
-
- b.ToTable("Identities");
- });
-
- modelBuilder.Entity("AliasServerDb.Login", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Description")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<Guid>("IdentityId")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("ServiceId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("IdentityId");
-
- b.HasIndex("ServiceId");
-
- b.HasIndex("UserId");
-
- b.ToTable("Logins");
- });
-
- modelBuilder.Entity("AliasServerDb.Password", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("LoginId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("LoginId");
-
- b.ToTable("Passwords");
- });
-
- modelBuilder.Entity("AliasServerDb.Service", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<byte[]>("Logo")
- .HasColumnType("BLOB");
-
- b.Property<string>("Name")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Url")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("Services");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AspNetUserRefreshToken", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- 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.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Identity");
-
- b.Navigation("Service");
-
- b.Navigation("User");
- });
-
- 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<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", 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<string>", 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/20240616200303_ChangeColumnDefinitions.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240616200303_ChangeColumnDefinitions.cs
deleted file mode 100644
index df27a5a0e..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240616200303_ChangeColumnDefinitions.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-// <auto-generated />
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class ChangeColumnDefinitions : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AlterColumn<string>(
- name: "LastName",
- table: "Identities",
- type: "VARCHAR",
- maxLength: 255,
- nullable: true,
- oldClrType: typeof(string),
- oldType: "VARCHAR",
- oldMaxLength: 255);
-
- migrationBuilder.AlterColumn<string>(
- name: "FirstName",
- table: "Identities",
- type: "VARCHAR",
- maxLength: 255,
- nullable: true,
- oldClrType: typeof(string),
- oldType: "VARCHAR",
- oldMaxLength: 255);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AlterColumn<string>(
- name: "LastName",
- table: "Identities",
- type: "VARCHAR",
- maxLength: 255,
- nullable: false,
- defaultValue: "",
- oldClrType: typeof(string),
- oldType: "VARCHAR",
- oldMaxLength: 255,
- oldNullable: true);
-
- migrationBuilder.AlterColumn<string>(
- name: "FirstName",
- table: "Identities",
- type: "VARCHAR",
- maxLength: 255,
- nullable: false,
- defaultValue: "",
- oldClrType: typeof(string),
- oldType: "VARCHAR",
- oldMaxLength: 255,
- oldNullable: true);
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240621092501_AddAliasVaultUser.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240621092501_AddAliasVaultUser.Designer.cs
deleted file mode 100644
index b4723c464..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240621092501_AddAliasVaultUser.Designer.cs
+++ /dev/null
@@ -1,548 +0,0 @@
-// <auto-generated />
-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("20240621092501_AddAliasVaultUser")]
- partial class AddAliasVaultUser
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.6")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
-
- b.ToTable("AspNetUsers", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AspNetUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.Identity", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressCity")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressCountry")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressState")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressStreet")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressZipCode")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("BankAccountIBAN")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("BirthDate")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid?>("DefaultPasswordId")
- .HasColumnType("TEXT");
-
- b.Property<string>("EmailPrefix")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("FirstName")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("Gender")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("Hobbies")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("LastName")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("NickName")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("PhoneMobile")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("DefaultPasswordId");
-
- b.ToTable("Identities");
- });
-
- modelBuilder.Entity("AliasServerDb.Login", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Description")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<Guid>("IdentityId")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("ServiceId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("IdentityId");
-
- b.HasIndex("ServiceId");
-
- b.HasIndex("UserId");
-
- b.ToTable("Logins");
- });
-
- modelBuilder.Entity("AliasServerDb.Password", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("LoginId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("LoginId");
-
- b.ToTable("Passwords");
- });
-
- modelBuilder.Entity("AliasServerDb.Service", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<byte[]>("Logo")
- .HasColumnType("BLOB");
-
- b.Property<string>("Name")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Url")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("Services");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AspNetUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- 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.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Identity");
-
- b.Navigation("Service");
-
- b.Navigation("User");
- });
-
- 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<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", 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/20240621092501_AddAliasVaultUser.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240621092501_AddAliasVaultUser.cs
deleted file mode 100644
index 47c48fd29..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240621092501_AddAliasVaultUser.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// <auto-generated />
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddAliasVaultUser : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<string>(
- name: "Salt",
- table: "AspNetUsers",
- type: "TEXT",
- nullable: false,
- defaultValue: "");
-
- migrationBuilder.AddColumn<string>(
- name: "Verifier",
- table: "AspNetUsers",
- type: "TEXT",
- nullable: false,
- defaultValue: "");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "Salt",
- table: "AspNetUsers");
-
- migrationBuilder.DropColumn(
- name: "Verifier",
- table: "AspNetUsers");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240624125214_AddVaultsTable.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240624125214_AddVaultsTable.Designer.cs
deleted file mode 100644
index ff9a29658..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240624125214_AddVaultsTable.Designer.cs
+++ /dev/null
@@ -1,587 +0,0 @@
-// <auto-generated />
-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("20240624125214_AddVaultsTable")]
- partial class AddVaultsTable
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.6")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
-
- b.ToTable("AspNetUsers", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AspNetUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.Identity", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressCity")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressCountry")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressState")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressStreet")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("AddressZipCode")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("BankAccountIBAN")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("BirthDate")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid?>("DefaultPasswordId")
- .HasColumnType("TEXT");
-
- b.Property<string>("EmailPrefix")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("FirstName")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("Gender")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("Hobbies")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("LastName")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("NickName")
- .HasMaxLength(255)
- .HasColumnType("VARCHAR");
-
- b.Property<string>("PhoneMobile")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("DefaultPasswordId");
-
- b.ToTable("Identities");
- });
-
- modelBuilder.Entity("AliasServerDb.Login", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Description")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<Guid>("IdentityId")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("ServiceId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("IdentityId");
-
- b.HasIndex("ServiceId");
-
- b.HasIndex("UserId");
-
- b.ToTable("Logins");
- });
-
- modelBuilder.Entity("AliasServerDb.Password", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<Guid>("LoginId")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("LoginId");
-
- b.ToTable("Passwords");
- });
-
- modelBuilder.Entity("AliasServerDb.Service", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<byte[]>("Logo")
- .HasColumnType("BLOB");
-
- b.Property<string>("Name")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Url")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("Services");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AspNetUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- 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.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Identity");
-
- b.Navigation("Service");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Password", b =>
- {
- b.HasOne("AliasServerDb.Login", "Login")
- .WithMany("Passwords")
- .HasForeignKey("LoginId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Login");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", 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/20240624125214_AddVaultsTable.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240624125214_AddVaultsTable.cs
deleted file mode 100644
index e9254a798..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240624125214_AddVaultsTable.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-// <auto-generated />
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddVaultsTable : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Vaults",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "TEXT", nullable: false),
- UserId = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- VaultBlob = table.Column<string>(type: "TEXT", nullable: false),
- CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Vaults", x => x.Id);
- table.ForeignKey(
- name: "FK_Vaults_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_Vaults_UserId",
- table: "Vaults",
- column: "UserId");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "Vaults");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240701104445_RemoveClientTables.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240701104445_RemoveClientTables.Designer.cs
deleted file mode 100644
index e4e7185d1..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240701104445_RemoveClientTables.Designer.cs
+++ /dev/null
@@ -1,365 +0,0 @@
-// <auto-generated />
-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("20240701104445_RemoveClientTables")]
- partial class RemoveClientTables
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.6")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
-
- b.ToTable("AspNetUsers", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AspNetUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AspNetUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240701104445_RemoveClientTables.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240701104445_RemoveClientTables.cs
deleted file mode 100644
index edf01f11b..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240701104445_RemoveClientTables.cs
+++ /dev/null
@@ -1,168 +0,0 @@
-// <auto-generated />
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class RemoveClientTables : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "Passwords");
-
- migrationBuilder.DropTable(
- name: "Logins");
-
- migrationBuilder.DropTable(
- name: "Identities");
-
- migrationBuilder.DropTable(
- name: "Services");
-
- // Delete all rows from the vaults table because datamodel has changed.
- migrationBuilder.Sql("DELETE FROM Vaults;");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Services",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "TEXT", nullable: false),
- CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- Logo = table.Column<byte[]>(type: "BLOB", nullable: true),
- Name = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
- UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- Url = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Services", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "Identities",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "TEXT", nullable: false),
- DefaultPasswordId = table.Column<Guid>(type: "TEXT", nullable: true),
- AddressCity = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: true),
- AddressCountry = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: true),
- AddressState = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: true),
- AddressStreet = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: true),
- AddressZipCode = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: true),
- BankAccountIBAN = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
- BirthDate = table.Column<DateTime>(type: "TEXT", nullable: false),
- CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- EmailPrefix = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
- FirstName = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: true),
- Gender = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: true),
- Hobbies = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
- LastName = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: true),
- NickName = table.Column<string>(type: "VARCHAR", maxLength: 255, nullable: true),
- PhoneMobile = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
- UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Identities", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "Logins",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "TEXT", nullable: false),
- IdentityId = table.Column<Guid>(type: "TEXT", nullable: false),
- ServiceId = table.Column<Guid>(type: "TEXT", nullable: false),
- UserId = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- Description = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
- UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Logins", x => x.Id);
- table.ForeignKey(
- name: "FK_Logins_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- 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<Guid>(type: "TEXT", nullable: false),
- LoginId = table.Column<Guid>(type: "TEXT", nullable: false),
- CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- Value = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true)
- },
- 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_Logins_UserId",
- table: "Logins",
- column: "UserId");
-
- 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);
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240708113743_AddVaultVersionColumn.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240708113743_AddVaultVersionColumn.Designer.cs
deleted file mode 100644
index ee85470ff..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240708113743_AddVaultVersionColumn.Designer.cs
+++ /dev/null
@@ -1,370 +0,0 @@
-// <auto-generated />
-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("20240708113743_AddVaultVersionColumn")]
- partial class AddVaultVersionColumn
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.6")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
-
- b.ToTable("AspNetUsers", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AspNetUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AspNetUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240708113743_AddVaultVersionColumn.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240708113743_AddVaultVersionColumn.cs
deleted file mode 100644
index 0291f9380..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240708113743_AddVaultVersionColumn.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-// <auto-generated />
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddVaultVersionColumn : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<string>(
- name: "Version",
- table: "Vaults",
- type: "TEXT",
- maxLength: 255,
- nullable: false,
- defaultValue: "");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "Version",
- table: "Vaults");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240720151458_AddEmailTables.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240720151458_AddEmailTables.Designer.cs
deleted file mode 100644
index 9efc7da9d..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240720151458_AddEmailTables.Designer.cs
+++ /dev/null
@@ -1,494 +0,0 @@
-// <auto-generated />
-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("20240718151458_AddEmailTables")]
- partial class AddEmailTables
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.6")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
-
- b.ToTable("AspNetUsers", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AspNetUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasMaxLength(256)
- .HasColumnType("TEXT");
-
- b.Property<string>("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<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AspNetUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240720151458_AddEmailTables.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240720151458_AddEmailTables.cs
deleted file mode 100644
index 4c6bf16ed..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240720151458_AddEmailTables.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-// <auto-generated />
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddEmailTables : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Emails",
- columns: table => new
- {
- Id = table.Column<int>(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Subject = table.Column<string>(type: "TEXT", nullable: false),
- From = table.Column<string>(type: "TEXT", nullable: false),
- FromLocal = table.Column<string>(type: "TEXT", nullable: false),
- FromDomain = table.Column<string>(type: "TEXT", nullable: false),
- To = table.Column<string>(type: "TEXT", nullable: false),
- ToLocal = table.Column<string>(type: "TEXT", nullable: false),
- ToDomain = table.Column<string>(type: "TEXT", nullable: false),
- Date = table.Column<DateTime>(type: "TEXT", nullable: false),
- DateSystem = table.Column<DateTime>(type: "TEXT", nullable: false),
- MessageHtml = table.Column<string>(type: "TEXT", nullable: true),
- MessagePlain = table.Column<string>(type: "TEXT", nullable: true),
- MessagePreview = table.Column<string>(type: "TEXT", nullable: true),
- MessageSource = table.Column<string>(type: "TEXT", nullable: false),
- Visible = table.Column<bool>(type: "INTEGER", nullable: false),
- PushNotificationSent = table.Column<bool>(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Emails", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "EmailAttachments",
- columns: table => new
- {
- Id = table.Column<int>(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Bytes = table.Column<byte[]>(type: "BLOB", nullable: false),
- Filename = table.Column<string>(type: "TEXT", nullable: false),
- MimeType = table.Column<string>(type: "TEXT", nullable: false),
- Filesize = table.Column<int>(type: "INTEGER", nullable: false),
- Date = table.Column<DateTime>(type: "TEXT", nullable: false),
- EmailId = table.Column<int>(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_EmailAttachments", x => x.Id);
- table.ForeignKey(
- name: "FK_EmailAttachments_Emails_EmailId",
- column: x => x.EmailId,
- principalTable: "Emails",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_EmailAttachments_EmailId",
- table: "EmailAttachments",
- column: "EmailId");
-
- migrationBuilder.CreateIndex(
- name: "IX_Emails_Date",
- table: "Emails",
- column: "Date");
-
- migrationBuilder.CreateIndex(
- name: "IX_Emails_DateSystem",
- table: "Emails",
- column: "DateSystem");
-
- migrationBuilder.CreateIndex(
- name: "IX_Emails_PushNotificationSent",
- table: "Emails",
- column: "PushNotificationSent");
-
- migrationBuilder.CreateIndex(
- name: "IX_Emails_ToLocal",
- table: "Emails",
- column: "ToLocal");
-
- migrationBuilder.CreateIndex(
- name: "IX_Emails_Visible",
- table: "Emails",
- column: "Visible");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "EmailAttachments");
-
- migrationBuilder.DropTable(
- name: "Emails");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240720211546_AddAdminUsersTable.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240720211546_AddAdminUsersTable.Designer.cs
deleted file mode 100644
index c1dc3cb51..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240720211546_AddAdminUsersTable.Designer.cs
+++ /dev/null
@@ -1,484 +0,0 @@
-// <auto-generated />
-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("20240720211546_AddAdminUsersTable")]
- partial class AddAdminUsersTable
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.6")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240720211546_AddAdminUsersTable.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240720211546_AddAdminUsersTable.cs
deleted file mode 100644
index c08d2091b..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240720211546_AddAdminUsersTable.cs
+++ /dev/null
@@ -1,526 +0,0 @@
-// <auto-generated />
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddAdminUsersTable : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
- table: "AspNetRoleClaims");
-
- migrationBuilder.DropForeignKey(
- name: "FK_AspNetUserClaims_AspNetUsers_UserId",
- table: "AspNetUserClaims");
-
- migrationBuilder.DropForeignKey(
- name: "FK_AspNetUserLogins_AspNetUsers_UserId",
- table: "AspNetUserLogins");
-
- migrationBuilder.DropForeignKey(
- name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
- table: "AspNetUserRoles");
-
- migrationBuilder.DropForeignKey(
- name: "FK_AspNetUserRoles_AspNetUsers_UserId",
- table: "AspNetUserRoles");
-
- migrationBuilder.DropForeignKey(
- name: "FK_AspNetUserTokens_AspNetUsers_UserId",
- table: "AspNetUserTokens");
-
- migrationBuilder.DropForeignKey(
- name: "FK_Vaults_AspNetUsers_UserId",
- table: "Vaults");
-
- migrationBuilder.DropTable(
- name: "AspNetRoles");
-
- migrationBuilder.DropTable(
- name: "AspNetUserRefreshTokens");
-
- migrationBuilder.DropPrimaryKey(
- name: "PK_AspNetUserTokens",
- table: "AspNetUserTokens");
-
- migrationBuilder.DropPrimaryKey(
- name: "PK_AspNetUsers",
- table: "AspNetUsers");
-
- migrationBuilder.DropIndex(
- name: "EmailIndex",
- table: "AspNetUsers");
-
- migrationBuilder.DropIndex(
- name: "UserNameIndex",
- table: "AspNetUsers");
-
- migrationBuilder.DropPrimaryKey(
- name: "PK_AspNetUserRoles",
- table: "AspNetUserRoles");
-
- migrationBuilder.DropIndex(
- name: "IX_AspNetUserRoles_RoleId",
- table: "AspNetUserRoles");
-
- migrationBuilder.DropPrimaryKey(
- name: "PK_AspNetUserLogins",
- table: "AspNetUserLogins");
-
- migrationBuilder.DropIndex(
- name: "IX_AspNetUserLogins_UserId",
- table: "AspNetUserLogins");
-
- migrationBuilder.DropPrimaryKey(
- name: "PK_AspNetUserClaims",
- table: "AspNetUserClaims");
-
- migrationBuilder.DropIndex(
- name: "IX_AspNetUserClaims_UserId",
- table: "AspNetUserClaims");
-
- migrationBuilder.DropPrimaryKey(
- name: "PK_AspNetRoleClaims",
- table: "AspNetRoleClaims");
-
- migrationBuilder.DropIndex(
- name: "IX_AspNetRoleClaims_RoleId",
- table: "AspNetRoleClaims");
-
- migrationBuilder.RenameTable(
- name: "AspNetUserTokens",
- newName: "UserTokens");
-
- migrationBuilder.RenameTable(
- name: "AspNetUsers",
- newName: "AliasVaultUsers");
-
- migrationBuilder.RenameTable(
- name: "AspNetUserRoles",
- newName: "UserRoles");
-
- migrationBuilder.RenameTable(
- name: "AspNetUserLogins",
- newName: "UserLogins");
-
- migrationBuilder.RenameTable(
- name: "AspNetUserClaims",
- newName: "UserClaims");
-
- migrationBuilder.RenameTable(
- name: "AspNetRoleClaims",
- newName: "RoleClaims");
-
- migrationBuilder.AlterColumn<string>(
- name: "UserId",
- table: "UserLogins",
- type: "TEXT",
- nullable: true,
- oldClrType: typeof(string),
- oldType: "TEXT");
-
- migrationBuilder.AlterColumn<string>(
- name: "UserId",
- table: "UserClaims",
- type: "TEXT",
- nullable: true,
- oldClrType: typeof(string),
- oldType: "TEXT");
-
- migrationBuilder.AlterColumn<string>(
- name: "RoleId",
- table: "RoleClaims",
- type: "TEXT",
- nullable: true,
- oldClrType: typeof(string),
- oldType: "TEXT");
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_UserTokens",
- table: "UserTokens",
- columns: new[] { "UserId", "LoginProvider", "Name" });
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_AliasVaultUsers",
- table: "AliasVaultUsers",
- column: "Id");
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_UserRoles",
- table: "UserRoles",
- columns: new[] { "UserId", "RoleId" });
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_UserLogins",
- table: "UserLogins",
- columns: new[] { "LoginProvider", "ProviderKey" });
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_UserClaims",
- table: "UserClaims",
- column: "Id");
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_RoleClaims",
- table: "RoleClaims",
- column: "Id");
-
- migrationBuilder.CreateTable(
- name: "AdminRoles",
- columns: table => new
- {
- Id = table.Column<string>(type: "TEXT", nullable: false),
- Name = table.Column<string>(type: "TEXT", nullable: true),
- NormalizedName = table.Column<string>(type: "TEXT", nullable: true),
- ConcurrencyStamp = table.Column<string>(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AdminRoles", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "AdminUsers",
- columns: table => new
- {
- Id = table.Column<string>(type: "TEXT", nullable: false),
- UserName = table.Column<string>(type: "TEXT", nullable: true),
- NormalizedUserName = table.Column<string>(type: "TEXT", nullable: true),
- Email = table.Column<string>(type: "TEXT", nullable: true),
- NormalizedEmail = table.Column<string>(type: "TEXT", nullable: true),
- EmailConfirmed = table.Column<bool>(type: "INTEGER", nullable: false),
- PasswordHash = table.Column<string>(type: "TEXT", nullable: true),
- SecurityStamp = table.Column<string>(type: "TEXT", nullable: true),
- ConcurrencyStamp = table.Column<string>(type: "TEXT", nullable: true),
- PhoneNumber = table.Column<string>(type: "TEXT", nullable: true),
- PhoneNumberConfirmed = table.Column<bool>(type: "INTEGER", nullable: false),
- TwoFactorEnabled = table.Column<bool>(type: "INTEGER", nullable: false),
- LockoutEnd = table.Column<DateTimeOffset>(type: "TEXT", nullable: true),
- LockoutEnabled = table.Column<bool>(type: "INTEGER", nullable: false),
- AccessFailedCount = table.Column<int>(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AdminUsers", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "AliasVaultRoles",
- columns: table => new
- {
- Id = table.Column<string>(type: "TEXT", nullable: false),
- Name = table.Column<string>(type: "TEXT", nullable: true),
- NormalizedName = table.Column<string>(type: "TEXT", nullable: true),
- ConcurrencyStamp = table.Column<string>(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AliasVaultRoles", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "AliasVaultUserRefreshTokens",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "TEXT", nullable: false),
- UserId = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- DeviceIdentifier = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- Value = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- ExpireDate = table.Column<DateTime>(type: "TEXT", maxLength: 255, nullable: false),
- CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AliasVaultUserRefreshTokens", x => x.Id);
- table.ForeignKey(
- name: "FK_AliasVaultUserRefreshTokens_AliasVaultUsers_UserId",
- column: x => x.UserId,
- principalTable: "AliasVaultUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_AliasVaultUserRefreshTokens_UserId",
- table: "AliasVaultUserRefreshTokens",
- column: "UserId");
-
- migrationBuilder.AddForeignKey(
- name: "FK_Vaults_AliasVaultUsers_UserId",
- table: "Vaults",
- column: "UserId",
- principalTable: "AliasVaultUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_Vaults_AliasVaultUsers_UserId",
- table: "Vaults");
-
- migrationBuilder.DropTable(
- name: "AdminRoles");
-
- migrationBuilder.DropTable(
- name: "AdminUsers");
-
- migrationBuilder.DropTable(
- name: "AliasVaultRoles");
-
- migrationBuilder.DropTable(
- name: "AliasVaultUserRefreshTokens");
-
- migrationBuilder.DropPrimaryKey(
- name: "PK_UserTokens",
- table: "UserTokens");
-
- migrationBuilder.DropPrimaryKey(
- name: "PK_UserRoles",
- table: "UserRoles");
-
- migrationBuilder.DropPrimaryKey(
- name: "PK_UserLogins",
- table: "UserLogins");
-
- migrationBuilder.DropPrimaryKey(
- name: "PK_UserClaims",
- table: "UserClaims");
-
- migrationBuilder.DropPrimaryKey(
- name: "PK_RoleClaims",
- table: "RoleClaims");
-
- migrationBuilder.DropPrimaryKey(
- name: "PK_AliasVaultUsers",
- table: "AliasVaultUsers");
-
- migrationBuilder.RenameTable(
- name: "UserTokens",
- newName: "AspNetUserTokens");
-
- migrationBuilder.RenameTable(
- name: "UserRoles",
- newName: "AspNetUserRoles");
-
- migrationBuilder.RenameTable(
- name: "UserLogins",
- newName: "AspNetUserLogins");
-
- migrationBuilder.RenameTable(
- name: "UserClaims",
- newName: "AspNetUserClaims");
-
- migrationBuilder.RenameTable(
- name: "RoleClaims",
- newName: "AspNetRoleClaims");
-
- migrationBuilder.RenameTable(
- name: "AliasVaultUsers",
- newName: "AspNetUsers");
-
- migrationBuilder.AlterColumn<string>(
- name: "UserId",
- table: "AspNetUserLogins",
- type: "TEXT",
- nullable: false,
- defaultValue: "",
- oldClrType: typeof(string),
- oldType: "TEXT",
- oldNullable: true);
-
- migrationBuilder.AlterColumn<string>(
- name: "UserId",
- table: "AspNetUserClaims",
- type: "TEXT",
- nullable: false,
- defaultValue: "",
- oldClrType: typeof(string),
- oldType: "TEXT",
- oldNullable: true);
-
- migrationBuilder.AlterColumn<string>(
- name: "RoleId",
- table: "AspNetRoleClaims",
- type: "TEXT",
- nullable: false,
- defaultValue: "",
- oldClrType: typeof(string),
- oldType: "TEXT",
- oldNullable: true);
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_AspNetUserTokens",
- table: "AspNetUserTokens",
- columns: new[] { "UserId", "LoginProvider", "Name" });
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_AspNetUserRoles",
- table: "AspNetUserRoles",
- columns: new[] { "UserId", "RoleId" });
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_AspNetUserLogins",
- table: "AspNetUserLogins",
- columns: new[] { "LoginProvider", "ProviderKey" });
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_AspNetUserClaims",
- table: "AspNetUserClaims",
- column: "Id");
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_AspNetRoleClaims",
- table: "AspNetRoleClaims",
- column: "Id");
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_AspNetUsers",
- table: "AspNetUsers",
- column: "Id");
-
- migrationBuilder.CreateTable(
- name: "AspNetRoles",
- columns: table => new
- {
- Id = table.Column<string>(type: "TEXT", nullable: false),
- ConcurrencyStamp = table.Column<string>(type: "TEXT", nullable: true),
- Name = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
- NormalizedName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetRoles", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUserRefreshTokens",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "TEXT", nullable: false),
- UserId = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- DeviceIdentifier = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- ExpireDate = table.Column<DateTime>(type: "TEXT", maxLength: 255, nullable: false),
- Value = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUserRefreshTokens", x => x.Id);
- table.ForeignKey(
- name: "FK_AspNetUserRefreshTokens_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetUserRoles_RoleId",
- table: "AspNetUserRoles",
- column: "RoleId");
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetUserLogins_UserId",
- table: "AspNetUserLogins",
- column: "UserId");
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetUserClaims_UserId",
- table: "AspNetUserClaims",
- column: "UserId");
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetRoleClaims_RoleId",
- table: "AspNetRoleClaims",
- column: "RoleId");
-
- migrationBuilder.CreateIndex(
- name: "EmailIndex",
- table: "AspNetUsers",
- column: "NormalizedEmail");
-
- migrationBuilder.CreateIndex(
- name: "UserNameIndex",
- table: "AspNetUsers",
- column: "NormalizedUserName",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "RoleNameIndex",
- table: "AspNetRoles",
- column: "NormalizedName",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetUserRefreshTokens_UserId",
- table: "AspNetUserRefreshTokens",
- column: "UserId");
-
- migrationBuilder.AddForeignKey(
- name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
- table: "AspNetRoleClaims",
- column: "RoleId",
- principalTable: "AspNetRoles",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
-
- migrationBuilder.AddForeignKey(
- name: "FK_AspNetUserClaims_AspNetUsers_UserId",
- table: "AspNetUserClaims",
- column: "UserId",
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
-
- migrationBuilder.AddForeignKey(
- name: "FK_AspNetUserLogins_AspNetUsers_UserId",
- table: "AspNetUserLogins",
- column: "UserId",
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
-
- migrationBuilder.AddForeignKey(
- name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
- table: "AspNetUserRoles",
- column: "RoleId",
- principalTable: "AspNetRoles",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
-
- migrationBuilder.AddForeignKey(
- name: "FK_AspNetUserRoles_AspNetUsers_UserId",
- table: "AspNetUserRoles",
- column: "UserId",
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
-
- migrationBuilder.AddForeignKey(
- name: "FK_AspNetUserTokens_AspNetUsers_UserId",
- table: "AspNetUserTokens",
- column: "UserId",
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
-
- migrationBuilder.AddForeignKey(
- name: "FK_Vaults_AspNetUsers_UserId",
- table: "Vaults",
- column: "UserId",
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240722144205_AddAdminUserPasswordSetDate.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240722144205_AddAdminUserPasswordSetDate.Designer.cs
deleted file mode 100644
index d07bc3869..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240722144205_AddAdminUserPasswordSetDate.Designer.cs
+++ /dev/null
@@ -1,487 +0,0 @@
-// <auto-generated />
-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("20240722144205_AddAdminUserPasswordSetDate")]
- partial class AddAdminUserPasswordSetDate
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.6")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240722144205_AddAdminUserPasswordSetDate.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240722144205_AddAdminUserPasswordSetDate.cs
deleted file mode 100644
index 3eee6f4aa..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240722144205_AddAdminUserPasswordSetDate.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// <auto-generated />
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddAdminUserPasswordSetDate : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<DateTime>(
- name: "LastPasswordChanged",
- table: "AdminUsers",
- type: "TEXT",
- nullable: true);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "LastPasswordChanged",
- table: "AdminUsers");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240723194939_CreateLogTable.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240723194939_CreateLogTable.Designer.cs
deleted file mode 100644
index 253ff0896..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240723194939_CreateLogTable.Designer.cs
+++ /dev/null
@@ -1,536 +0,0 @@
-// <auto-generated />
-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("20240723194939_CreateLogTable")]
- partial class CreateLogTable
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.6")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTimeOffset>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240723194939_CreateLogTable.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240723194939_CreateLogTable.cs
deleted file mode 100644
index 35150732e..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240723194939_CreateLogTable.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-// <auto-generated />
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class CreateLogTable : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Logs",
- columns: table => new
- {
- Id = table.Column<int>(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Application = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
- Message = table.Column<string>(type: "TEXT", nullable: false),
- MessageTemplate = table.Column<string>(type: "TEXT", nullable: false),
- Level = table.Column<string>(type: "TEXT", maxLength: 128, nullable: false),
- TimeStamp = table.Column<DateTimeOffset>(type: "TEXT", nullable: false),
- Exception = table.Column<string>(type: "TEXT", nullable: false),
- Properties = table.Column<string>(type: "TEXT", nullable: false),
- LogEvent = table.Column<string>(type: "TEXT", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Logs", x => x.Id);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_Logs_Application",
- table: "Logs",
- column: "Application");
-
- migrationBuilder.CreateIndex(
- name: "IX_Logs_TimeStamp",
- table: "Logs",
- column: "TimeStamp");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "Logs");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240725202058_WorkerStatusTable.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240725202058_WorkerStatusTable.Designer.cs
deleted file mode 100644
index e8f7bd698..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240725202058_WorkerStatusTable.Designer.cs
+++ /dev/null
@@ -1,565 +0,0 @@
-// <auto-generated />
-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("20240725202058_WorkerStatusTable")]
- partial class WorkerStatusTable
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.7")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTimeOffset>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240725202058_WorkerStatusTable.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240725202058_WorkerStatusTable.cs
deleted file mode 100644
index 12827ebaa..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240725202058_WorkerStatusTable.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-// <auto-generated />
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class WorkerStatusTable : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "WorkerServiceStatuses",
- columns: table => new
- {
- Id = table.Column<int>(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- ServiceName = table.Column<string>(type: "varchar", maxLength: 255, nullable: false),
- CurrentStatus = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
- DesiredStatus = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
- Heartbeat = table.Column<DateTime>(type: "TEXT", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_WorkerServiceStatuses", x => x.Id);
- });
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "WorkerServiceStatuses");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240728110837_AddMetadataColumns.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240728110837_AddMetadataColumns.Designer.cs
deleted file mode 100644
index 9665b85d0..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240728110837_AddMetadataColumns.Designer.cs
+++ /dev/null
@@ -1,576 +0,0 @@
-// <auto-generated />
-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("20240728110837_AddMetadataColumns")]
- partial class AddMetadataColumns
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.7")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTimeOffset>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240728110837_AddMetadataColumns.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240728110837_AddMetadataColumns.cs
deleted file mode 100644
index ce4f9346d..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240728110837_AddMetadataColumns.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-// <auto-generated />
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddMetadataColumns : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<int>(
- name: "FileSize",
- table: "Vaults",
- type: "INTEGER",
- nullable: false,
- defaultValue: 0);
-
- migrationBuilder.AddColumn<DateTime>(
- name: "CreatedAt",
- table: "AliasVaultUsers",
- type: "TEXT",
- nullable: false,
- defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
-
- migrationBuilder.AddColumn<DateTime>(
- name: "UpdatedAt",
- table: "AliasVaultUsers",
- type: "TEXT",
- nullable: false,
- defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
-
- // Update all existing users to have the CreatedAt and UpdatedAt set to "now".
- if (migrationBuilder.IsSqlite())
- {
- migrationBuilder.Sql("UPDATE AliasVaultUsers SET CreatedAt = datetime('now'), UpdatedAt = datetime('now')");
- }
- else
- {
- migrationBuilder.Sql("UPDATE AliasVaultUsers SET CreatedAt = GETUTCDATE(), UpdatedAt = GETUTCDATE()");
- }
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "FileSize",
- table: "Vaults");
-
- migrationBuilder.DropColumn(
- name: "CreatedAt",
- table: "AliasVaultUsers");
-
- migrationBuilder.DropColumn(
- name: "UpdatedAt",
- table: "AliasVaultUsers");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240729150925_AddEncryptionKeyTables.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240729150925_AddEncryptionKeyTables.Designer.cs
deleted file mode 100644
index 150763bb0..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240729150925_AddEncryptionKeyTables.Designer.cs
+++ /dev/null
@@ -1,707 +0,0 @@
-// <auto-generated />
-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("20240729150925_AddEncryptionKeyTables")]
- partial class AddEncryptionKeyTables
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.7")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTimeOffset>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.NoAction)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240729150925_AddEncryptionKeyTables.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240729150925_AddEncryptionKeyTables.cs
deleted file mode 100644
index b001f5552..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240729150925_AddEncryptionKeyTables.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-// <auto-generated />
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddEncryptionKeyTables : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- // Delete all records from the Email table as adding PKI will break the existing data.
- migrationBuilder.Sql("DELETE FROM Emails");
-
- migrationBuilder.AddColumn<string>(
- name: "EncryptedSymmetricKey",
- table: "Emails",
- type: "TEXT",
- nullable: false,
- defaultValue: "");
-
- migrationBuilder.AddColumn<Guid>(
- name: "UserEncryptionKeyId",
- table: "Emails",
- type: "TEXT",
- maxLength: 255,
- nullable: false,
- defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
-
- migrationBuilder.CreateTable(
- name: "UserEmailClaims",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "TEXT", nullable: false),
- UserId = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- Address = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- AddressLocal = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- AddressDomain = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_UserEmailClaims", x => x.Id);
- table.ForeignKey(
- name: "FK_UserEmailClaims_AliasVaultUsers_UserId",
- column: x => x.UserId,
- principalTable: "AliasVaultUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "UserEncryptionKeys",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "TEXT", nullable: false),
- UserId = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- PublicKey = table.Column<string>(type: "TEXT", maxLength: 2000, nullable: false),
- IsPrimary = table.Column<bool>(type: "INTEGER", nullable: false),
- CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_UserEncryptionKeys", x => x.Id);
- table.ForeignKey(
- name: "FK_UserEncryptionKeys_AliasVaultUsers_UserId",
- column: x => x.UserId,
- principalTable: "AliasVaultUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_Emails_UserEncryptionKeyId",
- table: "Emails",
- column: "UserEncryptionKeyId");
-
- migrationBuilder.CreateIndex(
- name: "IX_UserEmailClaims_Address",
- table: "UserEmailClaims",
- column: "Address",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_UserEmailClaims_UserId",
- table: "UserEmailClaims",
- column: "UserId");
-
- migrationBuilder.CreateIndex(
- name: "IX_UserEncryptionKeys_UserId",
- table: "UserEncryptionKeys",
- column: "UserId");
-
- migrationBuilder.AddForeignKey(
- name: "FK_Emails_UserEncryptionKeys_UserEncryptionKeyId",
- table: "Emails",
- column: "UserEncryptionKeyId",
- principalTable: "UserEncryptionKeys",
- principalColumn: "Id");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_Emails_UserEncryptionKeys_UserEncryptionKeyId",
- table: "Emails");
-
- migrationBuilder.DropTable(
- name: "UserEmailClaims");
-
- migrationBuilder.DropTable(
- name: "UserEncryptionKeys");
-
- migrationBuilder.DropIndex(
- name: "IX_Emails_UserEncryptionKeyId",
- table: "Emails");
-
- migrationBuilder.DropColumn(
- name: "EncryptedSymmetricKey",
- table: "Emails");
-
- migrationBuilder.DropColumn(
- name: "UserEncryptionKeyId",
- table: "Emails");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240821164021_AddDataProtectionDatabaseTable.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240821164021_AddDataProtectionDatabaseTable.Designer.cs
deleted file mode 100644
index af2e8f23f..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240821164021_AddDataProtectionDatabaseTable.Designer.cs
+++ /dev/null
@@ -1,724 +0,0 @@
-// <auto-generated />
-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("20240821164021_AddDataProtectionDatabaseTable")]
- partial class AddDataProtectionDatabaseTable
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.8")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTimeOffset>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.NoAction)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240821164021_AddDataProtectionDatabaseTable.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240821164021_AddDataProtectionDatabaseTable.cs
deleted file mode 100644
index 4ae5cd27e..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240821164021_AddDataProtectionDatabaseTable.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-// <auto-generated />
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddDataProtectionDatabaseTable : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "DataProtectionKeys",
- columns: table => new
- {
- Id = table.Column<int>(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- FriendlyName = table.Column<string>(type: "TEXT", nullable: true),
- Xml = table.Column<string>(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_DataProtectionKeys", x => x.Id);
- });
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "DataProtectionKeys");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240821204113_UpdateLogTable.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240821204113_UpdateLogTable.Designer.cs
deleted file mode 100644
index 8d6457e9b..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240821204113_UpdateLogTable.Designer.cs
+++ /dev/null
@@ -1,728 +0,0 @@
-// <auto-generated />
-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("20240821204113_UpdateLogTable")]
- partial class UpdateLogTable
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.8")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTimeOffset>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.NoAction)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240821204113_UpdateLogTable.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240821204113_UpdateLogTable.cs
deleted file mode 100644
index 52af9e2de..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240821204113_UpdateLogTable.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// <auto-generated />
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class UpdateLogTable : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<string>(
- name: "SourceContext",
- table: "Logs",
- type: "TEXT",
- nullable: false,
- defaultValue: "");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "SourceContext",
- table: "Logs");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240830190840_AddAuthLogTable.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240830190840_AddAuthLogTable.Designer.cs
deleted file mode 100644
index 19ba838bd..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240830190840_AddAuthLogTable.Designer.cs
+++ /dev/null
@@ -1,803 +0,0 @@
-// <auto-generated />
-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("20240830190840_AddAuthLogTable")]
- partial class AddAuthLogTable
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.8")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("nvarchar(50)");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTimeOffset>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.NoAction)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240830190840_AddAuthLogTable.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240830190840_AddAuthLogTable.cs
deleted file mode 100644
index 53cfaa3dc..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240830190840_AddAuthLogTable.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-// <auto-generated />
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddAuthLogTable : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "AuthLogs",
- columns: table => new
- {
- Id = table.Column<int>(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Timestamp = table.Column<DateTime>(type: "TEXT", nullable: false),
- Username = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- EventType = table.Column<int>(type: "nvarchar(50)", nullable: false),
- IsSuccess = table.Column<bool>(type: "INTEGER", nullable: false),
- FailureReason = table.Column<int>(type: "INTEGER", nullable: true),
- IpAddress = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
- UserAgent = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
- DeviceType = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
- OperatingSystem = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
- Browser = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
- Country = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
- AdditionalInfo = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
- RequestPath = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
- IsSuspiciousActivity = table.Column<bool>(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AuthLogs", x => x.Id);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_EventType",
- table: "AuthLogs",
- column: "EventType");
-
- migrationBuilder.CreateIndex(
- name: "IX_IpAddress",
- table: "AuthLogs",
- column: "IpAddress");
-
- migrationBuilder.CreateIndex(
- name: "IX_Timestamp",
- table: "AuthLogs",
- column: "Timestamp");
-
- migrationBuilder.CreateIndex(
- name: "IX_Username_IsSuccess_Timestamp",
- table: "AuthLogs",
- columns: new[] { "Username", "IsSuccess", "Timestamp" },
- descending: new[] { false, false, true });
-
- migrationBuilder.CreateIndex(
- name: "IX_Username_Timestamp",
- table: "AuthLogs",
- columns: new[] { "Username", "Timestamp" },
- descending: new[] { false, true });
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "AuthLogs");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240902134755_MoveSrpColsToVaultTable.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240902134755_MoveSrpColsToVaultTable.Designer.cs
deleted file mode 100644
index a68926d5c..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240902134755_MoveSrpColsToVaultTable.Designer.cs
+++ /dev/null
@@ -1,813 +0,0 @@
-// <auto-generated />
-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("20240902134755_MoveSrpColsToVaultTable")]
- partial class MoveSrpColsToVaultTable
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.8")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("nvarchar(50)");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTimeOffset>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.NoAction)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240902134755_MoveSrpColsToVaultTable.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240902134755_MoveSrpColsToVaultTable.cs
deleted file mode 100644
index 4c5703a1b..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240902134755_MoveSrpColsToVaultTable.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-// <auto-generated />
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class MoveSrpColsToVaultTable : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<string>(
- name: "Salt",
- table: "Vaults",
- type: "TEXT",
- maxLength: 100,
- nullable: false,
- defaultValue: "");
-
- migrationBuilder.AddColumn<string>(
- name: "Verifier",
- table: "Vaults",
- type: "TEXT",
- maxLength: 1000,
- nullable: false,
- defaultValue: "");
-
- // Transfer data from AliasVaultUsers to Vaults
- migrationBuilder.Sql(@"
- UPDATE Vaults
- SET Salt = (SELECT Salt FROM AliasVaultUsers WHERE AliasVaultUsers.Id = Vaults.UserId),
- Verifier = (SELECT Verifier FROM AliasVaultUsers WHERE AliasVaultUsers.Id = Vaults.UserId)
- WHERE EXISTS (SELECT 1 FROM AliasVaultUsers WHERE AliasVaultUsers.Id = Vaults.UserId);
- ");
-
- // Create new vault entries for users without existing vaults
- migrationBuilder.Sql(@"
- INSERT INTO Vaults (UserId, VaultBlob, Version, Salt, Verifier, CreatedAt, UpdatedAt)
- SELECT
- Id,
- '',
- '0.0.0',
- Salt,
- Verifier,
- DATETIME('now'),
- DATETIME('now')
- FROM AliasVaultUsers
- WHERE Id NOT IN (SELECT DISTINCT UserId FROM Vaults);
- ");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "Salt",
- table: "Vaults");
-
- migrationBuilder.DropColumn(
- name: "Verifier",
- table: "Vaults");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240902172644_RemoveSrpColsFromUserTable.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240902172644_RemoveSrpColsFromUserTable.Designer.cs
deleted file mode 100644
index 396033160..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240902172644_RemoveSrpColsFromUserTable.Designer.cs
+++ /dev/null
@@ -1,806 +0,0 @@
-// <auto-generated />
-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("20240902172644_RemoveSrpColsFromUserTable")]
- partial class RemoveSrpColsFromUserTable
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.8")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("nvarchar(50)");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTimeOffset>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.NoAction)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240902172644_RemoveSrpColsFromUserTable.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240902172644_RemoveSrpColsFromUserTable.cs
deleted file mode 100644
index 0096eed69..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240902172644_RemoveSrpColsFromUserTable.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-// <auto-generated />
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class RemoveSrpColsFromUserTable : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "Salt",
- table: "AliasVaultUsers");
-
- migrationBuilder.DropColumn(
- name: "Verifier",
- table: "AliasVaultUsers");
-
- migrationBuilder.AddColumn<DateTime>(
- name: "PasswordChangedAt",
- table: "AliasVaultUsers",
- type: "TEXT",
- nullable: false,
- defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "PasswordChangedAt",
- table: "AliasVaultUsers");
-
- migrationBuilder.AddColumn<string>(
- name: "Salt",
- table: "AliasVaultUsers",
- type: "TEXT",
- maxLength: 100,
- nullable: false,
- defaultValue: "");
-
- migrationBuilder.AddColumn<string>(
- name: "Verifier",
- table: "AliasVaultUsers",
- type: "TEXT",
- maxLength: 1000,
- nullable: false,
- defaultValue: "");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240906092833_AddVaultStatisticsColumns.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240906092833_AddVaultStatisticsColumns.Designer.cs
deleted file mode 100644
index 554a81c63..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240906092833_AddVaultStatisticsColumns.Designer.cs
+++ /dev/null
@@ -1,812 +0,0 @@
-// <auto-generated />
-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("20240906092833_AddVaultStatisticsColumns")]
- partial class AddVaultStatisticsColumns
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.8")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("nvarchar(50)");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTimeOffset>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.NoAction)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240906092833_AddVaultStatisticsColumns.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240906092833_AddVaultStatisticsColumns.cs
deleted file mode 100644
index 61ac12095..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240906092833_AddVaultStatisticsColumns.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// <auto-generated />
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddVaultStatisticsColumns : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<int>(
- name: "CredentialsCount",
- table: "Vaults",
- type: "INTEGER",
- nullable: false,
- defaultValue: 0);
-
- migrationBuilder.AddColumn<int>(
- name: "EmailClaimsCount",
- table: "Vaults",
- type: "INTEGER",
- nullable: false,
- defaultValue: 0);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "CredentialsCount",
- table: "Vaults");
-
- migrationBuilder.DropColumn(
- name: "EmailClaimsCount",
- table: "Vaults");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240911174159_AddVaultEncryptionSettings.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240911174159_AddVaultEncryptionSettings.Designer.cs
deleted file mode 100644
index 87895af1d..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240911174159_AddVaultEncryptionSettings.Designer.cs
+++ /dev/null
@@ -1,820 +0,0 @@
-// <auto-generated />
-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("20240911174159_AddVaultEncryptionSettings")]
- partial class AddVaultEncryptionSettings
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.8")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("nvarchar(50)");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTimeOffset>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("EncryptionSettings")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptionType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.NoAction)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240911174159_AddVaultEncryptionSettings.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240911174159_AddVaultEncryptionSettings.cs
deleted file mode 100644
index ba8ffd5fb..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240911174159_AddVaultEncryptionSettings.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// <auto-generated />
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddVaultEncryptionSettings : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<string>(
- name: "EncryptionSettings",
- table: "Vaults",
- type: "TEXT",
- nullable: false,
- defaultValue: "");
-
- migrationBuilder.AddColumn<string>(
- name: "EncryptionType",
- table: "Vaults",
- type: "TEXT",
- nullable: false,
- defaultValue: "");
-
- // Set default values for existing records.
- migrationBuilder.Sql(@"
- UPDATE Vaults
- SET EncryptionType = 'Argon2Id',
- EncryptionSettings = '{""DegreeOfParallelism"":4,""MemorySize"":8192,""Iterations"":1}'
- WHERE EncryptionType = ''");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "EncryptionSettings",
- table: "Vaults");
-
- migrationBuilder.DropColumn(
- name: "EncryptionType",
- table: "Vaults");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240914150600_AddRefreshTokenIpAddress.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240914150600_AddRefreshTokenIpAddress.Designer.cs
deleted file mode 100644
index 2828e4bf8..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240914150600_AddRefreshTokenIpAddress.Designer.cs
+++ /dev/null
@@ -1,828 +0,0 @@
-// <auto-generated />
-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("20240914150600_AddRefreshTokenIpAddress")]
- partial class AddRefreshTokenIpAddress
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.8")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(45)
- .HasColumnType("TEXT");
-
- b.Property<string>("PreviousTokenValue")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("nvarchar(50)");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTimeOffset>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("EncryptionSettings")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptionType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.NoAction)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240914150600_AddRefreshTokenIpAddress.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240914150600_AddRefreshTokenIpAddress.cs
deleted file mode 100644
index cde088080..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240914150600_AddRefreshTokenIpAddress.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// <auto-generated />
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddRefreshTokenIpAddress : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<string>(
- name: "IpAddress",
- table: "AliasVaultUserRefreshTokens",
- type: "TEXT",
- maxLength: 45,
- nullable: true);
-
- migrationBuilder.AddColumn<string>(
- name: "PreviousTokenValue",
- table: "AliasVaultUserRefreshTokens",
- type: "TEXT",
- maxLength: 255,
- nullable: true);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "IpAddress",
- table: "AliasVaultUserRefreshTokens");
-
- migrationBuilder.DropColumn(
- name: "PreviousTokenValue",
- table: "AliasVaultUserRefreshTokens");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240916110323_AddVaultRevisionNumber.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240916110323_AddVaultRevisionNumber.Designer.cs
deleted file mode 100644
index 0f0654bb0..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240916110323_AddVaultRevisionNumber.Designer.cs
+++ /dev/null
@@ -1,831 +0,0 @@
-// <auto-generated />
-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("20240916110323_AddVaultRevisionNumber")]
- partial class AddVaultRevisionNumber
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.8")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(45)
- .HasColumnType("TEXT");
-
- b.Property<string>("PreviousTokenValue")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("nvarchar(50)");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTimeOffset>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("EncryptionSettings")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptionType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.NoAction)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240916110323_AddVaultRevisionNumber.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240916110323_AddVaultRevisionNumber.cs
deleted file mode 100644
index d735e5507..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240916110323_AddVaultRevisionNumber.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// <auto-generated />
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddVaultRevisionNumber : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<long>(
- name: "RevisionNumber",
- table: "Vaults",
- type: "INTEGER",
- nullable: false,
- defaultValue: 0L);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "RevisionNumber",
- table: "Vaults");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240917210632_SetDefaultRevisionNumber.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240917210632_SetDefaultRevisionNumber.Designer.cs
deleted file mode 100644
index 51e38b331..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240917210632_SetDefaultRevisionNumber.Designer.cs
+++ /dev/null
@@ -1,831 +0,0 @@
-// <auto-generated />
-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("20240917210632_SetDefaultRevisionNumber")]
- partial class SetDefaultRevisionNumber
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.8")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(45)
- .HasColumnType("TEXT");
-
- b.Property<string>("PreviousTokenValue")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("nvarchar(50)");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTimeOffset>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("EncryptionSettings")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptionType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.NoAction)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240917210632_SetDefaultRevisionNumber.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240917210632_SetDefaultRevisionNumber.cs
deleted file mode 100644
index 4e7b03707..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20240917210632_SetDefaultRevisionNumber.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// <auto-generated />
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <summary>
- /// Migration to set default revision numbers for vaults.
- /// </summary>
- public partial class SetDefaultRevisionNumber : Migration
- {
- /// <summary>
- /// Applies the migration, setting incremental revision numbers for each user's vaults.
- /// </summary>
- /// <param name="migrationBuilder">The migration builder.</param>
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.Sql(@"
- UPDATE Vaults
- SET RevisionNumber = (
- SELECT COUNT(*)
- FROM Vaults AS v2
- WHERE v2.UserId = Vaults.UserId
- AND (v2.UpdatedAt < Vaults.UpdatedAt
- OR (v2.UpdatedAt = Vaults.UpdatedAt AND v2.Id <= Vaults.Id))
- ) - 1;
- ");
- }
-
- /// <summary>
- /// Reverts the migration by setting all RevisionNumber values to 0.
- /// </summary>
- /// <param name="migrationBuilder">The migration builder.</param>
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.Sql("UPDATE Vaults SET RevisionNumber = 0;");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241007153012_DatetimeOffsetToDateTime.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241007153012_DatetimeOffsetToDateTime.Designer.cs
deleted file mode 100644
index 1ff68d656..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241007153012_DatetimeOffsetToDateTime.Designer.cs
+++ /dev/null
@@ -1,831 +0,0 @@
-// <auto-generated />
-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("20241007153012_DatetimeOffsetToDateTime")]
- partial class DatetimeOffsetToDateTime
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.8")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(45)
- .HasColumnType("TEXT");
-
- b.Property<string>("PreviousTokenValue")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("nvarchar(50)");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("EncryptionSettings")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptionType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.NoAction)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241007153012_DatetimeOffsetToDateTime.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241007153012_DatetimeOffsetToDateTime.cs
deleted file mode 100644
index b996dc511..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241007153012_DatetimeOffsetToDateTime.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// <auto-generated />
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class DatetimeOffsetToDateTime : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
-
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
-
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241107205118_PreserveEmailClaimsForDeletedUsers.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241107205118_PreserveEmailClaimsForDeletedUsers.Designer.cs
deleted file mode 100644
index 14082f61f..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241107205118_PreserveEmailClaimsForDeletedUsers.Designer.cs
+++ /dev/null
@@ -1,828 +0,0 @@
-// <auto-generated />
-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("20241107105118_PreserveEmailClaimsForDeletedUsers")]
- partial class PreserveEmailClaimsForDeletedUsers
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.10")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(45)
- .HasColumnType("TEXT");
-
- b.Property<string>("PreviousTokenValue")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("nvarchar(50)");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("EncryptionSettings")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptionType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241107205118_PreserveEmailClaimsForDeletedUsers.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241107205118_PreserveEmailClaimsForDeletedUsers.cs
deleted file mode 100644
index 43f1bb02e..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241107205118_PreserveEmailClaimsForDeletedUsers.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-// <auto-generated />
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class PreserveEmailClaimsForDeletedUsers : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_Emails_UserEncryptionKeys_UserEncryptionKeyId",
- table: "Emails");
-
- migrationBuilder.DropForeignKey(
- name: "FK_UserEmailClaims_AliasVaultUsers_UserId",
- table: "UserEmailClaims");
-
- migrationBuilder.AlterColumn<string>(
- name: "UserId",
- table: "UserEmailClaims",
- type: "TEXT",
- maxLength: 255,
- nullable: true,
- oldClrType: typeof(string),
- oldType: "TEXT",
- oldMaxLength: 255);
-
- migrationBuilder.AddForeignKey(
- name: "FK_Emails_UserEncryptionKeys_UserEncryptionKeyId",
- table: "Emails",
- column: "UserEncryptionKeyId",
- principalTable: "UserEncryptionKeys",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
-
- migrationBuilder.AddForeignKey(
- name: "FK_UserEmailClaims_AliasVaultUsers_UserId",
- table: "UserEmailClaims",
- column: "UserId",
- principalTable: "AliasVaultUsers",
- principalColumn: "Id");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_Emails_UserEncryptionKeys_UserEncryptionKeyId",
- table: "Emails");
-
- migrationBuilder.DropForeignKey(
- name: "FK_UserEmailClaims_AliasVaultUsers_UserId",
- table: "UserEmailClaims");
-
- migrationBuilder.AlterColumn<string>(
- name: "UserId",
- table: "UserEmailClaims",
- type: "TEXT",
- maxLength: 255,
- nullable: false,
- defaultValue: "",
- oldClrType: typeof(string),
- oldType: "TEXT",
- oldMaxLength: 255,
- oldNullable: true);
-
- migrationBuilder.AddForeignKey(
- name: "FK_Emails_UserEncryptionKeys_UserEncryptionKeyId",
- table: "Emails",
- column: "UserEncryptionKeyId",
- principalTable: "UserEncryptionKeys",
- principalColumn: "Id");
-
- migrationBuilder.AddForeignKey(
- name: "FK_UserEmailClaims_AliasVaultUsers_UserId",
- table: "UserEmailClaims",
- column: "UserId",
- principalTable: "AliasVaultUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241204121218_AddServerSettingsTable.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241204121218_AddServerSettingsTable.Designer.cs
deleted file mode 100644
index c5a0ead3e..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241204121218_AddServerSettingsTable.Designer.cs
+++ /dev/null
@@ -1,848 +0,0 @@
-// <auto-generated />
-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("20241204121218_AddServerSettingsTable")]
- partial class AddServerSettingsTable
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "9.0.0")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(45)
- .HasColumnType("TEXT");
-
- b.Property<string>("PreviousTokenValue")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("nvarchar(50)");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("EncryptionSettings")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptionType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241204121218_AddServerSettingsTable.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241204121218_AddServerSettingsTable.cs
deleted file mode 100644
index 48b8fd347..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241204121218_AddServerSettingsTable.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// <auto-generated />
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddServerSettingsTable : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "ServerSettings",
- columns: table => new
- {
- Key = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
- Value = table.Column<string>(type: "TEXT", nullable: true),
- CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
- UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ServerSettings", x => x.Key);
- });
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "ServerSettings");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241215131807_AddTaskRunnerJobTable.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241215131807_AddTaskRunnerJobTable.Designer.cs
deleted file mode 100644
index f466f8987..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241215131807_AddTaskRunnerJobTable.Designer.cs
+++ /dev/null
@@ -1,881 +0,0 @@
-// <auto-generated />
-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("20241215131807_AddTaskRunnerJobTable")]
- partial class AddTaskRunnerJobTable
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "9.0.0")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(45)
- .HasColumnType("TEXT");
-
- b.Property<string>("PreviousTokenValue")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("nvarchar(50)");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("TEXT");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("TEXT");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("TEXT");
-
- b.Property<int>("Status")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("EncryptionSettings")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptionType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241215131807_AddTaskRunnerJobTable.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241215131807_AddTaskRunnerJobTable.cs
deleted file mode 100644
index 1d184fb7b..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241215131807_AddTaskRunnerJobTable.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// <auto-generated />
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddTaskRunnerJobTable : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "TaskRunnerJobs",
- columns: table => new
- {
- Id = table.Column<int>(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Name = table.Column<string>(type: "TEXT", nullable: false),
- RunDate = table.Column<DateTime>(type: "TEXT", nullable: false),
- StartTime = table.Column<TimeOnly>(type: "TEXT", nullable: false),
- EndTime = table.Column<TimeOnly>(type: "TEXT", nullable: true),
- Status = table.Column<int>(type: "INTEGER", nullable: false),
- ErrorMessage = table.Column<string>(type: "TEXT", nullable: true),
- IsOnDemand = table.Column<bool>(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_TaskRunnerJobs", x => x.Id);
- });
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "TaskRunnerJobs");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241220164855_AddUserBlockedStatus.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241220164855_AddUserBlockedStatus.Designer.cs
deleted file mode 100644
index 6fbcec5f0..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241220164855_AddUserBlockedStatus.Designer.cs
+++ /dev/null
@@ -1,884 +0,0 @@
-// <auto-generated />
-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("20241220164855_AddUserBlockedStatus")]
- partial class AddUserBlockedStatus
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "9.0.0")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("Blocked")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(45)
- .HasColumnType("TEXT");
-
- b.Property<string>("PreviousTokenValue")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("nvarchar(50)");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("TEXT");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("TEXT");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("TEXT");
-
- b.Property<int>("Status")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("EncryptionSettings")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptionType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("varchar");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241220164855_AddUserBlockedStatus.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241220164855_AddUserBlockedStatus.cs
deleted file mode 100644
index 1707a87dc..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241220164855_AddUserBlockedStatus.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// <auto-generated />
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddUserBlockedStatus : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<bool>(
- name: "Blocked",
- table: "AliasVaultUsers",
- type: "INTEGER",
- nullable: false,
- defaultValue: false);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "Blocked",
- table: "AliasVaultUsers");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241223201909_IncludePostgresqlFixes.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241223201909_IncludePostgresqlFixes.Designer.cs
deleted file mode 100644
index e510fb1cd..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241223201909_IncludePostgresqlFixes.Designer.cs
+++ /dev/null
@@ -1,886 +0,0 @@
-// <auto-generated />
-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("20241223201909_IncludePostgresqlFixes")]
- partial class IncludePostgresqlFixes
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "9.0.0")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("Blocked")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(45)
- .HasColumnType("TEXT");
-
- b.Property<string>("PreviousTokenValue")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("INTEGER");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("TEXT");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("TEXT");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("TEXT");
-
- b.Property<int>("Status")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("EncryptionSettings")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptionType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241223201909_IncludePostgresqlFixes.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241223201909_IncludePostgresqlFixes.cs
deleted file mode 100644
index ce0d0fd06..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241223201909_IncludePostgresqlFixes.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-// <auto-generated />
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class IncludePostgresqlFixes : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AlterColumn<string>(
- name: "ServiceName",
- table: "WorkerServiceStatuses",
- type: "TEXT",
- maxLength: 255,
- nullable: false,
- oldClrType: typeof(string),
- oldType: "varchar",
- oldMaxLength: 255);
-
- migrationBuilder.AlterColumn<int>(
- name: "EventType",
- table: "AuthLogs",
- type: "INTEGER",
- nullable: false,
- oldClrType: typeof(int),
- oldType: "nvarchar(50)");
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AlterColumn<string>(
- name: "ServiceName",
- table: "WorkerServiceStatuses",
- type: "varchar",
- maxLength: 255,
- nullable: false,
- oldClrType: typeof(string),
- oldType: "TEXT",
- oldMaxLength: 255);
-
- migrationBuilder.AlterColumn<int>(
- name: "EventType",
- table: "AuthLogs",
- type: "nvarchar(50)",
- nullable: false,
- oldClrType: typeof(int),
- oldType: "INTEGER");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241225220908_UpdateAliasVaultEmailClaimNull.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241225220908_UpdateAliasVaultEmailClaimNull.Designer.cs
deleted file mode 100644
index 6c71a53a6..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241225220908_UpdateAliasVaultEmailClaimNull.Designer.cs
+++ /dev/null
@@ -1,887 +0,0 @@
-// <auto-generated />
-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("20241225220908_UpdateAliasVaultEmailClaimNull")]
- partial class UpdateAliasVaultEmailClaimNull
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "9.0.0")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("Blocked")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(45)
- .HasColumnType("TEXT");
-
- b.Property<string>("PreviousTokenValue")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("INTEGER");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("TEXT");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("TEXT");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("TEXT");
-
- b.Property<int>("Status")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("EncryptionSettings")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptionType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241225220908_UpdateAliasVaultEmailClaimNull.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241225220908_UpdateAliasVaultEmailClaimNull.cs
deleted file mode 100644
index 857e2b11c..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20241225220908_UpdateAliasVaultEmailClaimNull.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// <auto-generated />
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class UpdateAliasVaultEmailClaimNull : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_UserEmailClaims_AliasVaultUsers_UserId",
- table: "UserEmailClaims");
-
- migrationBuilder.AddForeignKey(
- name: "FK_UserEmailClaims_AliasVaultUsers_UserId",
- table: "UserEmailClaims",
- column: "UserId",
- principalTable: "AliasVaultUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.SetNull);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_UserEmailClaims_AliasVaultUsers_UserId",
- table: "UserEmailClaims");
-
- migrationBuilder.AddForeignKey(
- name: "FK_UserEmailClaims_AliasVaultUsers_UserId",
- table: "UserEmailClaims",
- column: "UserId",
- principalTable: "AliasVaultUsers",
- principalColumn: "Id");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250210101257_AddAuthLogClientHeader.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250210101257_AddAuthLogClientHeader.Designer.cs
deleted file mode 100644
index 0c7f8f1a9..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250210101257_AddAuthLogClientHeader.Designer.cs
+++ /dev/null
@@ -1,891 +0,0 @@
-// <auto-generated />
-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("20250210101257_AddAuthLogClientHeader")]
- partial class AddAuthLogClientHeader
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "9.0.0")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("Blocked")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(45)
- .HasColumnType("TEXT");
-
- b.Property<string>("PreviousTokenValue")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Client")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("INTEGER");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("TEXT");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("TEXT");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("TEXT");
-
- b.Property<int>("Status")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("EncryptionSettings")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptionType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250210101257_AddAuthLogClientHeader.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250210101257_AddAuthLogClientHeader.cs
deleted file mode 100644
index 2f16cff85..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250210101257_AddAuthLogClientHeader.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// <auto-generated/>
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddAuthLogClientHeader : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<string>(
- name: "Client",
- table: "AuthLogs",
- type: "TEXT",
- maxLength: 100,
- nullable: true);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "Client",
- table: "AuthLogs");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250210122722_AddVaultClientColumn.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250210122722_AddVaultClientColumn.Designer.cs
deleted file mode 100644
index c9a0a3e9d..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250210122722_AddVaultClientColumn.Designer.cs
+++ /dev/null
@@ -1,895 +0,0 @@
-// <auto-generated />
-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("20250210122722_AddVaultClientColumn")]
- partial class AddVaultClientColumn
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "9.0.0")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("Blocked")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(45)
- .HasColumnType("TEXT");
-
- b.Property<string>("PreviousTokenValue")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Client")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("INTEGER");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("TEXT");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("TEXT");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("TEXT");
-
- b.Property<int>("Status")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("EncryptionSettings")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptionType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250210122722_AddVaultClientColumn.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250210122722_AddVaultClientColumn.cs
deleted file mode 100644
index dbb1f08d0..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250210122722_AddVaultClientColumn.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// <auto-generated/>
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddVaultClientColumn : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<string>(
- name: "Client",
- table: "Vaults",
- type: "TEXT",
- maxLength: 255,
- nullable: true);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "Client",
- table: "Vaults");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250320101616_AddEmailClaimDisabledFlag.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250320101616_AddEmailClaimDisabledFlag.Designer.cs
deleted file mode 100644
index eb5a444c9..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250320101616_AddEmailClaimDisabledFlag.Designer.cs
+++ /dev/null
@@ -1,898 +0,0 @@
-// <auto-generated />
-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("20250320101616_AddEmailClaimDisabledFlag")]
- partial class AddEmailClaimDisabledFlag
- {
- /// <inheritdoc />
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "9.0.3")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("Blocked")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(45)
- .HasColumnType("TEXT");
-
- b.Property<string>("PreviousTokenValue")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Client")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("INTEGER");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("TEXT");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("TEXT");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("TEXT");
-
- b.Property<int>("Status")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("Disabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("EncryptionSettings")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptionType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250320101616_AddEmailClaimDisabledFlag.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250320101616_AddEmailClaimDisabledFlag.cs
deleted file mode 100644
index 2272212bf..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/20250320101616_AddEmailClaimDisabledFlag.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// <auto-generated/>
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- /// <inheritdoc />
- public partial class AddEmailClaimDisabledFlag : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<bool>(
- name: "Disabled",
- table: "UserEmailClaims",
- type: "INTEGER",
- nullable: false,
- defaultValue: false);
- }
-
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "Disabled",
- table: "UserEmailClaims");
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/AliasServerDbContextSqliteModelSnapshot.cs b/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/AliasServerDbContextSqliteModelSnapshot.cs
deleted file mode 100644
index 645f98ddf..000000000
--- a/apps/server/Databases/AliasServerDb/Migrations/SqliteMigrations/AliasServerDbContextSqliteModelSnapshot.cs
+++ /dev/null
@@ -1,895 +0,0 @@
-// <auto-generated />
-using System;
-using AliasServerDb;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-
-#nullable disable
-
-namespace AliasServerDb.Migrations.SqliteMigrations
-{
- [DbContext(typeof(AliasServerDbContextSqlite))]
- partial class AliasServerDbContextSqliteModelSnapshot : ModelSnapshot
- {
- protected override void BuildModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "9.0.3")
- .HasAnnotation("Proxies:ChangeTracking", false)
- .HasAnnotation("Proxies:CheckEquality", false)
- .HasAnnotation("Proxies:LazyLoading", true);
-
- modelBuilder.Entity("AliasServerDb.AdminRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AdminUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime?>("LastPasswordChanged")
- .HasColumnType("TEXT");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AdminUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultRole", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultRoles");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Property<string>("Id")
- .HasColumnType("TEXT");
-
- b.Property<int>("AccessFailedCount")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("Blocked")
- .HasColumnType("INTEGER");
-
- b.Property<string>("ConcurrencyStamp")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Email")
- .HasColumnType("TEXT");
-
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedEmail")
- .HasColumnType("TEXT");
-
- b.Property<string>("NormalizedUserName")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("PasswordChangedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("PasswordHash")
- .HasColumnType("TEXT");
-
- b.Property<string>("PhoneNumber")
- .HasColumnType("TEXT");
-
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("INTEGER");
-
- b.Property<string>("SecurityStamp")
- .HasColumnType("TEXT");
-
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserName")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("AliasVaultUsers");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceIdentifier")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("ExpireDate")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(45)
- .HasColumnType("TEXT");
-
- b.Property<string>("PreviousTokenValue")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AliasVaultUserRefreshTokens");
- });
-
- modelBuilder.Entity("AliasServerDb.AuthLog", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("AdditionalInfo")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Browser")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Client")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("Country")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DeviceType")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<int>("EventType")
- .HasColumnType("INTEGER");
-
- b.Property<int?>("FailureReason")
- .HasColumnType("INTEGER");
-
- b.Property<string>("IpAddress")
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsSuccess")
- .HasColumnType("INTEGER");
-
- b.Property<bool>("IsSuspiciousActivity")
- .HasColumnType("INTEGER");
-
- b.Property<string>("OperatingSystem")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<string>("RequestPath")
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Timestamp")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserAgent")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("Username")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex(new[] { "EventType" }, "IX_EventType");
-
- b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");
-
- b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");
-
- b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")
- .IsDescending(false, false, true);
-
- b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")
- .IsDescending(false, true);
-
- b.ToTable("AuthLogs");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("DateSystem")
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptedSymmetricKey")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("From")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("FromLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageHtml")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePlain")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessagePreview")
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageSource")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<bool>("PushNotificationSent")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Subject")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("To")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToDomain")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("ToLocal")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<Guid>("UserEncryptionKeyId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<bool>("Visible")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.HasIndex("Date");
-
- b.HasIndex("DateSystem");
-
- b.HasIndex("PushNotificationSent");
-
- b.HasIndex("ToLocal");
-
- b.HasIndex("UserEncryptionKeyId");
-
- b.HasIndex("Visible");
-
- b.ToTable("Emails");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<byte[]>("Bytes")
- .IsRequired()
- .HasColumnType("BLOB");
-
- b.Property<DateTime>("Date")
- .HasColumnType("TEXT");
-
- b.Property<int>("EmailId")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Filename")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("Filesize")
- .HasColumnType("INTEGER");
-
- b.Property<string>("MimeType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("EmailId");
-
- b.ToTable("EmailAttachments");
- });
-
- modelBuilder.Entity("AliasServerDb.Log", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("Application")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("Exception")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Level")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("TEXT");
-
- b.Property<string>("LogEvent")
- .IsRequired()
- .HasColumnType("TEXT")
- .HasColumnName("LogEvent");
-
- b.Property<string>("Message")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("MessageTemplate")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Properties")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("SourceContext")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("TimeStamp")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Application");
-
- b.HasIndex("TimeStamp");
-
- b.ToTable("Logs", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
- {
- b.Property<string>("Key")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("Key");
-
- b.ToTable("ServerSettings");
- });
-
- modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<TimeOnly?>("EndTime")
- .HasColumnType("TEXT");
-
- b.Property<string>("ErrorMessage")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsOnDemand")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("RunDate")
- .HasColumnType("TEXT");
-
- b.Property<TimeOnly>("StartTime")
- .HasColumnType("TEXT");
-
- b.Property<int>("Status")
- .HasColumnType("INTEGER");
-
- b.HasKey("Id");
-
- b.ToTable("TaskRunnerJobs");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Address")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressDomain")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("AddressLocal")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("Disabled")
- .HasColumnType("INTEGER");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("Address")
- .IsUnique();
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEmailClaims");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<bool>("IsPrimary")
- .HasColumnType("INTEGER");
-
- b.Property<string>("PublicKey")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserEncryptionKeys");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("TEXT");
-
- b.Property<string>("Client")
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("CreatedAt")
- .HasColumnType("TEXT");
-
- b.Property<int>("CredentialsCount")
- .HasColumnType("INTEGER");
-
- b.Property<int>("EmailClaimsCount")
- .HasColumnType("INTEGER");
-
- b.Property<string>("EncryptionSettings")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("EncryptionType")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<int>("FileSize")
- .HasColumnType("INTEGER");
-
- b.Property<long>("RevisionNumber")
- .HasColumnType("INTEGER");
-
- b.Property<string>("Salt")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("UpdatedAt")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.Property<string>("VaultBlob")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property<string>("Verifier")
- .IsRequired()
- .HasMaxLength(1000)
- .HasColumnType("TEXT");
-
- b.Property<string>("Version")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("Vaults");
- });
-
- modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("CurrentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<string>("DesiredStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("TEXT");
-
- b.Property<DateTime>("Heartbeat")
- .HasColumnType("TEXT");
-
- b.Property<string>("ServiceName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("WorkerServiceStatuses");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("FriendlyName")
- .HasColumnType("TEXT");
-
- b.Property<string>("Xml")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("DataProtectionKeys");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property<string>("ClaimType")
- .HasColumnType("TEXT");
-
- b.Property<string>("ClaimValue")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("Id");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderKey")
- .HasColumnType("TEXT");
-
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("TEXT");
-
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("RoleId")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
- {
- b.Property<string>("UserId")
- .HasColumnType("TEXT");
-
- b.Property<string>("LoginProvider")
- .HasColumnType("TEXT");
-
- b.Property<string>("Name")
- .HasColumnType("TEXT");
-
- b.Property<string>("Value")
- .HasColumnType("TEXT");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.HasOne("AliasServerDb.UserEncryptionKey", "EncryptionKey")
- .WithMany("Emails")
- .HasForeignKey("UserEncryptionKeyId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("EncryptionKey");
- });
-
- modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>
- {
- b.HasOne("AliasServerDb.Email", "Email")
- .WithMany("Attachments")
- .HasForeignKey("EmailId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Email");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EmailClaims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("EncryptionKeys")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.Vault", b =>
- {
- b.HasOne("AliasServerDb.AliasVaultUser", "User")
- .WithMany("Vaults")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>
- {
- b.Navigation("EmailClaims");
-
- b.Navigation("EncryptionKeys");
-
- b.Navigation("Vaults");
- });
-
- modelBuilder.Entity("AliasServerDb.Email", b =>
- {
- b.Navigation("Attachments");
- });
-
- modelBuilder.Entity("AliasServerDb.UserEncryptionKey", b =>
- {
- b.Navigation("Emails");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/PostgresqlDbContextFactory.cs b/apps/server/Databases/AliasServerDb/PostgresqlDbContextFactory.cs
index e2150f09d..5afbd2276 100644
--- a/apps/server/Databases/AliasServerDb/PostgresqlDbContextFactory.cs
+++ b/apps/server/Databases/AliasServerDb/PostgresqlDbContextFactory.cs
@@ -11,7 +11,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
/// <summary>
-/// The AliasServerDbContextFactory interface.
+/// The PostgreSQL DbContext factory.
/// </summary>
public class PostgresqlDbContextFactory : IAliasServerDbContextFactory
{
@@ -32,7 +32,7 @@ public class PostgresqlDbContextFactory : IAliasServerDbContextFactory
var optionsBuilder = new DbContextOptionsBuilder<AliasServerDbContext>();
ConfigureDbContextOptions(optionsBuilder);
- return new AliasServerDbContextPostgresql(optionsBuilder.Options);
+ return new AliasServerDbContext(optionsBuilder.Options);
}
/// <inheritdoc/>
diff --git a/apps/server/Databases/AliasServerDb/SqliteDbContextFactory.cs b/apps/server/Databases/AliasServerDb/SqliteDbContextFactory.cs
deleted file mode 100644
index d93ddc3fd..000000000
--- a/apps/server/Databases/AliasServerDb/SqliteDbContextFactory.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//-----------------------------------------------------------------------
-// <copyright file="SqliteDbContextFactory.cs" company="lanedirt">
-// Copyright (c) lanedirt. All rights reserved.
-// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
-// </copyright>
-//-----------------------------------------------------------------------
-
-namespace AliasServerDb;
-
-using Microsoft.EntityFrameworkCore;
-using Microsoft.Extensions.Configuration;
-
-/// <summary>
-/// The AliasServerDbContextFactory interface.
-/// </summary>
-public class SqliteDbContextFactory : IAliasServerDbContextFactory
-{
- private readonly IConfiguration _configuration;
-
- /// <summary>
- /// Initializes a new instance of the <see cref="SqliteDbContextFactory"/> class.
- /// </summary>
- /// <param name="configuration">The configuration.</param>
- public SqliteDbContextFactory(IConfiguration configuration)
- {
- _configuration = configuration;
- }
-
- /// <inheritdoc/>
- public void ConfigureDbContextOptions(DbContextOptionsBuilder optionsBuilder)
- {
- var connectionString = _configuration.GetConnectionString("AliasServerDbContext") +
- ";Mode=ReadWriteCreate;Cache=Shared";
-
- optionsBuilder
- .UseSqlite(connectionString, options => options.CommandTimeout(60))
- .UseLazyLoadingProxies();
- }
-
- /// <inheritdoc/>
- public AliasServerDbContext CreateDbContext()
- {
- var optionsBuilder = new DbContextOptionsBuilder<AliasServerDbContext>();
- ConfigureDbContextOptions(optionsBuilder);
- return new AliasServerDbContextSqlite(optionsBuilder.Options);
- }
-
- /// <inheritdoc/>
- public Task<AliasServerDbContext> CreateDbContextAsync(CancellationToken cancellationToken = default)
- {
- return Task.FromResult(CreateDbContext());
- }
-}
diff --git a/apps/server/Utilities/AliasVault.InstallCli/Program.cs b/apps/server/Utilities/AliasVault.InstallCli/Program.cs
index ebe8bfb83..7c5332417 100644
--- a/apps/server/Utilities/AliasVault.InstallCli/Program.cs
+++ b/apps/server/Utilities/AliasVault.InstallCli/Program.cs
@@ -11,7 +11,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
// Add return type for top-level statements
-return await Run(args);
+return Run(args);
/// <summary>
/// Handles the migration of data between SQLite and PostgreSQL databases and password hashing utilities.
@@ -23,13 +23,12 @@ public static partial class Program
/// </summary>
/// <param name="args">The command-line arguments.</param>
/// <returns>The exit code of the program.</returns>
- public static async Task<int> Run(string[] args)
+ public static int Run(string[] args)
{
if (args.Length == 0)
{
Console.WriteLine("Usage:");
Console.WriteLine(" hash-password <password>");
- Console.WriteLine(" migrate-sqlite <path-to-sqlite-db>");
return 1;
}
@@ -44,19 +43,16 @@ public static partial class Program
return HashPassword(args[1]);
+ // The implementation for this command was removed in version 0.18.0 onwards. The command is still here for
+ // backwards compatibility, but it does nothing and returns an error to the user. This placeholder can be
+ // removed in a future version.
case "migrate-sqlite":
- if (args.Length != 3)
- {
- Console.WriteLine("Usage: migrate-sqlite <path-to-sqlite-db> <postgresql-connection-string>");
- return 1;
- }
-
- return await MigrateSqliteToPostgres(args[1], args[2]);
+ Console.WriteLine("SQLite migration has been removed from version 0.18.0 onwards. You'll need to update to a previous version (0.17.0 or lower) to run this script. Follow the official docs.");
+ return 1;
default:
Console.WriteLine("Unknown command. Available commands:");
Console.WriteLine(" hash-password <password>");
- Console.WriteLine(" migrate-sqlite <path-to-sqlite-db> <postgresql-connection-string>");
return 1;
}
}
@@ -76,274 +72,4 @@ public static partial class Program
Console.WriteLine(hashedPassword);
return 0;
}
-
- /// <summary>
- /// Migrates data from a SQLite database to a PostgreSQL database.
- /// </summary>
- /// <param name="sqliteDbPath">The file path to the source SQLite database.</param>
- /// <param name="pgConnString">The connection string to the PostgreSQL database.</param>
- /// <returns>
- /// Returns 0 if migration was successful, 1 if an error occurred.
- /// </returns>
- /// <exception cref="Exception">Thrown when a migration error occurs.</exception>
- private static async Task<int> MigrateSqliteToPostgres(string sqliteDbPath, string pgConnString)
- {
- try
- {
- if (!File.Exists(sqliteDbPath))
- {
- Console.WriteLine($"Error: SQLite database not found at {sqliteDbPath}");
- return 1;
- }
-
- Console.WriteLine($"Migrating SQLite database to PostgreSQL - start");
-
- // Create connections to both databases
- var sqliteConnString = $"Data Source={sqliteDbPath}";
-
- // Create contexts
- var optionsBuilderSqlite = new DbContextOptionsBuilder<AliasServerDbContext>()
- .UseSqlite(sqliteConnString);
-
- var optionsBuilderPg = new DbContextOptionsBuilder<AliasServerDbContext>()
- .UseNpgsql(pgConnString);
-
- // Make sure sqlite is on latest version migration
- Console.WriteLine("Update sqlite database to latest version...");
- await using var sqliteContext = new AliasServerDbContextSqlite(optionsBuilderSqlite.Options);
- await sqliteContext.Database.MigrateAsync();
- Console.WriteLine("Updating finished.");
-
- // Make sure postgres is on latest version migration
- Console.WriteLine("Update postgres database to latest version...");
- await using var pgContext = new AliasServerDbContextPostgresql(optionsBuilderPg.Options);
- await pgContext.Database.MigrateAsync();
- Console.WriteLine("Updating finished.");
-
- Console.WriteLine("Truncating existing tables in reverse dependency order...");
-
- // Truncate tables in reverse order of dependencies
- await TruncateTable(pgContext.EmailAttachments, "EmailAttachments");
- await TruncateTable(pgContext.Emails, "Emails");
- await TruncateTable(pgContext.UserTokens, "UserTokens");
- await TruncateTable(pgContext.UserRoles, "UserRoles");
- await TruncateTable(pgContext.UserLogin, "UserLogins");
- await TruncateTable(pgContext.UserEmailClaims, "UserEmailClaims");
- await TruncateTable(pgContext.Vaults, "Vaults");
- await TruncateTable(pgContext.UserEncryptionKeys, "UserEncryptionKeys");
- await TruncateTable(pgContext.AliasVaultUserRefreshTokens, "AliasVaultUserRefreshTokens");
- await TruncateTable(pgContext.Logs, "Logs");
- await TruncateTable(pgContext.AuthLogs, "AuthLogs");
- await TruncateTable(pgContext.DataProtectionKeys, "DataProtectionKeys");
- await TruncateTable(pgContext.ServerSettings, "ServerSettings");
- await TruncateTable(pgContext.TaskRunnerJobs, "TaskRunnerJobs");
- await TruncateTable(pgContext.AliasVaultUsers, "AliasVaultUsers");
- await TruncateTable(pgContext.AliasVaultRoles, "AliasVaultRoles");
- await TruncateTable(pgContext.AdminUsers, "AdminUsers");
-
- Console.WriteLine("Starting content migration...");
-
- // First, migrate tables without foreign key dependencies
- await MigrateTable(sqliteContext.AliasVaultRoles, pgContext.AliasVaultRoles, pgContext, "AliasVaultRoles");
- await MigrateTable(sqliteContext.AliasVaultUsers, pgContext.AliasVaultUsers, pgContext, "AliasVaultUsers");
- await MigrateTable(sqliteContext.ServerSettings, pgContext.ServerSettings, pgContext, "ServerSettings");
- await MigrateTable(sqliteContext.TaskRunnerJobs, pgContext.TaskRunnerJobs, pgContext, "TaskRunnerJobs", true);
- await MigrateTable(sqliteContext.DataProtectionKeys, pgContext.DataProtectionKeys, pgContext, "DataProtectionKeys", true);
- await MigrateTable(sqliteContext.Logs, pgContext.Logs, pgContext, "Logs", true);
- await MigrateTable(sqliteContext.AuthLogs, pgContext.AuthLogs, pgContext, "AuthLogs", true);
- await MigrateTable(sqliteContext.AdminUsers, pgContext.AdminUsers, pgContext, "AdminUsers");
-
- // Then migrate tables with foreign key dependencies
- await MigrateTable(sqliteContext.AliasVaultUserRefreshTokens, pgContext.AliasVaultUserRefreshTokens, pgContext, "AliasVaultUserRefreshTokens");
- await MigrateTable(sqliteContext.UserEncryptionKeys, pgContext.UserEncryptionKeys, pgContext, "UserEncryptionKeys");
- await MigrateTable(sqliteContext.UserEmailClaims, pgContext.UserEmailClaims, pgContext, "UserEmailClaims");
- await MigrateTable(sqliteContext.Vaults, pgContext.Vaults, pgContext, "Vaults");
-
- // Identity framework related tables
- await MigrateTable(sqliteContext.UserRoles, pgContext.UserRoles, pgContext, "UserRoles");
- await MigrateTable(sqliteContext.UserLogin, pgContext.UserLogin, pgContext, "UserLogins");
- await MigrateTable(sqliteContext.UserTokens, pgContext.UserTokens, pgContext, "UserTokens");
-
- // Email related tables (last due to dependencies)
- await MigrateTable(sqliteContext.Emails, pgContext.Emails, pgContext, "Emails", true);
- await MigrateTable(sqliteContext.EmailAttachments, pgContext.EmailAttachments, pgContext, "EmailAttachments", true);
-
- Console.WriteLine("Migration completed successfully!");
- return 0;
- }
- catch (Exception ex)
- {
- Console.WriteLine($"Error during migration: {ex.Message}");
- Console.WriteLine(ex.InnerException);
- return 1;
- }
- }
-
- /// <summary>
- /// Truncates a table in the PostgreSQL database.
- /// </summary>
- /// <typeparam name="T">The entity type of the table being truncated.</typeparam>
- /// <param name="table">The database table to truncate.</param>
- /// <param name="tableName">The name of the table being truncated (for logging purposes).</param>
- /// <returns>A task representing the asynchronous truncation operation.</returns>
- private static async Task TruncateTable<T>(DbSet<T> table, string tableName)
- where T : class
- {
- Console.WriteLine($"Truncating table {tableName}...");
- var count = await table.CountAsync();
- if (count > 0)
- {
- await table.ExecuteDeleteAsync();
- Console.WriteLine($"Removed {count} records from {tableName}");
- }
- }
-
- /// <summary>
- /// Migrates data from one database table to another, handling the transfer in batches.
- /// </summary>
- /// <typeparam name="T">The entity type of the table being migrated.</typeparam>
- /// <param name="source">The source database table.</param>
- /// <param name="destination">The destination database table.</param>
- /// <param name="destinationContext">The destination database context.</param>
- /// <param name="tableName">The name of the table being migrated (for logging purposes).</param>
- /// <param name="resetSequence">Whether to reset the sequence for the table after migration.</param>
- /// <returns>A task representing the asynchronous migration operation.</returns>
- /// <exception cref="ArgumentException">
- /// Thrown when the number of records in source and destination tables don't match after migration.
- /// </exception>
- /// <exception cref="DbUpdateConcurrencyException">
- /// Thrown when a concurrency conflict occurs during the migration.
- /// </exception>
- private static async Task MigrateTable<T>(
- DbSet<T> source,
- DbSet<T> destination,
- DbContext destinationContext,
- string tableName,
- bool resetSequence = false)
- where T : class
- {
- Console.WriteLine($"Migrating {tableName}...");
-
- var items = await source.ToListAsync();
- Console.WriteLine($"Found {items.Count} records to migrate");
-
- if (items.Count > 0)
- {
- // Get entity type from the model to check annotations
- var entityType = destinationContext.Model.FindEntityType(typeof(T));
-
- foreach (var item in items)
- {
- HandleMaxLengthConstraints(item, entityType!, tableName);
- }
-
- const int batchSize = 50;
- foreach (var batch in items.Chunk(batchSize))
- {
- try
- {
- await destination.AddRangeAsync(batch);
- await destinationContext.SaveChangesAsync();
- Console.WriteLine($"Migrated {batch.Length} records from {tableName}");
- }
- catch (DbUpdateConcurrencyException ex)
- {
- Console.WriteLine($"Concurrency conflict occurred during migration of {tableName}...");
- await HandleConcurrencyConflict(ex, destinationContext);
- Console.WriteLine($"Concurrency conflict resolved, {batch.Length} records inserted");
- }
- }
-
- // Handle sequence reset logic...
- if (resetSequence && destinationContext.Database.ProviderName == "Npgsql.EntityFrameworkCore.PostgreSQL")
- {
- await ResetSequence<T>(destinationContext, tableName);
- }
- }
-
- // Ensure that the amount of records in the source and destination tables match
- if (await source.CountAsync() > await destination.CountAsync())
- {
- throw new ArgumentException($"The amount of records in the source is greater than the destination. Check if the migration is working correctly.");
- }
- }
-
- /// <summary>
- /// Handles max length constraints for string properties in an entity.
- /// </summary>
- /// <typeparam name="T">The entity type containing the properties to be processed.</typeparam>
- /// <param name="item">The entity instance containing the properties to be processed.</param>
- /// <param name="entityType">The entity type to be processed.</param>
- /// <param name="tableName">The name of the table being processed (for logging purposes).</param>
- private static void HandleMaxLengthConstraints<T>(T item, IEntityType entityType, string tableName)
- where T : class
- {
- foreach (var property in entityType.GetProperties())
- {
- // Only process string properties
- if (property.ClrType == typeof(string))
- {
- var maxLength = property.GetMaxLength();
- if (maxLength.HasValue)
- {
- var propertyInfo = typeof(T).GetProperty(property.Name);
- var value = propertyInfo?.GetValue(item) as string;
-
- if (value?.Length > maxLength.Value)
- {
- propertyInfo!.SetValue(item, value.Substring(0, maxLength.Value));
- Console.WriteLine($"Truncated {property.Name} in {tableName} from {value.Length} to {maxLength.Value} characters");
- }
- }
- }
- }
- }
-
- /// <summary>
- /// Resets the sequence for a table in the PostgreSQL database.
- /// </summary>
- /// <typeparam name="T">The entity type of the table being reset.</typeparam>
- /// <param name="destinationContext">The destination database context.</param>
- /// <param name="tableName">The name of the table being reset (for logging purposes).</param>
- /// <returns>A task representing the asynchronous operation.</returns>
- private static async Task ResetSequence<T>(DbContext destinationContext, string tableName)
- where T : class
- {
- var tablePgName = destinationContext.Model.FindEntityType(typeof(T))?.GetTableName();
- if (!string.IsNullOrEmpty(tablePgName))
- {
- var schema = destinationContext.Model.FindEntityType(typeof(T))?.GetSchema() ?? "public";
- var sql = $"""
- SELECT setval(pg_get_serial_sequence('{schema}."{tablePgName}"', 'Id'),
- (SELECT COALESCE(MAX("Id"::integer), 0) + 1 FROM {schema}."{tablePgName}"), false);
- """;
- await destinationContext.Database.ExecuteSqlRawAsync(sql);
- Console.WriteLine($"Reset sequence for {tableName}");
- }
- }
-
- /// <summary>
- /// Handles a concurrency conflict by updating the original values with the database values.
- /// </summary>
- /// <param name="ex">The DbUpdateConcurrencyException that occurred.</param>
- /// <param name="destinationContext">The destination database context.</param>
- /// <returns>A task representing the asynchronous operation.</returns>
- private static async Task HandleConcurrencyConflict(
- DbUpdateConcurrencyException ex,
- DbContext destinationContext)
- {
- foreach (var entry in ex.Entries)
- {
- var databaseValues = await entry.GetDatabaseValuesAsync();
- if (databaseValues == null)
- {
- entry.State = EntityState.Detached;
- }
- else
- {
- entry.OriginalValues.SetValues(databaseValues);
- await destinationContext.SaveChangesAsync();
- }
- }
- }
}