-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: configure consumer offset without deploy
- Loading branch information
Showing
7 changed files
with
186 additions
and
24 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
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
90 changes: 90 additions & 0 deletions
90
...BuildingRegistry.Consumer.Address/Migrations/20241204111246_AddOffsetOverride.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
src/BuildingRegistry.Consumer.Address/Migrations/20241204111246_AddOffsetOverride.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,36 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace BuildingRegistry.Consumer.Address.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class AddOffsetOverride : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "OffsetOverrides", | ||
schema: "BuildingRegistryConsumerAddress", | ||
columns: table => new | ||
{ | ||
ConsumerGroupId = table.Column<string>(type: "nvarchar(450)", nullable: false), | ||
Offset = table.Column<long>(type: "bigint", nullable: false), | ||
Configured = table.Column<bool>(type: "bit", nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_OffsetOverrides", x => x.ConsumerGroupId); | ||
}); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "OffsetOverrides", | ||
schema: "BuildingRegistryConsumerAddress"); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace BuildingRegistry.Consumer.Address | ||
{ | ||
using BuildingRegistry.Infrastructure; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
public class OffsetOverride | ||
{ | ||
public string ConsumerGroupId { get; set; } | ||
public long Offset { get; set; } | ||
public bool Configured { get; set; } | ||
} | ||
|
||
public class OffsetOverrideConfiguration : IEntityTypeConfiguration<OffsetOverride> | ||
{ | ||
public const string TableName = "OffsetOverrides"; | ||
|
||
public void Configure(EntityTypeBuilder<OffsetOverride> builder) | ||
{ | ||
builder.ToTable(TableName, Schema.ConsumerAddress) | ||
.HasKey(x => x.ConsumerGroupId); | ||
} | ||
} | ||
} |
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