Skip to content

Commit

Permalink
Data Archiving: Create Indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
phongnguyend committed Oct 24, 2023
1 parent 4823bb5 commit 0859344
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public void Configure(EntityTypeBuilder<EmailMessage> builder)
{
builder.ToTable("EmailMessages");
builder.Property(x => x.Id).HasDefaultValueSql("newsequentialid()");
builder.HasIndex(x => x.SentDateTime).IncludeProperties(x => new { x.ExpiredDateTime, x.AttemptCount, x.MaxAttemptCount, x.NextAttemptDateTime });
builder.HasIndex(x => x.CreatedDateTime);
}
}

Expand All @@ -18,5 +20,6 @@ public class ArchivedEmailMessageConfiguration : IEntityTypeConfiguration<Archiv
public void Configure(EntityTypeBuilder<ArchivedEmailMessage> builder)
{
builder.ToTable("ArchivedEmailMessages");
builder.HasIndex(x => x.CreatedDateTime);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public void Configure(EntityTypeBuilder<SmsMessage> builder)
{
builder.ToTable("SmsMessages");
builder.Property(x => x.Id).HasDefaultValueSql("newsequentialid()");
builder.HasIndex(x => x.SentDateTime).IncludeProperties(x => new { x.ExpiredDateTime, x.AttemptCount, x.MaxAttemptCount, x.NextAttemptDateTime });
builder.HasIndex(x => x.CreatedDateTime);
}
}

Expand All @@ -18,5 +20,6 @@ public class ArchivedSmsMessageConfiguration : IEntityTypeConfiguration<Archived
public void Configure(EntityTypeBuilder<ArchivedSmsMessage> builder)
{
builder.ToTable("ArchivedSmsMessages");
builder.HasIndex(x => x.CreatedDateTime);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public void Configure(EntityTypeBuilder<OutboxEvent> builder)
{
builder.ToTable("OutboxEvents");
builder.Property(x => x.Id).HasDefaultValueSql("newsequentialid()");
builder.HasIndex(x => x.Published);
builder.HasIndex(x => x.CreatedDateTime);
}
}

Expand All @@ -18,5 +20,6 @@ public class ArchivedOutboxEventConfiguration : IEntityTypeConfiguration<Archive
public void Configure(EntityTypeBuilder<ArchivedOutboxEvent> builder)
{
builder.ToTable("ArchivedOutboxEvents");
builder.HasIndex(x => x.CreatedDateTime);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public void Configure(EntityTypeBuilder<OutboxEvent> builder)
{
builder.ToTable("OutboxEvents");
builder.Property(x => x.Id).HasDefaultValueSql("newsequentialid()");
builder.HasIndex(x => x.Published);
builder.HasIndex(x => x.CreatedDateTime);
}
}

Expand All @@ -18,5 +20,6 @@ public class ArchivedOutboxEventConfiguration : IEntityTypeConfiguration<Archive
public void Configure(EntityTypeBuilder<ArchivedOutboxEvent> builder)
{
builder.ToTable("ArchivedOutboxEvents");
builder.HasIndex(x => x.CreatedDateTime);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public void Configure(EntityTypeBuilder<EmailMessage> builder)
{
builder.ToTable("EmailMessages");
builder.Property(x => x.Id).HasDefaultValueSql("newsequentialid()");
builder.HasIndex(x => x.SentDateTime).IncludeProperties(x => new { x.ExpiredDateTime, x.AttemptCount, x.MaxAttemptCount, x.NextAttemptDateTime });
builder.HasIndex(x => x.CreatedDateTime);
}
}

Expand All @@ -18,5 +20,6 @@ public class ArchivedEmailMessageConfiguration : IEntityTypeConfiguration<Archiv
public void Configure(EntityTypeBuilder<ArchivedEmailMessage> builder)
{
builder.ToTable("ArchivedEmailMessages");
builder.HasIndex(x => x.CreatedDateTime);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public void Configure(EntityTypeBuilder<SmsMessage> builder)
{
builder.ToTable("SmsMessages");
builder.Property(x => x.Id).HasDefaultValueSql("newsequentialid()");
builder.HasIndex(x => x.SentDateTime).IncludeProperties(x => new { x.ExpiredDateTime, x.AttemptCount, x.MaxAttemptCount, x.NextAttemptDateTime });
builder.HasIndex(x => x.CreatedDateTime);
}
}

Expand All @@ -18,5 +20,6 @@ public class ArchivedSmsMessageConfiguration : IEntityTypeConfiguration<Archived
public void Configure(EntityTypeBuilder<ArchivedSmsMessage> builder)
{
builder.ToTable("ArchivedSmsMessages");
builder.HasIndex(x => x.CreatedDateTime);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public void Configure(EntityTypeBuilder<OutboxEvent> builder)
{
builder.ToTable("OutboxEvents");
builder.Property(x => x.Id).HasDefaultValueSql("newsequentialid()");
builder.HasIndex(x => x.Published);
builder.HasIndex(x => x.CreatedDateTime);
}
}

Expand All @@ -18,5 +20,6 @@ public class ArchivedOutboxEventConfiguration : IEntityTypeConfiguration<Archive
public void Configure(EntityTypeBuilder<ArchivedOutboxEvent> builder)
{
builder.ToTable("ArchivedOutboxEvents");
builder.HasIndex(x => x.CreatedDateTime);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public void Configure(EntityTypeBuilder<OutboxEvent> builder)
{
builder.ToTable("OutboxEvents");
builder.Property(x => x.Id).HasDefaultValueSql("newsequentialid()");
builder.HasIndex(x => x.Published);
builder.HasIndex(x => x.CreatedDateTime);
}
}

Expand All @@ -18,5 +20,6 @@ public class ArchivedOutboxEventConfiguration : IEntityTypeConfiguration<Archive
public void Configure(EntityTypeBuilder<ArchivedOutboxEvent> builder)
{
builder.ToTable("ArchivedOutboxEvents");
builder.HasIndex(x => x.CreatedDateTime);
}
}

0 comments on commit 0859344

Please sign in to comment.