Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove the release notes length limit #687

Merged
merged 1 commit into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems sketch but from my testing it doesn't seem to cause any problems... 😅

}

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
Loading