1
0
mirror of https://github.com/bitwarden/server synced 2026-01-12 13:33:24 +00:00

add AuthType col to Sends table, change Emails col length to 4000, and run migrations

This commit is contained in:
John Harrington
2025-12-18 08:46:02 -07:00
parent 8a273fc92f
commit bfd06c0c87
14 changed files with 10464 additions and 7 deletions

View File

@@ -78,7 +78,7 @@ public class Send : ITableObject<Guid>
/// <remarks>
/// This field is mutually exclusive with <see cref="Password" />
/// </remarks>
[MaxLength(1024)]
[MaxLength(4000)]
public string? Emails { get; set; }
/// <summary>

View File

@@ -3,10 +3,11 @@
[UserId] UNIQUEIDENTIFIER NULL,
[OrganizationId] UNIQUEIDENTIFIER NULL,
[Type] TINYINT NOT NULL,
[AuthType] TINYINT NULL,
[Data] VARCHAR(MAX) NOT NULL,
[Key] VARCHAR (MAX) NOT NULL,
[Password] NVARCHAR (300) NULL,
[Emails] NVARCHAR (1024) NULL,
[Emails] NVARCHAR (4000) NULL,
[MaxAccessCount] INT NULL,
[AccessCount] INT NOT NULL,
[CreationDate] DATETIME2 (7) NOT NULL,

View File

@@ -0,0 +1,6 @@
IF COL_LENGTH('[dbo].[Send]', 'AuthType') IS NULL
BEGIN
ALTER TABLE [dbo].[Send]
ADD [AuthType] TINYINT NULL;
END
GO

View File

@@ -0,0 +1,11 @@
IF EXISTS (
SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME = 'Emails' AND
DATA_TYPE = 'NVARCHAR (1024)' AND
TABLE_NAME = 'Send')
BEGIN
ALTER TABLE [dbo].[Send]
ALTER COLUMN [Emails] NVARCHAR (4000) NULL
END
GO

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -1651,8 +1651,8 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("tinyint(1)");
b.Property<string>("Emails")
.HasMaxLength(1024)
.HasColumnType("varchar(1024)");
.HasMaxLength(4000)
.HasColumnType("varchar(4000)");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("datetime(6)");

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -1656,8 +1656,8 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("boolean");
b.Property<string>("Emails")
.HasMaxLength(1024)
.HasColumnType("character varying(1024)");
.HasMaxLength(4000)
.HasColumnType("character varying(4000)");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("timestamp with time zone");

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -1640,7 +1640,7 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("INTEGER");
b.Property<string>("Emails")
.HasMaxLength(1024)
.HasMaxLength(4000)
.HasColumnType("TEXT");
b.Property<DateTime?>("ExpirationDate")

Binary file not shown.