mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-02 14:04:50 +00:00
feat(storage): add archive storage support for assets
This commit is contained in:
@@ -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;
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user