feat(storage): add archive storage support for assets

This commit is contained in:
yiling
2026-11-02 13:19:10 +08:00
parent 49a2d7c380
commit 9097ec12bb
100 changed files with 6180 additions and 170 deletions
@@ -0,0 +1,25 @@
-- AlterEnum
-- This migration adds more than one value to an enum.
-- With PostgreSQL versions 11 and earlier, this is not possible
-- in a single migration. This can be worked around by creating
-- multiple migrations, each migration adding only one value to
-- the enum.
ALTER TYPE "AssetStatus" ADD VALUE 'archiving';
ALTER TYPE "AssetStatus" ADD VALUE 'archived';
ALTER TYPE "AssetStatus" ADD VALUE 'restoring';
-- AlterEnum
-- This migration adds more than one value to an enum.
-- With PostgreSQL versions 11 and earlier, this is not possible
-- in a single migration. This can be worked around by creating
-- multiple migrations, each migration adding only one value to
-- the enum.
ALTER TYPE "WorkflowTaskType" ADD VALUE 'archive_asset';
ALTER TYPE "WorkflowTaskType" ADD VALUE 'restore_asset';
-- AlterTable
ALTER TABLE "storage_keys" ADD COLUMN "is_archived" BOOLEAN NOT NULL DEFAULT false;
+12 -6
View File
@@ -40,6 +40,9 @@ enum AssetStatus {
uploaded
processing
processed
archiving
archived
restoring
failed
trashed
pending_purge
@@ -128,6 +131,8 @@ enum WorkflowTaskType {
query_embedding_for_search
agent_tool_call // @deprecated: Agent tools now execute directly in-process via Core services
kanban_agent_run
archive_asset
restore_asset
}
enum WorkflowTaskStatus {
@@ -606,12 +611,13 @@ model Asset {
}
model StorageKey {
id String @id @default(ulid())
key String @unique
status StorageKeyStatus @default(active)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
assets Asset[]
id String @id @default(ulid())
key String @unique
status StorageKeyStatus @default(active)
isArchived Boolean @default(false) @map("is_archived")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
assets Asset[]
@@map("storage_keys")
}