0024_request-filters.sql 855 B

123456789101112131415161718
  1. CREATE TABLE IF NOT EXISTS "request_filters" (
  2. "id" serial PRIMARY KEY NOT NULL,
  3. "name" varchar(100) NOT NULL,
  4. "description" text,
  5. "scope" varchar(20) NOT NULL,
  6. "action" varchar(30) NOT NULL,
  7. "match_type" varchar(20),
  8. "target" text NOT NULL,
  9. "replacement" jsonb,
  10. "priority" integer DEFAULT 0 NOT NULL,
  11. "is_enabled" boolean DEFAULT true NOT NULL,
  12. "created_at" timestamp with time zone DEFAULT now(),
  13. "updated_at" timestamp with time zone DEFAULT now()
  14. );
  15. --> statement-breakpoint
  16. CREATE INDEX IF NOT EXISTS "idx_request_filters_enabled" ON "request_filters" USING btree ("is_enabled","priority");--> statement-breakpoint
  17. CREATE INDEX IF NOT EXISTS "idx_request_filters_scope" ON "request_filters" USING btree ("scope");--> statement-breakpoint
  18. CREATE INDEX IF NOT EXISTS "idx_request_filters_action" ON "request_filters" USING btree ("action");