CREATE TABLE "router_v1.13"."pending_links" (
	"key" varchar(191) PRIMARY KEY NOT NULL,
	"type" text NOT NULL,
	"status" text NOT NULL,
	"chain_id" bigint NOT NULL,
	"event_id" varchar(128) NOT NULL,
	"obligation_id" varchar(42) NOT NULL,
	"collateral_index" integer NOT NULL,
	"user" varchar(42) NOT NULL,
	"amount" numeric(78, 0) NOT NULL,
	"block_number" bigint NOT NULL,
	"first_seen_block" bigint NOT NULL,
	"last_tried_block" bigint,
	"attempts" integer DEFAULT 0 NOT NULL,
	"ignored_reason" text,
	"resolved_at" timestamp,
	"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE INDEX "pending_links_chain_type_status_idx" ON "router_v1.13"."pending_links" USING btree ("chain_id","type","status");--> statement-breakpoint
CREATE INDEX "pending_links_pending_scan_idx" ON "router_v1.13"."pending_links" USING btree ("chain_id","type","status","first_seen_block");--> statement-breakpoint
CREATE INDEX "pending_links_event_id_idx" ON "router_v1.13"."pending_links" USING btree ("chain_id","event_id");
