[backend/database] Add indicies to the instance table
This commit is contained in:
parent
e2a528c8a6
commit
eba6152493
4 changed files with 46 additions and 0 deletions
|
@ -1527,8 +1527,12 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
|
||||||
b.HasIndex("Host")
|
b.HasIndex("Host")
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
|
b.HasIndex("IncomingFollows");
|
||||||
|
|
||||||
b.HasIndex("IsSuspended");
|
b.HasIndex("IsSuspended");
|
||||||
|
|
||||||
|
b.HasIndex("OutgoingFollows");
|
||||||
|
|
||||||
b.ToTable("instance");
|
b.ToTable("instance");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Iceshrimp.Backend.Core.Database.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
[DbContext(typeof(DatabaseContext))]
|
||||||
|
[Migration("20240424224008_AddInstanceTableIndicies")]
|
||||||
|
public partial class AddInstanceTableIndicies : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_instance_incomingFollows",
|
||||||
|
table: "instance",
|
||||||
|
column: "incomingFollows");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_instance_outgoingFollows",
|
||||||
|
table: "instance",
|
||||||
|
column: "outgoingFollows");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_instance_incomingFollows",
|
||||||
|
table: "instance");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_instance_outgoingFollows",
|
||||||
|
table: "instance");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,6 +9,8 @@ namespace Iceshrimp.Backend.Core.Database.Tables;
|
||||||
[Index(nameof(CaughtAt))]
|
[Index(nameof(CaughtAt))]
|
||||||
[Index(nameof(IsSuspended))]
|
[Index(nameof(IsSuspended))]
|
||||||
[Index(nameof(Host), IsUnique = true)]
|
[Index(nameof(Host), IsUnique = true)]
|
||||||
|
[Index(nameof(IncomingFollows))]
|
||||||
|
[Index(nameof(OutgoingFollows))]
|
||||||
public class Instance
|
public class Instance
|
||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace Iceshrimp.Backend.Core.Database.Tables;
|
||||||
[Index(nameof(CreatedAt))]
|
[Index(nameof(CreatedAt))]
|
||||||
[Index(nameof(AppAccessTokenId))]
|
[Index(nameof(AppAccessTokenId))]
|
||||||
[Index(nameof(MastoId))]
|
[Index(nameof(MastoId))]
|
||||||
|
[Index(nameof(NoteId))]
|
||||||
public class Notification : IEntity
|
public class Notification : IEntity
|
||||||
{
|
{
|
||||||
[PgName("notification_type_enum")]
|
[PgName("notification_type_enum")]
|
||||||
|
|
Loading…
Add table
Reference in a new issue