Files
sub2api/backend/migrations/048_add_error_passthrough_rules.sql
李建琦 6d655c9903
Release / update-version (push) Has been cancelled
Release / build-frontend (push) Has been cancelled
Release / release (push) Has been cancelled
Release / sync-version-file (push) Has been cancelled
CI / shell (push) Canceled after 0s
CI / test (push) Canceled after 0s
CI / frontend (push) Canceled after 0s
CI / golangci-lint (push) Canceled after 0s
Security Scan / backend-security (push) Canceled after 0s
Security Scan / frontend-security (push) Canceled after 0s
Sub2API v1.0 - AI API 网关(二开初始版本,基于上游 Wei-Shaw/sub2api)
2026-08-21 18:30:13 +08:00

25 lines
995 B
SQL

-- Error Passthrough Rules table
-- Allows administrators to configure how upstream errors are passed through to clients
CREATE TABLE IF NOT EXISTS error_passthrough_rules (
id BIGSERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
enabled BOOLEAN NOT NULL DEFAULT true,
priority INTEGER NOT NULL DEFAULT 0,
error_codes JSONB DEFAULT '[]',
keywords JSONB DEFAULT '[]',
match_mode VARCHAR(10) NOT NULL DEFAULT 'any',
platforms JSONB DEFAULT '[]',
passthrough_code BOOLEAN NOT NULL DEFAULT true,
response_code INTEGER,
passthrough_body BOOLEAN NOT NULL DEFAULT true,
custom_message TEXT,
description TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
-- Indexes for efficient queries
CREATE INDEX IF NOT EXISTS idx_error_passthrough_rules_enabled ON error_passthrough_rules (enabled);
CREATE INDEX IF NOT EXISTS idx_error_passthrough_rules_priority ON error_passthrough_rules (priority);