1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-20 02:31:30 +01:00

PM-10600: Missing Notification Center MaxLength on Body column (#5402)

This commit is contained in:
Maciej Zieniuk 2025-02-13 14:14:55 +01:00 committed by GitHub
parent 459c91a5a9
commit 0c482eea32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 9129 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,41 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
/// <inheritdoc />
public partial class NotificationCenterBodyLength : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Body",
table: "Notification",
type: "varchar(3000)",
maxLength: 3000,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Body",
table: "Notification",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(3000)",
oldMaxLength: 3000,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}

View File

@ -1654,7 +1654,8 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("char(36)");
b.Property<string>("Body")
.HasColumnType("longtext");
.HasMaxLength(3000)
.HasColumnType("varchar(3000)");
b.Property<byte>("ClientType")
.HasColumnType("tinyint unsigned");

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,37 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.PostgresMigrations.Migrations;
/// <inheritdoc />
public partial class NotificationCenterBodyLength : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Body",
table: "Notification",
type: "character varying(3000)",
maxLength: 3000,
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Body",
table: "Notification",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(3000)",
oldMaxLength: 3000,
oldNullable: true);
}
}

View File

@ -1660,7 +1660,8 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<string>("Body")
.HasColumnType("text");
.HasMaxLength(3000)
.HasColumnType("character varying(3000)");
b.Property<byte>("ClientType")
.HasColumnType("smallint");

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,21 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.SqliteMigrations.Migrations;
/// <inheritdoc />
public partial class NotificationCenterBodyLength : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}

View File

@ -1643,6 +1643,7 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("TEXT");
b.Property<string>("Body")
.HasMaxLength(3000)
.HasColumnType("TEXT");
b.Property<byte>("ClientType")