1
0
mirror of https://github.com/bitwarden/server synced 2025-12-14 15:23:42 +00:00

Create PlayData table and services

Shift from seeded data tracking that is all server-side to play ids and x-play-id headers that are appended from the clients to track entities added by tests.
This commit is contained in:
Matt Gibson
2025-11-04 16:26:06 -08:00
parent 3f22adcbf2
commit e96e70cc22
31 changed files with 11448 additions and 9 deletions

View File

@@ -623,8 +623,8 @@ namespace Bit.PostgresMigrations.Migrations
b.Property<byte>("Type")
.HasColumnType("smallint");
b.Property<int>("WaitTimeDays")
.HasColumnType("integer");
b.Property<short>("WaitTimeDays")
.HasColumnType("smallint");
b.HasKey("Id");
@@ -1590,6 +1590,64 @@ namespace Bit.PostgresMigrations.Migrations
b.ToTable("OrganizationUser", (string)null);
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.PlayData", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("OrganizationId")
.HasColumnType("uuid");
b.Property<string>("PlayId")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<Guid?>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("OrganizationId")
.HasAnnotation("SqlServer:Clustered", false);
b.HasIndex("PlayId")
.HasAnnotation("SqlServer:Clustered", false);
b.HasIndex("UserId")
.HasAnnotation("SqlServer:Clustered", false);
b.ToTable("PlayData", null, t =>
{
t.HasCheckConstraint("CK_PlayData_UserOrOrganization", "([UserId] IS NOT NULL AND [OrganizationId] IS NULL) OR ([UserId] IS NULL AND [OrganizationId] IS NOT NULL)");
});
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.SeededData", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Data")
.IsRequired()
.HasColumnType("text");
b.Property<string>("RecipeName")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("SeededData");
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Send", b =>
{
b.Property<Guid>("Id")
@@ -2964,6 +3022,23 @@ namespace Bit.PostgresMigrations.Migrations
b.Navigation("User");
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.PlayData", b =>
{
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", "Organization")
.WithMany()
.HasForeignKey("OrganizationId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("Organization");
b.Navigation("User");
});
modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Send", b =>
{
b.HasOne("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", "Organization")