mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
Remove Unused Auto Properties (#2580)
* Correct Auto Navigation Property * Add Needed Migration
This commit is contained in:
2098
util/MySqlMigrations/Migrations/20230113175447_Fix Navigation Properties.Designer.cs
generated
Normal file
2098
util/MySqlMigrations/Migrations/20230113175447_Fix Navigation Properties.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,76 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.MySqlMigrations.Migrations;
|
||||
|
||||
public partial class FixNavigationProperties : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_CollectionUsers_User_UserId",
|
||||
table: "CollectionUsers");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_GroupUser_User_UserId",
|
||||
table: "GroupUser");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_GroupUser_UserId",
|
||||
table: "GroupUser");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_CollectionUsers_UserId",
|
||||
table: "CollectionUsers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UserId",
|
||||
table: "GroupUser");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UserId",
|
||||
table: "CollectionUsers");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "UserId",
|
||||
table: "GroupUser",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "UserId",
|
||||
table: "CollectionUsers",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GroupUser_UserId",
|
||||
table: "GroupUser",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CollectionUsers_UserId",
|
||||
table: "CollectionUsers",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CollectionUsers_User_UserId",
|
||||
table: "CollectionUsers",
|
||||
column: "UserId",
|
||||
principalTable: "User",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_GroupUser_User_UserId",
|
||||
table: "GroupUser",
|
||||
column: "UserId",
|
||||
principalTable: "User",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
}
|
@ -280,15 +280,10 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
b.Property<bool>("ReadOnly")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<Guid?>("UserId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.HasKey("CollectionId", "OrganizationUserId");
|
||||
|
||||
b.HasIndex("OrganizationUserId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("CollectionUsers");
|
||||
});
|
||||
|
||||
@ -546,15 +541,10 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
b.Property<Guid>("OrganizationUserId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<Guid?>("UserId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.HasKey("GroupId", "OrganizationUserId");
|
||||
|
||||
b.HasIndex("OrganizationUserId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("GroupUser", (string)null);
|
||||
});
|
||||
|
||||
@ -1676,10 +1666,6 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", null)
|
||||
.WithMany("CollectionUsers")
|
||||
.HasForeignKey("UserId");
|
||||
|
||||
b.Navigation("Collection");
|
||||
|
||||
b.Navigation("OrganizationUser");
|
||||
@ -1744,15 +1730,11 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser")
|
||||
.WithMany()
|
||||
.WithMany("GroupUsers")
|
||||
.HasForeignKey("OrganizationUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", null)
|
||||
.WithMany("GroupUsers")
|
||||
.HasForeignKey("UserId");
|
||||
|
||||
b.Navigation("Group");
|
||||
|
||||
b.Navigation("OrganizationUser");
|
||||
@ -2083,6 +2065,8 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", b =>
|
||||
{
|
||||
b.Navigation("CollectionUsers");
|
||||
|
||||
b.Navigation("GroupUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Project", b =>
|
||||
@ -2098,12 +2082,8 @@ namespace Bit.MySqlMigrations.Migrations
|
||||
{
|
||||
b.Navigation("Ciphers");
|
||||
|
||||
b.Navigation("CollectionUsers");
|
||||
|
||||
b.Navigation("Folders");
|
||||
|
||||
b.Navigation("GroupUsers");
|
||||
|
||||
b.Navigation("OrganizationUsers");
|
||||
|
||||
b.Navigation("SsoUsers");
|
||||
|
Reference in New Issue
Block a user