-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add reverse indexes on Localizations and SearchTags (#1971)
<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> ## Related Issue(s) - #[1650](#1650) ## Verification - [x] **Your** code builds clean without any errors or warnings - [x] Manual testing done (required) - [ ] Relevant automated test added (if you find this hard, leave it and we'll help out) ## Documentation - [ ] Documentation is updated (either in `docs`-directory, Altinnpedia or a separate linked PR in [altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if applicable) Co-authored-by: Bjørn Dybvik Langfors <[email protected]> Co-authored-by: Magnus Sandgren <[email protected]>
- Loading branch information
Showing
10 changed files
with
2,346 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
...gporten.Infrastructure/Persistence/Configurations/Dialogs/DialogSearchTagConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
using Digdir.Domain.Dialogporten.Domain.Common; | ||
using Digdir.Domain.Dialogporten.Domain.Dialogs.Entities; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
using static Digdir.Domain.Dialogporten.Domain.Common.Constants; | ||
|
||
namespace Digdir.Domain.Dialogporten.Infrastructure.Persistence.Configurations.Dialogs; | ||
|
||
internal sealed class DialogSearchTagConfiguration : IEntityTypeConfiguration<DialogSearchTag> | ||
{ | ||
public void Configure(EntityTypeBuilder<DialogSearchTag> builder) | ||
{ | ||
builder.HasIndex(x => new { x.DialogId, x.Value }) | ||
.IsUnique(); | ||
builder.Property(x => x.Value) | ||
.HasMaxLength(Constants.MaxSearchTagLength); | ||
.HasMaxLength(MaxSearchTagLength); | ||
|
||
builder.HasIndex(x => x.Value) | ||
.HasMethod(Constants.Gin) | ||
.HasOperators(Constants.GinTrgmOps); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/Digdir.Domain.Dialogporten.Infrastructure/Persistence/Constants.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Digdir.Domain.Dialogporten.Infrastructure.Persistence; | ||
|
||
internal static class Constants | ||
{ | ||
internal const string Gin = "gin"; | ||
internal const string GinTrgmOps = "gin_trgm_ops"; | ||
internal const string PostgreSqlTrigram = "pg_trgm"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.