Skip to content

Commit 414903d

Browse files
committed
Check for requirements on agent behaviour
1 parent aeaf70c commit 414903d

13 files changed

Lines changed: 4626 additions & 3 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
CREATE TABLE IF NOT EXISTS "ticket_requirements" (
2+
"ticket_id" uuid NOT NULL,
3+
"required_ticket_id" uuid NOT NULL,
4+
"requirement_type" text NOT NULL,
5+
"description" text,
6+
"created_at" timestamp (6) DEFAULT now() NOT NULL,
7+
"updated_at" timestamp (6),
8+
"deleted_at" timestamp (6)
9+
);
10+
--> statement-breakpoint
11+
DO $$ BEGIN
12+
ALTER TABLE "ticket_requirements" ADD CONSTRAINT "ticket_requirements_ticket_id_tickets_id_fk" FOREIGN KEY ("ticket_id") REFERENCES "public"."tickets"("id") ON DELETE no action ON UPDATE no action;
13+
EXCEPTION
14+
WHEN duplicate_object THEN null;
15+
END $$;
16+
--> statement-breakpoint
17+
DO $$ BEGIN
18+
ALTER TABLE "ticket_requirements" ADD CONSTRAINT "ticket_requirements_required_ticket_id_tickets_id_fk" FOREIGN KEY ("required_ticket_id") REFERENCES "public"."tickets"("id") ON DELETE no action ON UPDATE no action;
19+
EXCEPTION
20+
WHEN duplicate_object THEN null;
21+
END $$;
22+
--> statement-breakpoint
23+
CREATE UNIQUE INDEX IF NOT EXISTS "unique_ticket_requirement" ON "ticket_requirements" USING btree ("ticket_id","required_ticket_id");

0 commit comments

Comments
 (0)