1
0
mirror of https://github.com/bitwarden/server synced 2026-01-19 00:43:47 +00:00

Rename PlayData -> PlayItem

This is still a join table, but the Data suffix was colliding with the concept of a JSON transfer model. The PlayItem name is designed to indicate that these records are not Play entities, but indications that a given Item (user or organization for now) is associated with a given Play
This commit is contained in:
Matt Gibson
2026-01-08 08:45:38 -08:00
parent 266925399c
commit 814612cb51
37 changed files with 216 additions and 218 deletions

View File

@@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace Bit.PostgresMigrations.Migrations
{
[DbContext(typeof(DatabaseContext))]
[Migration("20251118024041_PlayData")]
partial class PlayData
[Migration("20251118024041_PlayItem")]
partial class PlayItem
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -1629,7 +1629,7 @@ namespace Bit.PostgresMigrations.Migrations
b.ToTable("OrganizationUser", (string)null);
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.PlayData", b =>
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.PlayItem", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
@@ -1659,9 +1659,9 @@ namespace Bit.PostgresMigrations.Migrations
b.HasIndex("UserId")
.HasAnnotation("SqlServer:Clustered", false);
b.ToTable("PlayData", null, t =>
b.ToTable("PlayItem", null, t =>
{
t.HasCheckConstraint("CK_PlayData_UserOrOrganization", "(\"UserId\" IS NOT NULL AND \"OrganizationId\" IS NULL) OR (\"UserId\" IS NULL AND \"OrganizationId\" IS NOT NULL)");
t.HasCheckConstraint("CK_PlayItem_UserOrOrganization", "(\"UserId\" IS NOT NULL AND \"OrganizationId\" IS NULL) OR (\"UserId\" IS NULL AND \"OrganizationId\" IS NOT NULL)");
});
});
@@ -3039,7 +3039,7 @@ namespace Bit.PostgresMigrations.Migrations
b.Navigation("User");
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.PlayData", b =>
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.PlayItem", b =>
{
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", "Organization")
.WithMany()

View File

@@ -5,7 +5,7 @@
namespace Bit.PostgresMigrations.Migrations;
/// <inheritdoc />
public partial class PlayData : Migration
public partial class PlayItem : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
@@ -19,7 +19,7 @@ public partial class PlayData : Migration
oldType: "integer");
migrationBuilder.CreateTable(
name: "PlayData",
name: "PlayItem",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
@@ -30,16 +30,16 @@ public partial class PlayData : Migration
},
constraints: table =>
{
table.PrimaryKey("PK_PlayData", x => x.Id);
table.CheckConstraint("CK_PlayData_UserOrOrganization", "(\"UserId\" IS NOT NULL AND \"OrganizationId\" IS NULL) OR (\"UserId\" IS NULL AND \"OrganizationId\" IS NOT NULL)");
table.PrimaryKey("PK_PlayItem", x => x.Id);
table.CheckConstraint("CK_PlayItem_UserOrOrganization", "(\"UserId\" IS NOT NULL AND \"OrganizationId\" IS NULL) OR (\"UserId\" IS NULL AND \"OrganizationId\" IS NOT NULL)");
table.ForeignKey(
name: "FK_PlayData_Organization_OrganizationId",
name: "FK_PlayItem_Organization_OrganizationId",
column: x => x.OrganizationId,
principalTable: "Organization",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PlayData_User_UserId",
name: "FK_PlayItem_User_UserId",
column: x => x.UserId,
principalTable: "User",
principalColumn: "Id",
@@ -47,18 +47,18 @@ public partial class PlayData : Migration
});
migrationBuilder.CreateIndex(
name: "IX_PlayData_OrganizationId",
table: "PlayData",
name: "IX_PlayItem_OrganizationId",
table: "PlayItem",
column: "OrganizationId");
migrationBuilder.CreateIndex(
name: "IX_PlayData_PlayId",
table: "PlayData",
name: "IX_PlayItem_PlayId",
table: "PlayItem",
column: "PlayId");
migrationBuilder.CreateIndex(
name: "IX_PlayData_UserId",
table: "PlayData",
name: "IX_PlayItem_UserId",
table: "PlayItem",
column: "UserId");
}
@@ -66,7 +66,7 @@ public partial class PlayData : Migration
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PlayData");
name: "PlayItem");
migrationBuilder.AlterColumn<int>(
name: "WaitTimeDays",

View File

@@ -1632,7 +1632,7 @@ namespace Bit.PostgresMigrations.Migrations
b.ToTable("OrganizationUser", (string)null);
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.PlayData", b =>
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.PlayItem", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
@@ -1662,9 +1662,9 @@ namespace Bit.PostgresMigrations.Migrations
b.HasIndex("UserId")
.HasAnnotation("SqlServer:Clustered", false);
b.ToTable("PlayData", null, t =>
b.ToTable("PlayItem", null, t =>
{
t.HasCheckConstraint("CK_PlayData_UserOrOrganization", "(\"UserId\" IS NOT NULL AND \"OrganizationId\" IS NULL) OR (\"UserId\" IS NULL AND \"OrganizationId\" IS NOT NULL)");
t.HasCheckConstraint("CK_PlayItem_UserOrOrganization", "(\"UserId\" IS NOT NULL AND \"OrganizationId\" IS NULL) OR (\"UserId\" IS NULL AND \"OrganizationId\" IS NOT NULL)");
});
});
@@ -3045,7 +3045,7 @@ namespace Bit.PostgresMigrations.Migrations
b.Navigation("User");
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.PlayData", b =>
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.PlayItem", b =>
{
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", "Organization")
.WithMany()