Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1234567891011121314151617181920CREATE DOMAIN uuidv7 AS uuid CHECK (uuid_extract_version(VALUE) = 7);--> statement-breakpointCREATE TYPE "public"."raw_action" AS ENUM('create', 'update', 'delete');--> statement-breakpointCREATE TABLE "raw_records" ( "id" uuidv7 PRIMARY KEY NOT NULL, "tap_id" bigint NOT NULL, "received_at" timestamp with time zone DEFAULT now() NOT NULL, "did" text NOT NULL, "rev" text NOT NULL, "collection" text NOT NULL, "rkey" text NOT NULL, "action" "raw_action" NOT NULL, "cid" text, "record" jsonb, CONSTRAINT "raw_records_tap_id_unique" UNIQUE("tap_id"), CONSTRAINT "raw_records_not_null_unless_delete" CHECK (("raw_records"."action" = 'delete' or ("raw_records"."cid" is not null and "raw_records"."record" is not null))));--> statement-breakpointCREATE INDEX "raw_records_collection_index" ON "raw_records" USING btree ("collection");--> statement-breakpointCREATE INDEX "raw_records_did_collection_rkey_index" ON "raw_records" USING btree ("did","collection","rkey");