From 95a92bbc4cf9fcd2347afbf9b50981d44c597791 Mon Sep 17 00:00:00 2001 From: Akhilesh Rangani Date: Sun, 16 Jun 2024 19:05:24 -0400 Subject: [PATCH] fix: sandboxes linked with users --- backend/database/src/schema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/database/src/schema.ts b/backend/database/src/schema.ts index 4403b96..e350d79 100644 --- a/backend/database/src/schema.ts +++ b/backend/database/src/schema.ts @@ -31,7 +31,7 @@ export const sandbox = sqliteTable("sandbox", { createdAt: integer("createdAt", { mode: "timestamp_ms" }), userId: text("user_id") .notNull() - .references(() => user.id), + .references(() => user.id, { onDelete: "cascade" }), }); export type Sandbox = typeof sandbox.$inferSelect;