Skip to content

Commit

Permalink
limit value and create a covering index
Browse files Browse the repository at this point in the history
  • Loading branch information
srkirkland committed Nov 6, 2023
1 parent 8f80ff8 commit 03afb20
Show file tree
Hide file tree
Showing 5 changed files with 1,316 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Sloth.Core/Domain/TransactionMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ public class TransactionMetadata
public string Name { get; set; }

[Required]
[MaxLength(450)]
public string Value { get; set; }

public static void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<TransactionMetadata>()
.HasIndex(r => r.TransactionId);

// modelBuilder.Entity<TransactionMetadata>()
// .HasIndex(r => r.Name);
// create a covering index for key and value
modelBuilder.Entity<TransactionMetadata>()
.HasIndex(r => new { r.TransactionId, r.Name, r.Value });
}
}
}
Loading

0 comments on commit 03afb20

Please sign in to comment.