aboutsummaryrefslogtreecommitdiff
path: root/apps/web/db/prepare.sql
diff options
context:
space:
mode:
authoryxshv <[email protected]>2024-04-14 14:32:12 +0530
committeryxshv <[email protected]>2024-04-14 14:32:12 +0530
commitac41d347711b7f056a2cf8564d25dc425eb3aa8d (patch)
tree4b921f0868d3b3d64ffcccebf2e353c4fc969bd7 /apps/web/db/prepare.sql
parentnew modals (diff)
parent6144 char limit (diff)
downloadsupermemory-ac41d347711b7f056a2cf8564d25dc425eb3aa8d.tar.xz
supermemory-ac41d347711b7f056a2cf8564d25dc425eb3aa8d.zip
merge
Diffstat (limited to 'apps/web/db/prepare.sql')
-rw-r--r--apps/web/db/prepare.sql12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/web/db/prepare.sql b/apps/web/db/prepare.sql
index dcba4d40..4c8c2af6 100644
--- a/apps/web/db/prepare.sql
+++ b/apps/web/db/prepare.sql
@@ -13,15 +13,15 @@ CREATE TABLE `account` (
`session_state` text(255),
`oauth_token_secret` text,
`oauth_token` text,
- FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action
+ FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `contentToSpace` (
`contentId` integer NOT NULL,
`spaceId` integer NOT NULL,
PRIMARY KEY(`contentId`, `spaceId`),
- FOREIGN KEY (`contentId`) REFERENCES `storedContent`(`id`) ON UPDATE no action ON DELETE no action,
- FOREIGN KEY (`spaceId`) REFERENCES `space`(`id`) ON UPDATE no action ON DELETE no action
+ FOREIGN KEY (`contentId`) REFERENCES `storedContent`(`id`) ON UPDATE no action ON DELETE cascade,
+ FOREIGN KEY (`spaceId`) REFERENCES `space`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `session` (
@@ -29,14 +29,14 @@ CREATE TABLE `session` (
`sessionToken` text(255) NOT NULL,
`userId` text(255) NOT NULL,
`expires` integer NOT NULL,
- FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action
+ FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `space` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`name` text DEFAULT 'none' NOT NULL,
`user` text(255),
- FOREIGN KEY (`user`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action
+ FOREIGN KEY (`user`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `storedContent` (
@@ -50,7 +50,7 @@ CREATE TABLE `storedContent` (
`type` text DEFAULT 'page',
`image` text(255),
`user` text(255),
- FOREIGN KEY (`user`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action
+ FOREIGN KEY (`user`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `user` (