Skip to content

Commit 8474f25

Browse files
authored
Remove the release notes length limit (loic-sharma#687)
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
1 parent 2fdb83f commit 8474f25

13 files changed

+1095
-14
lines changed

src/BaGet.Core/Entities/AbstractContext.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ private void BuildPackageEntity(EntityTypeBuilder<Package> package)
6868
.HasMaxLength(MaxPackageVersionLength);
6969

7070
package.Property(p => p.ReleaseNotes)
71-
.HasColumnName("ReleaseNotes")
72-
.HasMaxLength(DefaultMaxStringLength);
71+
.HasColumnName("ReleaseNotes");
7372

7473
package.Property(p => p.Authors)
7574
.HasMaxLength(DefaultMaxStringLength)

src/BaGet.Database.MySql/Migrations/20210919191554_RemoveReleaseNotesMaxLength.Designer.cs

+240
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System;
2+
using Microsoft.EntityFrameworkCore.Metadata;
3+
using Microsoft.EntityFrameworkCore.Migrations;
4+
5+
namespace BaGet.Database.MySql.Migrations
6+
{
7+
public partial class RemoveReleaseNotesMaxLength : Migration
8+
{
9+
protected override void Up(MigrationBuilder migrationBuilder)
10+
{
11+
migrationBuilder.AlterColumn<DateTime>(
12+
name: "RowVersion",
13+
table: "Packages",
14+
rowVersion: true,
15+
nullable: true,
16+
oldClrType: typeof(DateTime),
17+
oldType: "timestamp(6)",
18+
oldNullable: true)
19+
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn);
20+
}
21+
22+
protected override void Down(MigrationBuilder migrationBuilder)
23+
{
24+
migrationBuilder.AlterColumn<DateTime>(
25+
name: "RowVersion",
26+
table: "Packages",
27+
type: "timestamp(6)",
28+
nullable: true,
29+
oldClrType: typeof(DateTime),
30+
oldRowVersion: true,
31+
oldNullable: true)
32+
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn);
33+
}
34+
}
35+
}

src/BaGet.Database.MySql/Migrations/MySqlContextModelSnapshot.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
1414
{
1515
#pragma warning disable 612, 618
1616
modelBuilder
17-
.HasAnnotation("ProductVersion", "3.1.1")
17+
.HasAnnotation("ProductVersion", "3.1.18")
1818
.HasAnnotation("Relational:MaxIdentifierLength", 64);
1919

2020
modelBuilder.Entity("BaGet.Core.Package", b =>
@@ -87,8 +87,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
8787

8888
b.Property<string>("ReleaseNotes")
8989
.HasColumnName("ReleaseNotes")
90-
.HasColumnType("longtext CHARACTER SET utf8mb4")
91-
.HasMaxLength(4000);
90+
.HasColumnType("longtext CHARACTER SET utf8mb4");
9291

9392
b.Property<string>("RepositoryType")
9493
.HasColumnType("varchar(100) CHARACTER SET utf8mb4")

0 commit comments

Comments
 (0)