1
0
mirror of https://github.com/bitwarden/server synced 2026-01-21 03:43:53 +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

@@ -11,8 +11,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Bit.SqliteMigrations.Migrations
{
[DbContext(typeof(DatabaseContext))]
[Migration("20251118024036_PlayData")]
partial class PlayData
[Migration("20251118024036_PlayItem")]
partial class PlayItem
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -1613,7 +1613,7 @@ namespace Bit.SqliteMigrations.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("TEXT");
@@ -1643,9 +1643,9 @@ namespace Bit.SqliteMigrations.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)");
});
});
@@ -3022,7 +3022,7 @@ namespace Bit.SqliteMigrations.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,13 +5,13 @@
namespace Bit.SqliteMigrations.Migrations;
/// <inheritdoc />
public partial class PlayData : Migration
public partial class PlayItem : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "PlayData",
name: "PlayItem",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
@@ -22,16 +22,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",
@@ -39,18 +39,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");
}
@@ -58,6 +58,6 @@ public partial class PlayData : Migration
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PlayData");
name: "PlayItem");
}
}

View File

@@ -1616,7 +1616,7 @@ namespace Bit.SqliteMigrations.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("TEXT");
@@ -1646,9 +1646,9 @@ namespace Bit.SqliteMigrations.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)");
});
});
@@ -3028,7 +3028,7 @@ namespace Bit.SqliteMigrations.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()