fix: Icon-Spalte von 50 auf 2000 Zeichen erweitert. Das Update sollte jetzt funktionieren.
This commit is contained in:
parent
3c7050e172
commit
7afc242be4
|
|
@ -36,7 +36,7 @@ public class BookingCategoryConfiguration : IEntityTypeConfiguration<BookingCate
|
||||||
.HasMaxLength(7); // #RRGGBB
|
.HasMaxLength(7); // #RRGGBB
|
||||||
|
|
||||||
builder.Property(x => x.Icon)
|
builder.Property(x => x.Icon)
|
||||||
.HasMaxLength(50);
|
.HasMaxLength(2000);
|
||||||
|
|
||||||
builder.Property(x => x.IsActive)
|
builder.Property(x => x.IsActive)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
|
||||||
1579
src/Koogle.Infrastructure/Data/Migrations/20260104120238_IncreaseBookingCategoryIconLength.Designer.cs
generated
Normal file
1579
src/Koogle.Infrastructure/Data/Migrations/20260104120238_IncreaseBookingCategoryIconLength.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -50,8 +50,8 @@ namespace Koogle.Infrastructure.Data.Migrations
|
||||||
.HasColumnType("nvarchar(500)");
|
.HasColumnType("nvarchar(500)");
|
||||||
|
|
||||||
b.Property<string>("Icon")
|
b.Property<string>("Icon")
|
||||||
.HasMaxLength(50)
|
.HasMaxLength(2000)
|
||||||
.HasColumnType("nvarchar(50)");
|
.HasColumnType("nvarchar(2000)");
|
||||||
|
|
||||||
b.Property<bool>("IsActive")
|
b.Property<bool>("IsActive")
|
||||||
.HasColumnType("bit");
|
.HasColumnType("bit");
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,15 @@ public class BookingCategoryRepository(IDbContextFactory<AppDbContext> contextFa
|
||||||
await using var context = await contextFactory.CreateDbContextAsync(ct);
|
await using var context = await contextFactory.CreateDbContextAsync(ct);
|
||||||
entity.ModifiedAt = DateTime.UtcNow;
|
entity.ModifiedAt = DateTime.UtcNow;
|
||||||
context.BookingCategories.Update(entity);
|
context.BookingCategories.Update(entity);
|
||||||
await context.SaveChangesAsync(ct);
|
try
|
||||||
|
{
|
||||||
|
await context.SaveChangesAsync(ct);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
|
||||||
|
throw;
|
||||||
|
}
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue