aboutsummaryrefslogtreecommitdiff
path: root/apps/web/migrations/000_setup.sql
diff options
context:
space:
mode:
authorDhravya <[email protected]>2024-06-30 20:50:24 -0500
committerDhravya <[email protected]>2024-06-30 20:50:24 -0500
commitffd141ade4e6074ee486da7f74f31e3905807cb9 (patch)
tree505d73b0a7c04cdec93d7f5be88c635642716c15 /apps/web/migrations/000_setup.sql
parentshow updates in the extension (diff)
parentMerge pull request #93 from Dhravya/editor (diff)
downloadsupermemory-ffd141ade4e6074ee486da7f74f31e3905807cb9.tar.xz
supermemory-ffd141ade4e6074ee486da7f74f31e3905807cb9.zip
merge conflicts
Diffstat (limited to 'apps/web/migrations/000_setup.sql')
-rw-r--r--apps/web/migrations/000_setup.sql108
1 files changed, 0 insertions, 108 deletions
diff --git a/apps/web/migrations/000_setup.sql b/apps/web/migrations/000_setup.sql
deleted file mode 100644
index a4855ec9..00000000
--- a/apps/web/migrations/000_setup.sql
+++ /dev/null
@@ -1,108 +0,0 @@
-CREATE TABLE `account` (
- `userId` text NOT NULL,
- `type` text NOT NULL,
- `provider` text NOT NULL,
- `providerAccountId` text NOT NULL,
- `refresh_token` text,
- `access_token` text,
- `expires_at` integer,
- `token_type` text,
- `scope` text,
- `id_token` text,
- `session_state` text,
- PRIMARY KEY(`provider`, `providerAccountId`),
- FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-CREATE TABLE `authenticator` (
- `credentialID` text NOT NULL,
- `userId` text NOT NULL,
- `providerAccountId` text NOT NULL,
- `credentialPublicKey` text NOT NULL,
- `counter` integer NOT NULL,
- `credentialDeviceType` text NOT NULL,
- `credentialBackedUp` integer NOT NULL,
- `transports` text,
- PRIMARY KEY(`credentialID`, `userId`),
- FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-CREATE TABLE `chatHistory` (
- `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
- `threadId` text NOT NULL,
- `question` text NOT NULL,
- `answerParts` text,
- `answerSources` text,
- `answerJustification` text,
- FOREIGN KEY (`threadId`) REFERENCES `chatThread`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-CREATE TABLE `chatThread` (
- `id` text PRIMARY KEY NOT NULL,
- `firstMessage` text NOT NULL,
- `userId` text NOT NULL,
- 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 cascade,
- FOREIGN KEY (`spaceId`) REFERENCES `space`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-CREATE TABLE `session` (
- `sessionToken` text PRIMARY KEY NOT NULL,
- `userId` text NOT NULL,
- `expires` integer NOT NULL,
- 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 cascade
-);
---> statement-breakpoint
-CREATE TABLE `storedContent` (
- `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
- `content` text NOT NULL,
- `title` text(255),
- `description` text(255),
- `url` text NOT NULL,
- `savedAt` integer NOT NULL,
- `baseUrl` text(255),
- `ogImage` text(255),
- `type` text DEFAULT 'page',
- `image` text(255),
- `user` text,
- FOREIGN KEY (`user`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
-);
---> statement-breakpoint
-CREATE TABLE `user` (
- `id` text PRIMARY KEY NOT NULL,
- `name` text,
- `email` text NOT NULL,
- `emailVerified` integer,
- `image` text
-);
---> statement-breakpoint
-CREATE TABLE `verificationToken` (
- `identifier` text NOT NULL,
- `token` text NOT NULL,
- `expires` integer NOT NULL,
- PRIMARY KEY(`identifier`, `token`)
-);
---> statement-breakpoint
-CREATE UNIQUE INDEX `authenticator_credentialID_unique` ON `authenticator` (`credentialID`);--> statement-breakpoint
-CREATE INDEX `chatHistory_thread_idx` ON `chatHistory` (`threadId`);--> statement-breakpoint
-CREATE INDEX `chatThread_user_idx` ON `chatThread` (`userId`);--> statement-breakpoint
-CREATE UNIQUE INDEX `space_name_unique` ON `space` (`name`);--> statement-breakpoint
-CREATE INDEX `spaces_name_idx` ON `space` (`name`);--> statement-breakpoint
-CREATE INDEX `spaces_user_idx` ON `space` (`user`);--> statement-breakpoint
-CREATE INDEX `storedContent_url_idx` ON `storedContent` (`url`);--> statement-breakpoint
-CREATE INDEX `storedContent_savedAt_idx` ON `storedContent` (`savedAt`);--> statement-breakpoint
-CREATE INDEX `storedContent_title_idx` ON `storedContent` (`title`);--> statement-breakpoint
-CREATE INDEX `storedContent_user_idx` ON `storedContent` (`user`);