Skip to content

Commit

Permalink
Remove the release notes length limit (#687)
Browse files Browse the repository at this point in the history
Kudos to @dncnkrs for the original implementation. 

This allows BaGet to index packages with large release notes, like https://www.nuget.org/packages/chocolatey/0.10.6.1
  • Loading branch information
loic-sharma committed Sep 23, 2021
1 parent 2fdb83f commit 8474f25
Show file tree
Hide file tree
Showing 13 changed files with 1,095 additions and 14 deletions.
3 changes: 1 addition & 2 deletions src/BaGet.Core/Entities/AbstractContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ private void BuildPackageEntity(EntityTypeBuilder<Package> package)
.HasMaxLength(MaxPackageVersionLength);

package.Property(p => p.ReleaseNotes)
.HasColumnName("ReleaseNotes")
.HasMaxLength(DefaultMaxStringLength);
.HasColumnName("ReleaseNotes");

package.Property(p => p.Authors)
.HasMaxLength(DefaultMaxStringLength)
Expand Down

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,35 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace BaGet.Database.MySql.Migrations
{
public partial class RemoveReleaseNotesMaxLength : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "RowVersion",
table: "Packages",
rowVersion: true,
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp(6)",
oldNullable: true)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn);
}

protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "RowVersion",
table: "Packages",
type: "timestamp(6)",
nullable: true,
oldClrType: typeof(DateTime),
oldRowVersion: true,
oldNullable: true)
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.1.1")
.HasAnnotation("ProductVersion", "3.1.18")
.HasAnnotation("Relational:MaxIdentifierLength", 64);

modelBuilder.Entity("BaGet.Core.Package", b =>
Expand Down Expand Up @@ -87,8 +87,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<string>("ReleaseNotes")
.HasColumnName("ReleaseNotes")
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasMaxLength(4000);
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<string>("RepositoryType")
.HasColumnType("varchar(100) CHARACTER SET utf8mb4")
Expand Down

0 comments on commit 8474f25

Please sign in to comment.