Added collation migration in SqLite

This commit is contained in:
JPVenson 2025-02-02 02:13:37 +00:00
parent 4b57f2bdbb
commit 2e5ff6842a
3 changed files with 1636 additions and 3 deletions

View File

@ -0,0 +1,40 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Jellyfin.Server.Implementations.Migrations
{
/// <inheritdoc />
public partial class FixedCollation : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Username",
table: "Users",
type: "TEXT",
maxLength: 255,
nullable: false,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 255,
oldCollation: "NOCASE");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Username",
table: "Users",
type: "TEXT",
maxLength: 255,
nullable: false,
collation: "NOCASE",
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 255);
}
}
}

View File

@ -15,7 +15,7 @@ namespace Jellyfin.Server.Implementations.Migrations
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "8.0.10");
modelBuilder.HasAnnotation("ProductVersion", "9.0.1");
modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
{
@ -1244,8 +1244,7 @@ namespace Jellyfin.Server.Implementations.Migrations
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT")
.UseCollation("NOCASE");
.HasColumnType("TEXT");
b.HasKey("Id");