Skip to content

Commit

Permalink
remove postgres extension and indexes of the trigram feature pg_trgm,…
Browse files Browse the repository at this point in the history
… because we don't use it at all, and the reindexing can be costly (#2050)
  • Loading branch information
Masterjun3 authored Nov 26, 2024
1 parent 3197cf9 commit 92796ec
Show file tree
Hide file tree
Showing 4 changed files with 3,502 additions and 20 deletions.
7 changes: 0 additions & 7 deletions TASVideos.Data/ApplicationDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ protected override void OnModelCreating(ModelBuilder builder)
}

builder.HasPostgresExtension("citext");
builder.HasPostgresExtension("pg_trgm");
}

builder.Entity<Award>(entity =>
Expand Down Expand Up @@ -271,9 +270,6 @@ protected override void OnModelCreating(ModelBuilder builder)

if (Database.IsNpgsql())
{
entity.HasIndex(e => e.Markup)
.HasMethod("gin")
.HasOperators("gin_trgm_ops");
entity
.HasGeneratedTsVectorColumn(
p => p.SearchVector,
Expand Down Expand Up @@ -438,9 +434,6 @@ protected override void OnModelCreating(ModelBuilder builder)
{
if (Database.IsNpgsql())
{
entity.HasIndex(e => e.Text)
.HasMethod("gin")
.HasOperators("gin_trgm_ops");
entity
.HasGeneratedTsVectorColumn(
p => p.SearchVector,
Expand Down
Loading

0 comments on commit 92796ec

Please sign in to comment.