mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
[PM-2943] Enable Nullable Repositories in Unowned Files (#4549)
* Enable Nullable In Unowned Repos * Update More Tests * Move to One If * Fix Collections * Format * Add Migrations * Move Pragma Annotation * Add Better Assert Message
This commit is contained in:
2697
util/MySqlMigrations/Migrations/20240724001641_MakeBlobNonNull.Designer.cs
generated
Normal file
2697
util/MySqlMigrations/Migrations/20240724001641_MakeBlobNonNull.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,35 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.MySqlMigrations.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class MakeBlobNonNull : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<byte[]>(
|
||||
name: "Value",
|
||||
table: "Cache",
|
||||
type: "longblob",
|
||||
nullable: false,
|
||||
defaultValue: new byte[0],
|
||||
oldClrType: typeof(byte[]),
|
||||
oldType: "longblob",
|
||||
oldNullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<byte[]>(
|
||||
name: "Value",
|
||||
table: "Cache",
|
||||
type: "longblob",
|
||||
nullable: true,
|
||||
oldClrType: typeof(byte[]),
|
||||
oldType: "longblob");
|
||||
}
|
||||
}
|
@ -17,7 +17,7 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.6")
|
||||
.HasAnnotation("ProductVersion", "8.0.7")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
|
||||
@ -780,6 +780,7 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<byte[]>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("longblob");
|
||||
|
||||
b.HasKey("Id")
|
||||
@ -1622,7 +1623,7 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
|
||||
b.ToTable("AccessPolicy", (string)null);
|
||||
|
||||
b.HasDiscriminator<string>("Discriminator").HasValue("AccessPolicy");
|
||||
b.HasDiscriminator().HasValue("AccessPolicy");
|
||||
|
||||
b.UseTphMappingStrategy();
|
||||
});
|
||||
|
2704
util/PostgresMigrations/Migrations/20240724001647_MakeBlobNonNull.Designer.cs
generated
Normal file
2704
util/PostgresMigrations/Migrations/20240724001647_MakeBlobNonNull.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,35 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.PostgresMigrations.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class MakeBlobNonNull : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<byte[]>(
|
||||
name: "Value",
|
||||
table: "Cache",
|
||||
type: "bytea",
|
||||
nullable: false,
|
||||
defaultValue: new byte[0],
|
||||
oldClrType: typeof(byte[]),
|
||||
oldType: "bytea",
|
||||
oldNullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<byte[]>(
|
||||
name: "Value",
|
||||
table: "Cache",
|
||||
type: "bytea",
|
||||
nullable: true,
|
||||
oldClrType: typeof(byte[]),
|
||||
oldType: "bytea");
|
||||
}
|
||||
}
|
@ -18,7 +18,7 @@ namespace Bit.PostgresMigrations.Migrations
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Npgsql:CollationDefinition:postgresIndetermanisticCollation", "en-u-ks-primary,en-u-ks-primary,icu,False")
|
||||
.HasAnnotation("ProductVersion", "8.0.6")
|
||||
.HasAnnotation("ProductVersion", "8.0.7")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
@ -785,6 +785,7 @@ namespace Bit.PostgresMigrations.Migrations
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<byte[]>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("bytea");
|
||||
|
||||
b.HasKey("Id")
|
||||
@ -1629,7 +1630,7 @@ namespace Bit.PostgresMigrations.Migrations
|
||||
|
||||
b.ToTable("AccessPolicy", (string)null);
|
||||
|
||||
b.HasDiscriminator<string>("Discriminator").HasValue("AccessPolicy");
|
||||
b.HasDiscriminator().HasValue("AccessPolicy");
|
||||
|
||||
b.UseTphMappingStrategy();
|
||||
});
|
||||
|
2686
util/SqliteMigrations/Migrations/20240724001634_MakeBlobNonNull.Designer.cs
generated
Normal file
2686
util/SqliteMigrations/Migrations/20240724001634_MakeBlobNonNull.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,35 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.SqliteMigrations.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class MakeBlobNonNull : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<byte[]>(
|
||||
name: "Value",
|
||||
table: "Cache",
|
||||
type: "BLOB",
|
||||
nullable: false,
|
||||
defaultValue: new byte[0],
|
||||
oldClrType: typeof(byte[]),
|
||||
oldType: "BLOB",
|
||||
oldNullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<byte[]>(
|
||||
name: "Value",
|
||||
table: "Cache",
|
||||
type: "BLOB",
|
||||
nullable: true,
|
||||
oldClrType: typeof(byte[]),
|
||||
oldType: "BLOB");
|
||||
}
|
||||
}
|
@ -15,7 +15,7 @@ namespace Bit.SqliteMigrations.Migrations
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.6");
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.7");
|
||||
|
||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", b =>
|
||||
{
|
||||
@ -769,6 +769,7 @@ namespace Bit.SqliteMigrations.Migrations
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<byte[]>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.HasKey("Id")
|
||||
@ -1611,7 +1612,7 @@ namespace Bit.SqliteMigrations.Migrations
|
||||
|
||||
b.ToTable("AccessPolicy", (string)null);
|
||||
|
||||
b.HasDiscriminator<string>("Discriminator").HasValue("AccessPolicy");
|
||||
b.HasDiscriminator().HasValue("AccessPolicy");
|
||||
|
||||
b.UseTphMappingStrategy();
|
||||
});
|
||||
|
Reference in New Issue
Block a user