fix(backend): add unique index to auth methods

This commit is contained in:
sam 2024-11-28 21:29:25 +01:00
parent 8b1d5b2c1b
commit 4780be3019
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
3 changed files with 73 additions and 0 deletions

View file

@ -98,6 +98,16 @@ namespace Foxnouns.Backend.Database.Migrations
b.HasIndex("UserId")
.HasDatabaseName("ix_auth_methods_user_id");
b.HasIndex("AuthType", "RemoteId")
.IsUnique()
.HasDatabaseName("ix_auth_methods_auth_type_remote_id")
.HasFilter("fediverse_application_id IS NULL");
b.HasIndex("AuthType", "RemoteId", "FediverseApplicationId")
.IsUnique()
.HasDatabaseName("ix_auth_methods_auth_type_remote_id_fediverse_application_id")
.HasFilter("fediverse_application_id IS NOT NULL");
b.ToTable("auth_methods", (string)null);
});