fix: Icon-Spalte von 50 auf 2000 Zeichen erweitert. Das Update sollte jetzt funktionieren.

This commit is contained in:
beo3000 2026-01-04 13:03:23 +01:00
parent 3c7050e172
commit 7afc242be4
5 changed files with 1633 additions and 4 deletions

View File

@ -36,7 +36,7 @@ public class BookingCategoryConfiguration : IEntityTypeConfiguration<BookingCate
.HasMaxLength(7); // #RRGGBB
builder.Property(x => x.Icon)
.HasMaxLength(50);
.HasMaxLength(2000);
builder.Property(x => x.IsActive)
.IsRequired();

View File

@ -0,0 +1,42 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Koogle.Infrastructure.Data.Migrations
{
/// <inheritdoc />
public partial class IncreaseBookingCategoryIconLength : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Icon",
schema: "app",
table: "BookingCategories",
type: "nvarchar(2000)",
maxLength: 2000,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Icon",
schema: "app",
table: "BookingCategories",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(2000)",
oldMaxLength: 2000,
oldNullable: true);
}
}
}

View File

@ -50,8 +50,8 @@ namespace Koogle.Infrastructure.Data.Migrations
.HasColumnType("nvarchar(500)");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<bool>("IsActive")
.HasColumnType("bit");

View File

@ -61,7 +61,15 @@ public class BookingCategoryRepository(IDbContextFactory<AppDbContext> contextFa
await using var context = await contextFactory.CreateDbContextAsync(ct);
entity.ModifiedAt = DateTime.UtcNow;
context.BookingCategories.Update(entity);
await context.SaveChangesAsync(ct);
try
{
await context.SaveChangesAsync(ct);
}
catch (Exception e)
{
throw;
}
return entity;
}
}