Skip to content

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

Update migrations (#2159)

Leendert de Borstcf8425292930
diff --git a/apps/server/Databases/AliasClientDb/Migrations/20260918090100_2.1.1-ItemChildManifestTrigger.cs b/apps/server/Databases/AliasClientDb/Migrations/20260918090100_2.1.1-ItemChildManifestTrigger.cs
index d3e777f75..076946550 100644
--- a/apps/server/Databases/AliasClientDb/Migrations/20260918090100_2.1.1-ItemChildManifestTrigger.cs
+++ b/apps/server/Databases/AliasClientDb/Migrations/20260918090100_2.1.1-ItemChildManifestTrigger.cs
@@ -8,6 +8,46 @@ namespace AliasClientDb.Migrations
/// <inheritdoc />
public partial class _211ItemChildManifestTrigger : Migration
{
+ private const string CreateTriggers = """
+ CREATE TRIGGER IF NOT EXISTS "TR_Items_ClearTombstoneBeforeReturn"
+ BEFORE UPDATE OF "ManifestId" ON "Items"
+ FOR EACH ROW WHEN OLD."ManifestId" <> NEW."ManifestId"
+ AND EXISTS (SELECT 1 FROM "Items" WHERE "ManifestId" = NEW."ManifestId" AND "Id" = NEW."Id" AND "IsDeleted" = 1)
+ BEGIN
+ DELETE FROM "FieldValues" WHERE "ItemId" = NEW."Id" AND "ManifestId" = NEW."ManifestId";
+ DELETE FROM "FieldHistories" WHERE "ItemId" = NEW."Id" AND "ManifestId" = NEW."ManifestId";
+ DELETE FROM "ItemTags" WHERE "ItemId" = NEW."Id" AND "ManifestId" = NEW."ManifestId";
+ DELETE FROM "Attachments" WHERE "ItemId" = NEW."Id" AND "ManifestId" = NEW."ManifestId";
+ DELETE FROM "Passkeys" WHERE "ItemId" = NEW."Id" AND "ManifestId" = NEW."ManifestId";
+ DELETE FROM "TotpCodes" WHERE "ItemId" = NEW."Id" AND "ManifestId" = NEW."ManifestId";
+ DELETE FROM "ItemStats" WHERE "Id" = NEW."Id" AND "ManifestId" = NEW."ManifestId";
+ DELETE FROM "Items" WHERE "ManifestId" = NEW."ManifestId" AND "Id" = NEW."Id" AND "IsDeleted" = 1;
+ END;
+
+ CREATE TRIGGER IF NOT EXISTS "TR_Items_ResyncChildManifestIds"
+ AFTER UPDATE OF "ManifestId" ON "Items"
+ FOR EACH ROW WHEN OLD."ManifestId" <> NEW."ManifestId"
+ BEGIN
+ INSERT INTO "Tags" ("ManifestId", "Id", "Name", "Color", "DisplayOrder", "CreatedAt", "UpdatedAt", "IsDeleted")
+ SELECT NEW."ManifestId", "Id", "Name", "Color", "DisplayOrder", "CreatedAt", NEW."UpdatedAt", "IsDeleted" FROM "Tags"
+ WHERE "ManifestId" = OLD."ManifestId" AND "Id" IN (SELECT "TagId" FROM "ItemTags" WHERE "ManifestId" = OLD."ManifestId" AND "ItemId" = NEW."Id")
+ ON CONFLICT ("ManifestId", "Id") DO UPDATE SET "Name" = excluded."Name", "Color" = excluded."Color", "DisplayOrder" = excluded."DisplayOrder", "UpdatedAt" = excluded."UpdatedAt", "IsDeleted" = 0 WHERE "IsDeleted" = 1 AND excluded."IsDeleted" = 0;
+ INSERT INTO "FieldDefinitions" ("ManifestId", "Id", "FieldType", "Label", "IsMultiValue", "IsHidden", "EnableHistory", "Weight", "ApplicableToTypes", "CreatedAt", "UpdatedAt", "IsDeleted")
+ SELECT NEW."ManifestId", "Id", "FieldType", "Label", "IsMultiValue", "IsHidden", "EnableHistory", "Weight", "ApplicableToTypes", "CreatedAt", NEW."UpdatedAt", "IsDeleted" FROM "FieldDefinitions"
+ WHERE "ManifestId" = OLD."ManifestId" AND "Id" IN (SELECT "FieldDefinitionId" FROM "FieldValues" WHERE "ManifestId" = OLD."ManifestId" AND "ItemId" = NEW."Id" UNION SELECT "FieldDefinitionId" FROM "FieldHistories" WHERE "ManifestId" = OLD."ManifestId" AND "ItemId" = NEW."Id")
+ ON CONFLICT ("ManifestId", "Id") DO UPDATE SET "FieldType" = excluded."FieldType", "Label" = excluded."Label", "IsMultiValue" = excluded."IsMultiValue", "IsHidden" = excluded."IsHidden", "EnableHistory" = excluded."EnableHistory", "Weight" = excluded."Weight", "ApplicableToTypes" = excluded."ApplicableToTypes", "UpdatedAt" = excluded."UpdatedAt", "IsDeleted" = 0 WHERE "IsDeleted" = 1 AND excluded."IsDeleted" = 0;
+ UPDATE "FieldValues" SET "ManifestId" = NEW."ManifestId" WHERE "ItemId" = NEW."Id" AND "ManifestId" = OLD."ManifestId";
+ UPDATE "FieldHistories" SET "ManifestId" = NEW."ManifestId" WHERE "ItemId" = NEW."Id" AND "ManifestId" = OLD."ManifestId";
+ UPDATE "ItemTags" SET "ManifestId" = NEW."ManifestId" WHERE "ItemId" = NEW."Id" AND "ManifestId" = OLD."ManifestId";
+ UPDATE "Attachments" SET "ManifestId" = NEW."ManifestId" WHERE "ItemId" = NEW."Id" AND "ManifestId" = OLD."ManifestId";
+ UPDATE "Passkeys" SET "ManifestId" = NEW."ManifestId" WHERE "ItemId" = NEW."Id" AND "ManifestId" = OLD."ManifestId";
+ UPDATE "TotpCodes" SET "ManifestId" = NEW."ManifestId" WHERE "ItemId" = NEW."Id" AND "ManifestId" = OLD."ManifestId";
+ UPDATE "ItemStats" SET "ManifestId" = NEW."ManifestId" WHERE "Id" = NEW."Id" AND "ManifestId" = OLD."ManifestId";
+ INSERT OR IGNORE INTO "Items" ("ManifestId", "Id", "ItemType", "CreatedAt", "UpdatedAt", "IsDeleted")
+ SELECT OLD."ManifestId", OLD."Id", OLD."ItemType", OLD."CreatedAt", NEW."UpdatedAt", 1 WHERE OLD."IsDeleted" = 0;
+ END;
+ """;
+
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
@@ -18,7 +58,7 @@ namespace AliasClientDb.Migrations
* discard them), and SQLite reparses the remaining triggers during a rebuild, aborting on one that
* names a momentarily dropped table.
*/
- migrationBuilder.Sql(ItemChildManifestTriggerSql.Create);
+ migrationBuilder.Sql(CreateTriggers);
// Restores what the previous migration turned off for its rebuild.
migrationBuilder.Sql("PRAGMA foreign_keys = ON;", suppressTransaction: true);
@@ -27,7 +67,7 @@ namespace AliasClientDb.Migrations
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
- migrationBuilder.Sql(ItemChildManifestTriggerSql.Drop);
+ migrationBuilder.Sql("DROP TRIGGER IF EXISTS \"TR_Items_ResyncChildManifestIds\"; DROP TRIGGER IF EXISTS \"TR_Items_ClearTombstoneBeforeReturn\";");
}
}
}
diff --git a/apps/server/Databases/AliasClientDb/Migrations/ItemChildManifestTriggerSql.cs b/apps/server/Databases/AliasClientDb/Migrations/ItemChildManifestTriggerSql.cs
deleted file mode 100644
index da73dde60..000000000
--- a/apps/server/Databases/AliasClientDb/Migrations/ItemChildManifestTriggerSql.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-//-----------------------------------------------------------------------
-// <copyright file="ItemChildManifestTriggerSql.cs" company="aliasvault">
-// Copyright (c) aliasvault. All rights reserved.
-// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
-// </copyright>
-//-----------------------------------------------------------------------
-
-namespace AliasClientDb.Migrations;
-
-using System.Text;
-
-/// <summary>
-/// DDL of the triggers that carry an item across manifests: its rows follow it and a tombstone stays behind.
-/// The triggers need to be dropped and recreated after a table is rebuilt, hence the shared code.
-/// </summary>
-internal static class ItemChildManifestTriggerSql
-{
- /// <summary>
- /// The tables whose rows are owned by an item through an ItemId foreign key.
- /// </summary>
- private static readonly string[] ItemIdChildTables = ["FieldValues", "FieldHistories", "ItemTags", "Attachments", "Passkeys", "TotpCodes"];
-
- /// <summary>
- /// The manifest-level tables an item's rows reference: the content columns copied on a move and the child columns that reach them.
- /// </summary>
- private static readonly (string Table, string[] ContentColumns, (string Child, string Column)[] ReferencedBy)[] ReferencedTables =
- [
- ("Tags", ["Name", "Color", "DisplayOrder"], [("ItemTags", "TagId")]),
- ("FieldDefinitions", ["FieldType", "Label", "IsMultiValue", "IsHidden", "EnableHistory", "Weight", "ApplicableToTypes"], [("FieldValues", "FieldDefinitionId"), ("FieldHistories", "FieldDefinitionId")]),
- ];
-
- /// <summary>
- /// Gets the name of the trigger.
- /// </summary>
- public static string Name => "TR_Items_ResyncChildManifestIds";
-
- /// <summary>
- /// Gets the name of the trigger that clears the way for an item moving back into a manifest it left before.
- /// </summary>
- public static string ReturnName => "TR_Items_ClearTombstoneBeforeReturn";
-
- /// <summary>
- /// Gets the statement that drops the triggers.
- /// </summary>
- public static string Drop => $"DROP TRIGGER IF EXISTS \"{Name}\"; DROP TRIGGER IF EXISTS \"{ReturnName}\";";
-
- /// <summary>
- /// Gets the statement that creates the triggers.
- /// </summary>
- public static string Create
- {
- get
- {
- var restamp = new StringBuilder();
- var clear = new StringBuilder();
- foreach (var (table, contentColumns, referencedBy) in ReferencedTables)
- {
- restamp.AppendLine(CopyReferencedRows(table, contentColumns, referencedBy));
- }
-
- foreach (var table in ItemIdChildTables)
- {
- restamp.AppendLine($" UPDATE \"{table}\" SET \"ManifestId\" = NEW.\"ManifestId\" WHERE \"ItemId\" = NEW.\"Id\" AND \"ManifestId\" = OLD.\"ManifestId\";");
- clear.AppendLine($" DELETE FROM \"{table}\" WHERE \"ItemId\" = NEW.\"Id\" AND \"ManifestId\" = NEW.\"ManifestId\";");
- }
-
- restamp.AppendLine($" UPDATE \"ItemStats\" SET \"ManifestId\" = NEW.\"ManifestId\" WHERE \"Id\" = NEW.\"Id\" AND \"ManifestId\" = OLD.\"ManifestId\";");
- clear.AppendLine($" DELETE FROM \"ItemStats\" WHERE \"Id\" = NEW.\"Id\" AND \"ManifestId\" = NEW.\"ManifestId\";");
-
- /*
- * When moving an item to a new manifest, a tombstone is left behind in the old manifest.
- * This trigger clears it before the item is moved back.
- */
- return $"""
- CREATE TRIGGER IF NOT EXISTS "{ReturnName}"
- BEFORE UPDATE OF "ManifestId" ON "Items"
- FOR EACH ROW WHEN OLD."ManifestId" <> NEW."ManifestId"
- AND EXISTS (SELECT 1 FROM "Items" WHERE "ManifestId" = NEW."ManifestId" AND "Id" = NEW."Id" AND "IsDeleted" = 1)
- BEGIN
- {clear.ToString().TrimEnd()}
- DELETE FROM "Items" WHERE "ManifestId" = NEW."ManifestId" AND "Id" = NEW."Id" AND "IsDeleted" = 1;
- END;
-
- CREATE TRIGGER IF NOT EXISTS "{Name}"
- AFTER UPDATE OF "ManifestId" ON "Items"
- FOR EACH ROW WHEN OLD."ManifestId" <> NEW."ManifestId"
- BEGIN
- {restamp.ToString().TrimEnd()}
- INSERT OR IGNORE INTO "Items" ("ManifestId", "Id", "ItemType", "CreatedAt", "UpdatedAt", "IsDeleted")
- SELECT OLD."ManifestId", OLD."Id", OLD."ItemType", OLD."CreatedAt", NEW."UpdatedAt", 1 WHERE OLD."IsDeleted" = 0;
- END;
- """;
- }
- }
-
- /// <summary>
- /// The statement that copies the rows of a referenced table that the moving item's child rows point at into the destination manifest.
- /// </summary>
- private static string CopyReferencedRows(string table, string[] contentColumns, (string Child, string Column)[] referencedBy)
- {
- var quotedContent = string.Join(", ", contentColumns.Select(column => $"\"{column}\""));
- var referencedIds = string.Join(" UNION ", referencedBy.Select(r => $"SELECT \"{r.Column}\" FROM \"{r.Child}\" WHERE \"ManifestId\" = OLD.\"ManifestId\" AND \"ItemId\" = NEW.\"Id\""));
- var revive = string.Join(", ", contentColumns.Select(column => $"\"{column}\" = excluded.\"{column}\""));
- return $"""
- INSERT INTO "{table}" ("ManifestId", "Id", {quotedContent}, "CreatedAt", "UpdatedAt", "IsDeleted")
- SELECT NEW."ManifestId", "Id", {quotedContent}, "CreatedAt", NEW."UpdatedAt", "IsDeleted" FROM "{table}"
- WHERE "ManifestId" = OLD."ManifestId" AND "Id" IN ({referencedIds})
- ON CONFLICT ("ManifestId", "Id") DO UPDATE SET {revive}, "UpdatedAt" = excluded."UpdatedAt", "IsDeleted" = 0 WHERE "IsDeleted" = 1 AND excluded."IsDeleted" = 0;
- """;
- }
-}
diff --git a/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs b/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs
index c42e7fc3a..e0d28a0be 100644
--- a/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs
+++ b/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs
@@ -328,6 +328,7 @@ public class AliasServerDbContext : WorkerStatusDbContext, IDataProtectionKeyCon
{
builder.Property(e => e.AnonymizedEmailAliasSenderCounts)
.HasDefaultValueSql("array_fill(0, ARRAY[64])");
+ builder.Property(e => e.Type).HasConversion<string>().HasMaxLength(20);
});
// Configure GroupMember, who may be granted access to the group's shared manifests.
@@ -345,6 +346,7 @@ public class AliasServerDbContext : WorkerStatusDbContext, IDataProtectionKeyCon
.OnDelete(DeleteBehavior.Cascade);
builder.HasIndex(e => e.UserId);
+ builder.Property(e => e.Role).HasConversion<string>().HasMaxLength(20);
});
// Configure GroupInvitation, an offer to join a group.
@@ -367,6 +369,7 @@ public class AliasServerDbContext : WorkerStatusDbContext, IDataProtectionKeyCon
builder.HasIndex(e => new { e.VaultManifestId, e.InviteeUserId }).IsUnique().HasFilter("\"State\" = 'Pending'").HasDatabaseName("UX_GroupInvitations_Manifest_Invitee_Pending");
builder.Property(e => e.State).HasConversion<string>().HasMaxLength(20);
+ builder.Property(e => e.Role).HasConversion<string>().HasMaxLength(20);
builder.Property(e => e.Algorithm).HasConversion(v => VaultKeyAlgorithms.ToToken(v), v => VaultKeyAlgorithms.Parse(v));
// Losing the keypair the vault key was encrypted to leaves an invitation nobody could ever decrypt.
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.Designer.cs
index 58473acfc..a5dfbe2dc 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.Designer.cs
@@ -591,8 +591,10 @@ namespace AliasServerDb.Migrations
b.Property<DateTime?>("ShadowBlockedAt")
.HasColumnType("timestamp with time zone");
- b.Property<int>("Type")
- .HasColumnType("integer");
+ b.Property<string>("Type")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
@@ -614,8 +616,10 @@ namespace AliasServerDb.Migrations
b.Property<Guid>("GroupId")
.HasColumnType("uuid");
- b.Property<int>("Role")
- .HasColumnType("integer");
+ b.Property<string>("Role")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.cs b/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.cs
index 74329cea3..5375e0e11 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260810093922_ManifestStorageAndGroupOwnership.cs
@@ -76,7 +76,7 @@ namespace AliasServerDb.Migrations
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
- Type = table.Column<int>(type: "integer", nullable: false),
+ Type = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
ShadowBlocked = table.Column<bool>(type: "boolean", nullable: false),
ShadowBlockedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
MaxEmails = table.Column<int>(type: "integer", nullable: false),
@@ -98,7 +98,7 @@ namespace AliasServerDb.Migrations
Id = table.Column<Guid>(type: "uuid", nullable: false),
GroupId = table.Column<Guid>(type: "uuid", nullable: false),
UserId = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
- Role = table.Column<int>(type: "integer", nullable: false),
+ Role = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
@@ -107,15 +107,14 @@ namespace AliasServerDb.Migrations
table.PrimaryKey("PK_GroupMembers", x => x.Id);
});
- // Personal group is type 0, owner is role 0.
migrationBuilder.Sql("""
INSERT INTO "Groups" ("Id", "Name", "Type", "ShadowBlocked", "ShadowBlockedAt", "MaxEmails", "MaxEmailAgeDays", "EmailsReceived", "CreatedAt", "UpdatedAt")
- SELECT m."GroupId", COALESCE(u."UserName", 'Personal'), 0, u."ShadowBlocked", u."ShadowBlockedAt", u."MaxEmails", u."MaxEmailAgeDays", u."EmailsReceived", now(), now()
+ SELECT m."GroupId", COALESCE(u."UserName", 'Personal'), 'Personal', u."ShadowBlocked", u."ShadowBlockedAt", u."MaxEmails", u."MaxEmailAgeDays", u."EmailsReceived", now(), now()
FROM "AliasVaultUsers" u
JOIN "UserMigrationMap" m ON m."UserId" = u."Id";
INSERT INTO "GroupMembers" ("Id", "GroupId", "UserId", "Role", "CreatedAt", "UpdatedAt")
- SELECT gen_random_uuid(), m."GroupId", m."UserId", 0, now(), now()
+ SELECT gen_random_uuid(), m."GroupId", m."UserId", 'Owner', now(), now()
FROM "UserMigrationMap" m;
CREATE TABLE "AliasVaultUsers_reordered" (
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs
index 8113929ef..c9f3286b6 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.Designer.cs
@@ -702,8 +702,10 @@ namespace AliasServerDb.Migrations
b.Property<DateTime?>("ShadowBlockedAt")
.HasColumnType("timestamp with time zone");
- b.Property<int>("Type")
- .HasColumnType("integer");
+ b.Property<string>("Type")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
@@ -749,8 +751,10 @@ namespace AliasServerDb.Migrations
b.Property<DateTime?>("RespondedAt")
.HasColumnType("timestamp with time zone");
- b.Property<int>("Role")
- .HasColumnType("integer");
+ b.Property<string>("Role")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)");
b.Property<string>("State")
.IsRequired()
@@ -799,8 +803,10 @@ namespace AliasServerDb.Migrations
b.Property<Guid>("GroupId")
.HasColumnType("uuid");
- b.Property<int>("Role")
- .HasColumnType("integer");
+ b.Property<string>("Role")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.cs b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.cs
index 8c2c17db5..a4a893744 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260820120455_AddGroupInvitationsClientActionsAndCapabilityRules.cs
@@ -52,7 +52,7 @@ namespace AliasServerDb.Migrations
GroupId = table.Column<Guid>(type: "uuid", nullable: false),
InviterUserId = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
InviteeUserId = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
- Role = table.Column<int>(type: "integer", nullable: false),
+ Role = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
VaultManifestId = table.Column<Guid>(type: "uuid", nullable: true),
EncryptedName = table.Column<string>(type: "text", nullable: true),
EncryptedVek = table.Column<string>(type: "text", nullable: true),
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260917154825_MobileLoginRequestVerification.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260917154825_MobileLoginRequestVerification.Designer.cs
index 420741629..b91003708 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20260917154825_MobileLoginRequestVerification.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260917154825_MobileLoginRequestVerification.Designer.cs
@@ -702,8 +702,10 @@ namespace AliasServerDb.Migrations
b.Property<DateTime?>("ShadowBlockedAt")
.HasColumnType("timestamp with time zone");
- b.Property<int>("Type")
- .HasColumnType("integer");
+ b.Property<string>("Type")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
@@ -749,8 +751,10 @@ namespace AliasServerDb.Migrations
b.Property<DateTime?>("RespondedAt")
.HasColumnType("timestamp with time zone");
- b.Property<int>("Role")
- .HasColumnType("integer");
+ b.Property<string>("Role")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)");
b.Property<string>("State")
.IsRequired()
@@ -799,8 +803,10 @@ namespace AliasServerDb.Migrations
b.Property<Guid>("GroupId")
.HasColumnType("uuid");
- b.Property<int>("Role")
- .HasColumnType("integer");
+ b.Property<string>("Role")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
diff --git a/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs b/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs
index ef9479aaa..600bfedc2 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs
@@ -699,8 +699,10 @@ namespace AliasServerDb.Migrations
b.Property<DateTime?>("ShadowBlockedAt")
.HasColumnType("timestamp with time zone");
- b.Property<int>("Type")
- .HasColumnType("integer");
+ b.Property<string>("Type")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
@@ -746,8 +748,10 @@ namespace AliasServerDb.Migrations
b.Property<DateTime?>("RespondedAt")
.HasColumnType("timestamp with time zone");
- b.Property<int>("Role")
- .HasColumnType("integer");
+ b.Property<string>("Role")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)");
b.Property<string>("State")
.IsRequired()
@@ -796,8 +800,10 @@ namespace AliasServerDb.Migrations
b.Property<Guid>("GroupId")
.HasColumnType("uuid");
- b.Property<int>("Role")
- .HasColumnType("integer");
+ b.Property<string>("Role")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("character varying(20)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");