048_add_error_passthrough_rules.sql 995 B

123456789101112131415161718192021222324
  1. -- Error Passthrough Rules table
  2. -- Allows administrators to configure how upstream errors are passed through to clients
  3. CREATE TABLE IF NOT EXISTS error_passthrough_rules (
  4. id BIGSERIAL PRIMARY KEY,
  5. name VARCHAR(100) NOT NULL,
  6. enabled BOOLEAN NOT NULL DEFAULT true,
  7. priority INTEGER NOT NULL DEFAULT 0,
  8. error_codes JSONB DEFAULT '[]',
  9. keywords JSONB DEFAULT '[]',
  10. match_mode VARCHAR(10) NOT NULL DEFAULT 'any',
  11. platforms JSONB DEFAULT '[]',
  12. passthrough_code BOOLEAN NOT NULL DEFAULT true,
  13. response_code INTEGER,
  14. passthrough_body BOOLEAN NOT NULL DEFAULT true,
  15. custom_message TEXT,
  16. description TEXT,
  17. created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
  18. updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
  19. );
  20. -- Indexes for efficient queries
  21. CREATE INDEX IF NOT EXISTS idx_error_passthrough_rules_enabled ON error_passthrough_rules (enabled);
  22. CREATE INDEX IF NOT EXISTS idx_error_passthrough_rules_priority ON error_passthrough_rules (priority);