feat(trash): implement two-stage trashcan and project cleanup

This commit is contained in:
yiling
2026-05-23 23:26:43 +08:00
parent f05247f372
commit effec44870
15 changed files with 272 additions and 171 deletions
@@ -0,0 +1,25 @@
/*
Warnings:
- The values [removed] on the enum `AssetStatus` will be removed. If these variants are still used in the database, this will fail.
- You are about to drop the column `removed` on the `assets` table. All the data in the column will be lost.
*/
-- AlterEnum
BEGIN;
CREATE TYPE "AssetStatus_new" AS ENUM ('uploading', 'uploaded', 'processing', 'processed', 'trashed', 'pending_purge', 'purging');
ALTER TABLE "assets" ALTER COLUMN "status" TYPE "AssetStatus_new" USING ("status"::text::"AssetStatus_new");
ALTER TYPE "AssetStatus" RENAME TO "AssetStatus_old";
ALTER TYPE "AssetStatus_new" RENAME TO "AssetStatus";
DROP TYPE "public"."AssetStatus_old";
COMMIT;
-- DropIndex
DROP INDEX "assets_removed_idx";
-- AlterTable
ALTER TABLE "assets" DROP COLUMN "removed",
ADD COLUMN "is_deleted" BOOLEAN NOT NULL DEFAULT false;
-- CreateIndex
CREATE INDEX "assets_is_deleted_idx" ON "assets"("is_deleted");