16 lines
626 B
SQL
16 lines
626 B
SQL
CREATE TABLE IF NOT EXISTS "CanvasFeedback" (
|
|
"id" uuid PRIMARY KEY NOT NULL,
|
|
"userId" uuid NOT NULL REFERENCES "User"("id") ON DELETE CASCADE,
|
|
"projectId" uuid NOT NULL,
|
|
"description" text NOT NULL,
|
|
"snapshot" jsonb NOT NULL,
|
|
"notification" jsonb NOT NULL,
|
|
"deliveryId" varchar(128),
|
|
"status" varchar(24) NOT NULL DEFAULT 'pending',
|
|
"attempts" integer NOT NULL DEFAULT 0,
|
|
"nextAttemptAt" timestamp NOT NULL DEFAULT now(),
|
|
"lastErrorCode" varchar(128),
|
|
"createdAt" timestamp NOT NULL DEFAULT now()
|
|
);
|
|
CREATE INDEX IF NOT EXISTS "CanvasFeedback_due_idx" ON "CanvasFeedback" ("status", "nextAttemptAt");
|