Skip to content

Commit

Permalink
feat(server): add soft deleted flag to optimized blob table
Browse files Browse the repository at this point in the history
  • Loading branch information
forehalo committed Nov 24, 2023
1 parent cf65a5c commit 1f14e2c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "optimized_blobs" ADD COLUMN "deleted_at" TIMESTAMPTZ(6);
14 changes: 8 additions & 6 deletions packages/backend/server/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,15 @@ model Blob {
}

model OptimizedBlob {
id Int @id @default(autoincrement()) @db.Integer
hash String @db.VarChar
workspaceId String @map("workspace_id") @db.VarChar
params String @db.VarChar
blob Bytes @db.ByteA
id Int @id @default(autoincrement()) @db.Integer
hash String @db.VarChar
workspaceId String @map("workspace_id") @db.VarChar
params String @db.VarChar
blob Bytes @db.ByteA
length BigInt
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(6)
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(6)
// not for keeping, but for snapshot history
deletedAt DateTime? @map("deleted_at") @db.Timestamptz(6)
@@unique([workspaceId, hash, params])
@@map("optimized_blobs")
Expand Down

0 comments on commit 1f14e2c

Please sign in to comment.