[backend/database] Remove length limit on note.cw column (ISH-84)

This commit is contained in:
Laura Hausmann 2024-03-04 01:11:29 +01:00
parent ecaaa27d87
commit 7655e216ec
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
4 changed files with 6204 additions and 3 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,38 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Iceshrimp.Backend.Core.Database.Migrations
{
/// <inheritdoc />
public partial class RemoveCwLengthRestriction : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "cw",
table: "note",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(512)",
oldMaxLength: 512,
oldNullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "cw",
table: "note",
type: "character varying(512)",
maxLength: 512,
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
}
}
}

View file

@ -2434,8 +2434,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
.HasComment("The created date of the Note.");
b.Property<string>("Cw")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasColumnType("text")
.HasColumnName("cw");
b.Property<List<string>>("Emojis")

View file

@ -63,7 +63,7 @@ public class Note : IEntity
[Column("name")] [StringLength(256)] public string? Name { get; set; }
[Column("cw")] [StringLength(512)] public string? Cw { get; set; }
[Column("cw")] public string? Cw { get; set; }
/// <summary>
/// The ID of author.