diff options
| author | Dhravya Shah <[email protected]> | 2024-08-05 18:36:26 -0700 |
|---|---|---|
| committer | Dhravya Shah <[email protected]> | 2024-08-05 18:36:26 -0700 |
| commit | 4a9565f91d67cbc57be5bb4370c3e640daf643fb (patch) | |
| tree | 67c38bc9e55a75802207a350ba62d17e23e72437 /apps/web/migrations | |
| parent | Merge branch 'kush/be-queue' of https://github.com/Dhravya/supermemory into k... (diff) | |
| download | archived-supermemory-4a9565f91d67cbc57be5bb4370c3e640daf643fb.tar.xz archived-supermemory-4a9565f91d67cbc57be5bb4370c3e640daf643fb.zip | |
changes for staging
Diffstat (limited to 'apps/web/migrations')
| -rw-r--r-- | apps/web/migrations/0001_Adding_jobs_table.sql | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/web/migrations/0001_Adding_jobs_table.sql b/apps/web/migrations/0001_Adding_jobs_table.sql new file mode 100644 index 00000000..7a687f72 --- /dev/null +++ b/apps/web/migrations/0001_Adding_jobs_table.sql @@ -0,0 +1,19 @@ +-- Migration number: 0001 2024-08-05T18:05:16.793Z +CREATE TABLE `jobs` ( + `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, + `userId` text NOT NULL, + `url` text NOT NULL, + `status` text NOT NULL, + `attempts` integer DEFAULT 0 NOT NULL, + `lastAttemptAt` integer, + `error` blob, + `createdAt` integer NOT NULL, + `updatedAt` integer NOT NULL, + FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade +); + + +CREATE INDEX `jobs_userId_idx` ON `jobs` (`userId`);--> statement-breakpoint +CREATE INDEX `jobs_status_idx` ON `jobs` (`status`);--> statement-breakpoint +CREATE INDEX `jobs_createdAt_idx` ON `jobs` (`createdAt`);--> statement-breakpoint +CREATE INDEX `jobs_url_idx` ON `jobs` (`url`);--> statement-breakpoint
\ No newline at end of file |