Add indicies for user.IsAdmin and .IsModerator

This commit is contained in:
Laura Hausmann 2024-01-18 17:57:12 +01:00
parent 251228eabf
commit 65ece17c40
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
4 changed files with 5951 additions and 0 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,36 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Iceshrimp.Backend.Core.Database.Migrations
{
/// <inheritdoc />
public partial class AddUserRoleIndicies : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_user_isAdmin",
table: "user",
column: "isAdmin");
migrationBuilder.CreateIndex(
name: "IX_user_isModerator",
table: "user",
column: "isModerator");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_user_isAdmin",
table: "user");
migrationBuilder.DropIndex(
name: "IX_user_isModerator",
table: "user");
}
}
}

View file

@ -3981,8 +3981,12 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.HasIndex("Host"); b.HasIndex("Host");
b.HasIndex("IsAdmin");
b.HasIndex("IsExplorable"); b.HasIndex("IsExplorable");
b.HasIndex("IsModerator");
b.HasIndex("LastActiveDate"); b.HasIndex("LastActiveDate");
b.HasIndex("Tags"); b.HasIndex("Tags");

View file

@ -12,6 +12,8 @@ namespace Iceshrimp.Backend.Core.Database.Tables;
[Index("Uri")] [Index("Uri")]
[Index("LastActiveDate")] [Index("LastActiveDate")]
[Index("IsExplorable")] [Index("IsExplorable")]
[Index("IsAdmin")]
[Index("IsModerator")]
[Index("CreatedAt")] [Index("CreatedAt")]
[Index("Tags")] [Index("Tags")]
[Index("AvatarId", IsUnique = true)] [Index("AvatarId", IsUnique = true)]