From f77a41a75237b8c816e0c9ca7217dfacc32cc7d0 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Sun, 14 Jul 2024 20:42:06 +0000
Subject: chore: Add a new sqlite based queue package

---
 packages/queue/drizzle/0000_wonderful_talisman.sql | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 packages/queue/drizzle/0000_wonderful_talisman.sql

(limited to 'packages/queue/drizzle/0000_wonderful_talisman.sql')

diff --git a/packages/queue/drizzle/0000_wonderful_talisman.sql b/packages/queue/drizzle/0000_wonderful_talisman.sql
new file mode 100644
index 00000000..e042ab92
--- /dev/null
+++ b/packages/queue/drizzle/0000_wonderful_talisman.sql
@@ -0,0 +1,18 @@
+CREATE TABLE `tasks` (
+	`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
+	`queue` text NOT NULL,
+	`payload` text NOT NULL,
+	`createdAt` integer NOT NULL,
+	`status` text DEFAULT 'pending' NOT NULL,
+	`expireAt` integer,
+	`allocationId` text NOT NULL,
+	`numRunsLeft` integer NOT NULL,
+	`maxNumRuns` integer NOT NULL
+);
+--> statement-breakpoint
+CREATE INDEX `tasks_queue_idx` ON `tasks` (`queue`);--> statement-breakpoint
+CREATE INDEX `tasks_status_idx` ON `tasks` (`status`);--> statement-breakpoint
+CREATE INDEX `tasks_expire_at_idx` ON `tasks` (`expireAt`);--> statement-breakpoint
+CREATE INDEX `tasks_num_runs_left_idx` ON `tasks` (`numRunsLeft`);--> statement-breakpoint
+CREATE INDEX `tasks_max_num_runs_idx` ON `tasks` (`maxNumRuns`);--> statement-breakpoint
+CREATE INDEX `tasks_allocation_id_idx` ON `tasks` (`allocationId`);
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2

