CREATE TABLE "transaction_attachments" ( "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, "transaction_id" uuid NOT NULL, "filename" text NOT NULL, "mime_type" text DEFAULT 'application/octet-stream' NOT NULL, "size_bytes" integer DEFAULT 0 NOT NULL, "storage_path" text NOT NULL, "created_at" timestamp with time zone DEFAULT now() ); --> statement-breakpoint ALTER TABLE "transaction_attachments" ADD CONSTRAINT "transaction_attachments_transaction_id_transactions_id_fk" FOREIGN KEY ("transaction_id") REFERENCES "public"."transactions"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint CREATE INDEX "transaction_attachments_tx_id_idx" ON "transaction_attachments" USING btree ("transaction_id");