feat: add content platform operations persistence

This commit is contained in:
xiong
2026-07-26 05:58:38 +08:00
parent 3eb9f111ed
commit 9fd8708fa5
9 changed files with 15299 additions and 1 deletions

View File

@@ -35,6 +35,11 @@ internal sealed class ContentAssetConfiguration : IEntityTypeConfiguration<Conte
builder.Property(entity => entity.VerificationDetails).IsJson("{}");
builder.Property(entity => entity.PreviewObjectKey).HasMaxLength(1000);
builder.Property(entity => entity.PreviewStatus).HasSnakeCaseEnum();
builder.Property(entity => entity.SecurityScanStatus)
.HasSnakeCaseEnum()
.HasDefaultValue(AssetSecurityScanStatus.NotRequired);
builder.Property(entity => entity.SecurityScanProvider).HasMaxLength(100);
builder.Property(entity => entity.SecurityScanSummary).IsJson("{}");
builder.Property(entity => entity.SecurityFlags).IsJson("{}");
builder.Property(entity => entity.Metadata).IsJson("{}");
builder.HasIndex(entity => new { entity.TenantId, entity.LegacyId }).IsUnique();
@@ -67,6 +72,14 @@ internal sealed class ContentAssetConfiguration : IEntityTypeConfiguration<Conte
});
builder.HasIndex(entity => new { entity.TenantId, entity.PreviewStatus })
.HasFilter("preview_status <> 'none'");
builder.HasIndex(entity => new
{
entity.TenantId,
entity.SecurityScanStatus,
entity.UploadStatus,
entity.Status,
entity.UpdatedAt
});
builder.ToTable(table =>
{
table.HasCheckConstraint("ck_content_assets_file_size", "file_size_bytes is null or file_size_bytes >= 0");