Rename GIN indicies
This commit is contained in:
parent
de13c8151b
commit
0e14967f5a
4 changed files with 6034 additions and 16 deletions
|
@ -516,13 +516,10 @@ public class DatabaseContext : DbContext {
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<Note>(entity => {
|
modelBuilder.Entity<Note>(entity => {
|
||||||
entity.HasIndex(e => e.Mentions, "IDX_NOTE_MENTIONS").HasMethod("gin");
|
entity.HasIndex(e => e.Mentions, "GIN_note_mentions").HasMethod("gin");
|
||||||
|
entity.HasIndex(e => e.Tags, "GIN_note_tags").HasMethod("gin");
|
||||||
entity.HasIndex(e => e.Tags, "IDX_NOTE_TAGS").HasMethod("gin");
|
entity.HasIndex(e => e.VisibleUserIds, "GIN_note_visibleUserIds").HasMethod("gin");
|
||||||
|
entity.HasIndex(e => e.Text, "GIN_TRGM_note_text")
|
||||||
entity.HasIndex(e => e.VisibleUserIds, "IDX_NOTE_VISIBLE_USER_IDS").HasMethod("gin");
|
|
||||||
|
|
||||||
entity.HasIndex(e => e.Text, "note_text_fts_idx")
|
|
||||||
.HasMethod("gin")
|
.HasMethod("gin")
|
||||||
.HasOperators("gin_trgm_ops");
|
.HasOperators("gin_trgm_ops");
|
||||||
|
|
||||||
|
|
5963
Iceshrimp.Backend/Core/Database/Migrations/20240107190342_RenameGinIndicies.Designer.cs
generated
Normal file
5963
Iceshrimp.Backend/Core/Database/Migrations/20240107190342_RenameGinIndicies.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,58 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Iceshrimp.Backend.Core.Database.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class RenameGinIndicies : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.RenameIndex(
|
||||||
|
name: "note_text_fts_idx",
|
||||||
|
table: "note",
|
||||||
|
newName: "GIN_TRGM_note_text");
|
||||||
|
|
||||||
|
migrationBuilder.RenameIndex(
|
||||||
|
name: "IDX_NOTE_VISIBLE_USER_IDS",
|
||||||
|
table: "note",
|
||||||
|
newName: "GIN_note_visibleUserIds");
|
||||||
|
|
||||||
|
migrationBuilder.RenameIndex(
|
||||||
|
name: "IDX_NOTE_TAGS",
|
||||||
|
table: "note",
|
||||||
|
newName: "GIN_note_tags");
|
||||||
|
|
||||||
|
migrationBuilder.RenameIndex(
|
||||||
|
name: "IDX_NOTE_MENTIONS",
|
||||||
|
table: "note",
|
||||||
|
newName: "GIN_note_mentions");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.RenameIndex(
|
||||||
|
name: "GIN_note_visibleUserIds",
|
||||||
|
table: "note",
|
||||||
|
newName: "IDX_NOTE_VISIBLE_USER_IDS");
|
||||||
|
|
||||||
|
migrationBuilder.RenameIndex(
|
||||||
|
name: "GIN_note_tags",
|
||||||
|
table: "note",
|
||||||
|
newName: "IDX_NOTE_TAGS");
|
||||||
|
|
||||||
|
migrationBuilder.RenameIndex(
|
||||||
|
name: "GIN_note_mentions",
|
||||||
|
table: "note",
|
||||||
|
newName: "IDX_NOTE_MENTIONS");
|
||||||
|
|
||||||
|
migrationBuilder.RenameIndex(
|
||||||
|
name: "GIN_TRGM_note_text",
|
||||||
|
table: "note",
|
||||||
|
newName: "note_text_fts_idx");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -2556,22 +2556,22 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
|
||||||
|
|
||||||
b.HasIndex("UserId", "Id");
|
b.HasIndex("UserId", "Id");
|
||||||
|
|
||||||
b.HasIndex(new[] { "Mentions" }, "IDX_NOTE_MENTIONS");
|
b.HasIndex(new[] { "Text" }, "GIN_TRGM_note_text");
|
||||||
|
|
||||||
NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Mentions" }, "IDX_NOTE_MENTIONS"), "gin");
|
NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Text" }, "GIN_TRGM_note_text"), "gin");
|
||||||
|
NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Text" }, "GIN_TRGM_note_text"), new[] { "gin_trgm_ops" });
|
||||||
|
|
||||||
b.HasIndex(new[] { "Tags" }, "IDX_NOTE_TAGS");
|
b.HasIndex(new[] { "Mentions" }, "GIN_note_mentions");
|
||||||
|
|
||||||
NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Tags" }, "IDX_NOTE_TAGS"), "gin");
|
NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Mentions" }, "GIN_note_mentions"), "gin");
|
||||||
|
|
||||||
b.HasIndex(new[] { "VisibleUserIds" }, "IDX_NOTE_VISIBLE_USER_IDS");
|
b.HasIndex(new[] { "Tags" }, "GIN_note_tags");
|
||||||
|
|
||||||
NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "VisibleUserIds" }, "IDX_NOTE_VISIBLE_USER_IDS"), "gin");
|
NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Tags" }, "GIN_note_tags"), "gin");
|
||||||
|
|
||||||
b.HasIndex(new[] { "Text" }, "note_text_fts_idx");
|
b.HasIndex(new[] { "VisibleUserIds" }, "GIN_note_visibleUserIds");
|
||||||
|
|
||||||
NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Text" }, "note_text_fts_idx"), "gin");
|
NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "VisibleUserIds" }, "GIN_note_visibleUserIds"), "gin");
|
||||||
NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Text" }, "note_text_fts_idx"), new[] { "gin_trgm_ops" });
|
|
||||||
|
|
||||||
b.ToTable("note");
|
b.ToTable("note");
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue