Skip to content

Commit

Permalink
Increase maximum size of external event sync item's error code to 100 (
Browse files Browse the repository at this point in the history
…#840)

* feat: increase max length of error code to 100

* feat: add migrations
  • Loading branch information
tnotheis authored Sep 4, 2024
1 parent 9c6d8ab commit 65bae08
Show file tree
Hide file tree
Showing 8 changed files with 716 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class EventResultValidator : AbstractValidator<FinalizeExternalEventSyncS
public EventResultValidator()
{
RuleFor(i => i.ExternalEventId).ValidId<FinalizeExternalEventSyncSyncRunCommand.ExternalEventResult, ExternalEventId>();
RuleFor(i => i.ErrorCode).MaximumLength(50);
RuleFor(i => i.ErrorCode).MaximumLength(100);
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Backbone.Modules.Synchronization.Infrastructure.Database.Postgres.Migrations
{
/// <inheritdoc />
public partial class IncreaseMaxSizeOfSyncErrorErrorCodeTo100 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "ErrorCode",
schema: "Synchronization",
table: "SyncErrors",
type: "character varying(100)",
maxLength: 100,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50);
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "ErrorCode",
schema: "Synchronization",
table: "SyncErrors",
type: "character varying(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(100)",
oldMaxLength: 100);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b.Property<string>("ErrorCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
.HasMaxLength(100)
.HasColumnType("character varying(100)");

b.Property<string>("ExternalEventId")
.IsRequired()
Expand Down
Loading

0 comments on commit 65bae08

Please sign in to comment.