[backend/database] Increase instance softwareName and softwareVersion max length to 256

This commit is contained in:
Laura Hausmann 2024-04-27 21:26:54 +02:00
parent 7dd0262333
commit d7a69375b6
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
3 changed files with 75 additions and 6 deletions

View file

@ -1498,14 +1498,14 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
.HasColumnName("outgoingFollows");
b.Property<string>("SoftwareName")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("softwareName")
.HasComment("The software of the Instance.");
b.Property<string>("SoftwareVersion")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("softwareVersion");
b.Property<string>("ThemeColor")

View file

@ -0,0 +1,69 @@
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Infrastructure;
#nullable disable
namespace Iceshrimp.Backend.Core.Database.Migrations
{
/// <inheritdoc />
[DbContext(typeof(DatabaseContext))]
[Migration("20240427192537_IncreaseInstanceSoftwareNameVersionLength")]
public partial class IncreaseInstanceSoftwareNameVersionLength : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "softwareVersion",
table: "instance",
type: "character varying(256)",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(64)",
oldMaxLength: 64,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "softwareName",
table: "instance",
type: "character varying(256)",
maxLength: 256,
nullable: true,
comment: "The software of the Instance.",
oldClrType: typeof(string),
oldType: "character varying(64)",
oldMaxLength: 64,
oldNullable: true,
oldComment: "The software of the Instance.");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "softwareVersion",
table: "instance",
type: "character varying(64)",
maxLength: 64,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(256)",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "softwareName",
table: "instance",
type: "character varying(64)",
maxLength: 64,
nullable: true,
comment: "The software of the Instance.",
oldClrType: typeof(string),
oldType: "character varying(256)",
oldMaxLength: 256,
oldNullable: true,
oldComment: "The software of the Instance.");
}
}
}

View file

@ -61,11 +61,11 @@ public class Instance
/// The software of the Instance.
/// </summary>
[Column("softwareName")]
[StringLength(64)]
[StringLength(256)]
public string? SoftwareName { get; set; }
[Column("softwareVersion")]
[StringLength(64)]
[StringLength(256)]
public string? SoftwareVersion { get; set; }
[Column("openRegistrations")] public bool? OpenRegistrations { get; set; }