CDN flag change

This commit is contained in:
dingo
2026-03-03 17:05:27 -05:00
parent 551610a8ee
commit ba04911acc
8 changed files with 303 additions and 11 deletions
@@ -0,0 +1,60 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SOR.Database.Migrations.Catalog
{
/// <inheritdoc />
public partial class AddCdnUploadRecords : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "cdn_upload_records",
schema: "catalog",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
ObjectKey = table.Column<string>(type: "text", nullable: false),
Prefix = table.Column<string>(type: "text", nullable: false),
PublicUrl = table.Column<string>(type: "text", nullable: false),
ContentType = table.Column<string>(type: "text", nullable: true),
IsAiGenerated = table.Column<bool>(type: "boolean", nullable: false),
UploadedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_cdn_upload_records", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_cdn_upload_records_IsAiGenerated",
schema: "catalog",
table: "cdn_upload_records",
column: "IsAiGenerated");
migrationBuilder.CreateIndex(
name: "IX_cdn_upload_records_ObjectKey",
schema: "catalog",
table: "cdn_upload_records",
column: "ObjectKey",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_cdn_upload_records_Prefix",
schema: "catalog",
table: "cdn_upload_records",
column: "Prefix");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "cdn_upload_records",
schema: "catalog");
}
}
}
@@ -244,6 +244,45 @@ namespace SOR.Database.Migrations.Catalog
b.ToTable("card_definitions", "catalog");
});
modelBuilder.Entity("SOR.Database.Entities.Catalog.CdnUploadRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("ContentType")
.HasColumnType("text");
b.Property<bool>("IsAiGenerated")
.HasColumnType("boolean");
b.Property<string>("ObjectKey")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Prefix")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PublicUrl")
.IsRequired()
.HasColumnType("text");
b.Property<DateTimeOffset>("UploadedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("IsAiGenerated");
b.HasIndex("ObjectKey")
.IsUnique();
b.HasIndex("Prefix");
b.ToTable("cdn_upload_records", "catalog");
});
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardSet", b =>
{
b.Property<Guid>("Id")