CREATE TABLE "router_v1.7"."lots" (
	"chain_id" bigint NOT NULL,
	"user" varchar(42) NOT NULL,
	"contract" varchar(42) NOT NULL,
	"group" varchar(66) NOT NULL,
	"lower" numeric(78, 0) NOT NULL,
	"upper" numeric(78, 0) NOT NULL,
	CONSTRAINT "lots_pk" PRIMARY KEY("chain_id","user","contract","group")
);
--> statement-breakpoint
ALTER TABLE "router_v1.7"."lots" ADD CONSTRAINT "lots_positions_fk" FOREIGN KEY ("chain_id","contract","user") REFERENCES "router_v1.7"."positions"("chain_id","contract","user") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "router_v1.7"."lots" ADD CONSTRAINT "lots_groups_fk" FOREIGN KEY ("chain_id","user","group") REFERENCES "router_v1.7"."groups"("chain_id","maker","group") ON DELETE cascade ON UPDATE no action;