Browse Source

fix media file path length for mysql (#2191)

pull/2193/head
Jason Dove 1 year ago committed by GitHub
parent
commit
5ccea53131
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 6141
      ErsatzTV.Infrastructure.MySql/Migrations/20250723030616_Update_MediaFilePath.Designer.cs
  3. 40
      ErsatzTV.Infrastructure.MySql/Migrations/20250723030616_Update_MediaFilePath.cs
  4. 2
      ErsatzTV.Infrastructure.MySql/Migrations/TvContextModelSnapshot.cs
  5. 6
      ErsatzTV.Infrastructure/Data/TvContext.cs

1
CHANGELOG.md

@ -163,6 +163,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -163,6 +163,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix QSV frame freezing in browser
- Fix some stream continuity issues, and some cases where audio sync is lost at transition
- Fix HDR transcoding with AMD VAAPI accel
- Allow paths longer than 255 characters in MySql databases
## [25.2.0] - 2025-06-24
### Added

6141
ErsatzTV.Infrastructure.MySql/Migrations/20250723030616_Update_MediaFilePath.Designer.cs generated

File diff suppressed because it is too large Load Diff

40
ErsatzTV.Infrastructure.MySql/Migrations/20250723030616_Update_MediaFilePath.cs

@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.MySql.Migrations
{
/// <inheritdoc />
public partial class Update_MediaFilePath : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Path",
table: "MediaFile",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(255)",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Path",
table: "MediaFile",
type: "varchar(255)",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}

2
ErsatzTV.Infrastructure.MySql/Migrations/TvContextModelSnapshot.cs

@ -1111,7 +1111,7 @@ namespace ErsatzTV.Infrastructure.MySql.Migrations @@ -1111,7 +1111,7 @@ namespace ErsatzTV.Infrastructure.MySql.Migrations
.HasColumnType("int");
b.Property<string>("Path")
.HasColumnType("varchar(255)");
.HasColumnType("longtext");
b.HasKey("Id");

6
ErsatzTV.Infrastructure/Data/TvContext.cs

@ -119,6 +119,12 @@ public class TvContext : DbContext @@ -119,6 +119,12 @@ public class TvContext : DbContext
{
base.OnModelCreating(modelBuilder);
// mysql-specific configuration
if ((Database.ProviderName ?? string.Empty).Contains("MySql", StringComparison.InvariantCultureIgnoreCase))
{
modelBuilder.Entity<MediaFile>().Property(mf => mf.Path).HasColumnType("longtext");
}
modelBuilder.ApplyConfigurationsFromAssembly(typeof(TvContext).Assembly);
}
}

Loading…
Cancel
Save