1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00

Merge branch 'main' into ac/ac-1682/ef-migrations

# Conflicts:
#	src/Sql/dbo/Stored Procedures/Organization_EnableCollectionEnhancements.sql
#	util/SqliteMigrations/SqliteMigrations.csproj
This commit is contained in:
Rui Tome
2024-02-16 12:47:39 +00:00
382 changed files with 22664 additions and 5025 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,47 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.PostgresMigrations.Migrations;
/// <inheritdoc />
public partial class AddAuthTableIndexes : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_SsoUser_OrganizationId_ExternalId",
table: "SsoUser",
columns: new[] { "OrganizationId", "ExternalId" },
unique: true)
.Annotation("Npgsql:IndexInclude", new[] { "UserId" });
migrationBuilder.CreateIndex(
name: "IX_SsoUser_OrganizationId_UserId",
table: "SsoUser",
columns: new[] { "OrganizationId", "UserId" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Grant_ExpirationDate",
table: "Grant",
column: "ExpirationDate");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_SsoUser_OrganizationId_ExternalId",
table: "SsoUser");
migrationBuilder.DropIndex(
name: "IX_SsoUser_OrganizationId_UserId",
table: "SsoUser");
migrationBuilder.DropIndex(
name: "IX_Grant_ExpirationDate",
table: "Grant");
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.PostgresMigrations.Migrations;
/// <inheritdoc />
public partial class RemoveSMBetaFromOrganization : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "SecretsManagerBeta",
table: "Organization");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "SecretsManagerBeta",
table: "Organization",
type: "boolean",
nullable: false,
defaultValue: false);
}
}

View File

@ -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", "7.0.14")
.HasAnnotation("ProductVersion", "7.0.15")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
@ -140,9 +140,6 @@ namespace Bit.PostgresMigrations.Migrations
b.Property<int?>("Seats")
.HasColumnType("integer");
b.Property<bool>("SecretsManagerBeta")
.HasColumnType("boolean");
b.Property<bool>("SelfHost")
.HasColumnType("boolean");
@ -539,8 +536,12 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("character varying(50)");
b.HasKey("Id")
.HasName("PK_Grant")
.HasAnnotation("SqlServer:Clustered", true);
b.HasIndex("ExpirationDate")
.HasAnnotation("SqlServer:Clustered", false);
b.HasIndex("Key")
.IsUnique();
@ -601,10 +602,21 @@ namespace Bit.PostgresMigrations.Migrations
b.HasKey("Id");
b.HasIndex("OrganizationId");
b.HasIndex("OrganizationId")
.HasAnnotation("SqlServer:Clustered", false);
b.HasIndex("UserId");
b.HasIndex("OrganizationId", "ExternalId")
.IsUnique()
.HasAnnotation("SqlServer:Clustered", false);
NpgsqlIndexBuilderExtensions.IncludeProperties(b.HasIndex("OrganizationId", "ExternalId"), new[] { "UserId" });
b.HasIndex("OrganizationId", "UserId")
.IsUnique()
.HasAnnotation("SqlServer:Clustered", false);
b.ToTable("SsoUser", (string)null);
});

View File

@ -6,7 +6,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.14">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.15">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>