-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(OutboxMessage): refactor ConsumeAsync methods and add new migration
- Refactored `ConsumeAsync` method in `Consumer` class to use expression-bodied member. - Modified `ConsumeAsync` method in `MessageRecordConsumer` class to be asynchronous. - Added a new outbox message with delivery options in the `TestHostedService`. - Created a new migration file '20240905162734_V1.cs' for database schema changes related to Outboxes, OutboxFailedMessages, OutboxMessages, and SimpleUsers tables. - Renamed 'V2.Designer.cs' to '20240905162734_V1.Designer.cs' reflecting the updated migration version. - Deleted old migration files 'V1.cs' and 'V1.Designer.cs'.
- Loading branch information
1 parent
064621e
commit ccd5004
Showing
54 changed files
with
765 additions
and
452 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
184 changes: 184 additions & 0 deletions
184
...Shared.Data.Simple.EntityFrameworkCore.SqlServer/Migrations/20240905162734_V1.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
117 changes: 117 additions & 0 deletions
117
...ayground.Shared.Data.Simple.EntityFrameworkCore.SqlServer/Migrations/20240905162734_V1.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,117 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace Playground.Shared.Data.Simple.EntityFrameworkCore.SqlServer.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class V1 : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "__Outboxes", | ||
columns: table => new | ||
{ | ||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | ||
AddedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false), | ||
Lock = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | ||
DeliveryDelayedUntil = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true), | ||
RowVersion = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK___Outboxes", x => x.Id); | ||
}); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "__OutboxFailedMessages", | ||
columns: table => new | ||
{ | ||
Id = table.Column<long>(type: "bigint", nullable: false), | ||
OutboxId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | ||
AddedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false), | ||
Headers = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||
PayloadType = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||
Payload = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||
DeliveryAttempts = table.Column<int>(type: "int", nullable: false), | ||
DeliveryFirstAttemptedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true), | ||
DeliveryLastAttemptedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true), | ||
DeliveryLastAttemptError = table.Column<string>(type: "nvarchar(4000)", maxLength: 4000, nullable: true), | ||
DeliveryNotBefore = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true), | ||
DeliveryNotAfter = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true), | ||
FailedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK___OutboxFailedMessages", x => x.Id); | ||
}); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "__OutboxMessages", | ||
columns: table => new | ||
{ | ||
Id = table.Column<long>(type: "bigint", nullable: false) | ||
.Annotation("SqlServer:Identity", "1, 1"), | ||
OutboxId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), | ||
AddedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false), | ||
Headers = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||
PayloadType = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||
Payload = table.Column<string>(type: "nvarchar(max)", nullable: false), | ||
DeliveryAttempts = table.Column<int>(type: "int", nullable: false), | ||
DeliveryMaxAttempts = table.Column<int>(type: "int", nullable: true), | ||
DeliveryFirstAttemptedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true), | ||
DeliveryLastAttemptedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true), | ||
DeliveryLastAttemptError = table.Column<string>(type: "nvarchar(4000)", maxLength: 4000, nullable: true), | ||
DeliveryNotBefore = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true), | ||
DeliveryNotAfter = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true), | ||
DeliveryAttemptDelay = table.Column<int>(type: "int", nullable: false), | ||
DeliveryAttemptDelayIsExponential = table.Column<bool>(type: "bit", nullable: false), | ||
RowVersion = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK___OutboxMessages", x => x.Id); | ||
}); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "SimpleUsers", | ||
columns: table => new | ||
{ | ||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_SimpleUsers", x => x.Id); | ||
}); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX___Outboxes_AddedAt", | ||
table: "__Outboxes", | ||
column: "AddedAt"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX___Outboxes_DeliveryDelayedUntil", | ||
table: "__Outboxes", | ||
column: "DeliveryDelayedUntil"); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "__Outboxes"); | ||
|
||
migrationBuilder.DropTable( | ||
name: "__OutboxFailedMessages"); | ||
|
||
migrationBuilder.DropTable( | ||
name: "__OutboxMessages"); | ||
|
||
migrationBuilder.DropTable( | ||
name: "SimpleUsers"); | ||
} | ||
} | ||
} |
Oops, something went wrong.