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:
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
|
||||
6
util/Migrator/DbScripts/2025-12-18_00_SendAuthType.sql
Normal file
6
util/Migrator/DbScripts/2025-12-18_00_SendAuthType.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
IF COL_LENGTH('[dbo].[Send]', 'AuthType') IS NULL
|
||||
BEGIN
|
||||
ALTER TABLE [dbo].[Send]
|
||||
ADD [AuthType] TINYINT NULL;
|
||||
END
|
||||
GO
|
||||
11
util/Migrator/DbScripts/2025-12-18_01_SendEmailsLength.sql
Normal file
11
util/Migrator/DbScripts/2025-12-18_01_SendEmailsLength.sql
Normal 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
|
||||
3446
util/MySqlMigrations/Migrations/20251218153214_SendAuthTypeAndEmailLength.Designer.cs
generated
Normal file
3446
util/MySqlMigrations/Migrations/20251218153214_SendAuthTypeAndEmailLength.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)");
|
||||
|
||||
3452
util/PostgresMigrations/Migrations/20251218153210_SendAuthTypeAndEmailLength.Designer.cs
generated
Normal file
3452
util/PostgresMigrations/Migrations/20251218153210_SendAuthTypeAndEmailLength.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
|
||||
3435
util/SqliteMigrations/Migrations/20251218153206_SendAuthTypeAndEmailLength.Designer.cs
generated
Normal file
3435
util/SqliteMigrations/Migrations/20251218153206_SendAuthTypeAndEmailLength.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.
Reference in New Issue
Block a user