feat(backend): add short ID reroll endpoints

This commit is contained in:
sam 2024-09-26 16:38:43 +02:00
parent e76c634738
commit b5f9ef9bd6
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
3 changed files with 61 additions and 2 deletions

View file

@ -76,7 +76,23 @@ public class DatabaseContext : DbContext
modelBuilder.Entity<Member>().Property(m => m.Fields).HasColumnType("jsonb");
modelBuilder.Entity<Member>().Property(m => m.Names).HasColumnType("jsonb");
modelBuilder.Entity<Member>().Property(m => m.Pronouns).HasColumnType("jsonb");
modelBuilder.HasDbFunction(typeof(DatabaseContext).GetMethod(nameof(FindFreeUserSid))!)
.HasName("find_free_user_sid");
modelBuilder.HasDbFunction(typeof(DatabaseContext).GetMethod(nameof(FindFreeMemberSid))!)
.HasName("find_free_member_sid");
}
/// <summary>
/// Dummy method that calls <c>find_free_user_sid()</c> when used in an EF Core query.
/// </summary>
public string FindFreeUserSid() => throw new NotSupportedException();
/// <summary>
/// Dummy method that calls <c>find_free_member_sid()</c> when used in an EF Core query.
/// </summary>
public string FindFreeMemberSid() => throw new NotSupportedException();
}
[SuppressMessage("ReSharper", "UnusedType.Global", Justification = "Used by EF Core's migration generator")]