Skip to content

Commit 37f1276

Browse files
committed
added migration
1 parent 1b3387e commit 37f1276

File tree

3 files changed

+10526
-0
lines changed

3 files changed

+10526
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
CREATE TABLE "async_jobs" (
2+
"id" text PRIMARY KEY NOT NULL,
3+
"type" text NOT NULL,
4+
"payload" jsonb NOT NULL,
5+
"status" text DEFAULT 'pending' NOT NULL,
6+
"created_at" timestamp DEFAULT now() NOT NULL,
7+
"started_at" timestamp,
8+
"completed_at" timestamp,
9+
"run_at" timestamp,
10+
"attempts" integer DEFAULT 0 NOT NULL,
11+
"max_attempts" integer DEFAULT 3 NOT NULL,
12+
"error" text,
13+
"output" jsonb,
14+
"metadata" jsonb DEFAULT '{}' NOT NULL,
15+
"updated_at" timestamp DEFAULT now() NOT NULL
16+
);
17+
--> statement-breakpoint
18+
CREATE INDEX "async_jobs_status_started_at_idx" ON "async_jobs" USING btree ("status","started_at");--> statement-breakpoint
19+
CREATE INDEX "async_jobs_status_completed_at_idx" ON "async_jobs" USING btree ("status","completed_at");

0 commit comments

Comments
 (0)