0018_natural_sasquatch.sql 925 B

1234567891011121314151617
  1. CREATE TABLE IF NOT EXISTS "error_rules" (
  2. "id" serial PRIMARY KEY NOT NULL,
  3. "pattern" text NOT NULL,
  4. "match_type" varchar(20) DEFAULT 'regex' NOT NULL,
  5. "category" varchar(50) NOT NULL,
  6. "description" text,
  7. "is_enabled" boolean DEFAULT true NOT NULL,
  8. "is_default" boolean DEFAULT false NOT NULL,
  9. "priority" integer DEFAULT 0 NOT NULL,
  10. "created_at" timestamp with time zone DEFAULT now(),
  11. "updated_at" timestamp with time zone DEFAULT now()
  12. );
  13. --> statement-breakpoint
  14. CREATE INDEX IF NOT EXISTS "idx_error_rules_enabled" ON "error_rules" USING btree ("is_enabled","priority");--> statement-breakpoint
  15. CREATE UNIQUE INDEX IF NOT EXISTS "unique_pattern" ON "error_rules" USING btree ("pattern");--> statement-breakpoint
  16. CREATE INDEX IF NOT EXISTS "idx_category" ON "error_rules" USING btree ("category");--> statement-breakpoint
  17. CREATE INDEX IF NOT EXISTS "idx_match_type" ON "error_rules" USING btree ("match_type");