mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 00:22:50 -05:00
Merge branch 'master' into feature/flexible-collections
This commit is contained in:
2236
util/MySqlMigrations/Migrations/20230824202452_ACCESSPOLICY_ADD_DELETE_CASCADE.Designer.cs
generated
Normal file
2236
util/MySqlMigrations/Migrations/20230824202452_ACCESSPOLICY_ADD_DELETE_CASCADE.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,63 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.MySqlMigrations.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class ACCESSPOLICY_ADD_DELETE_CASCADE : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_AccessPolicy_Group_GroupId",
|
||||
table: "AccessPolicy");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_AccessPolicy_Project_GrantedProjectId",
|
||||
table: "AccessPolicy");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AccessPolicy_Group_GroupId",
|
||||
table: "AccessPolicy",
|
||||
column: "GroupId",
|
||||
principalTable: "Group",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AccessPolicy_Project_GrantedProjectId",
|
||||
table: "AccessPolicy",
|
||||
column: "GrantedProjectId",
|
||||
principalTable: "Project",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_AccessPolicy_Group_GroupId",
|
||||
table: "AccessPolicy");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_AccessPolicy_Project_GrantedProjectId",
|
||||
table: "AccessPolicy");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AccessPolicy_Group_GroupId",
|
||||
table: "AccessPolicy",
|
||||
column: "GroupId",
|
||||
principalTable: "Group",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AccessPolicy_Project_GrantedProjectId",
|
||||
table: "AccessPolicy",
|
||||
column: "GrantedProjectId",
|
||||
principalTable: "Project",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
}
|
@ -2082,11 +2082,13 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
{
|
||||
b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject")
|
||||
.WithMany("GroupAccessPolicies")
|
||||
.HasForeignKey("GrantedProjectId");
|
||||
.HasForeignKey("GrantedProjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group")
|
||||
.WithMany()
|
||||
.HasForeignKey("GroupId");
|
||||
.HasForeignKey("GroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.Navigation("GrantedProject");
|
||||
|
||||
@ -2101,7 +2103,8 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
|
||||
b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group")
|
||||
.WithMany()
|
||||
.HasForeignKey("GroupId");
|
||||
.HasForeignKey("GroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.Navigation("GrantedServiceAccount");
|
||||
|
||||
@ -2112,7 +2115,8 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
{
|
||||
b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject")
|
||||
.WithMany("ServiceAccountAccessPolicies")
|
||||
.HasForeignKey("GrantedProjectId");
|
||||
.HasForeignKey("GrantedProjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "ServiceAccount")
|
||||
.WithMany()
|
||||
@ -2127,7 +2131,8 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
{
|
||||
b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject")
|
||||
.WithMany("UserAccessPolicies")
|
||||
.HasForeignKey("GrantedProjectId");
|
||||
.HasForeignKey("GrantedProjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser")
|
||||
.WithMany()
|
||||
|
Reference in New Issue
Block a user