CI / changes (push) Successful in 6s
CI / openapi (push) Successful in 1m2s
CI / go (push) Successful in 27s
CI / docker-web (push) Successful in 1m27s
CI / docker-bird (push) Has been skipped
CI / bird2 (push) Successful in 16s
CI / docker-go (push) Successful in 8m5s
- Added `DohResolverPolicy` schema to OpenAPI documentation, defining policies for domain resolution. - Updated module handling to support multiple DoH profiles via `doh_profile_ids` and introduced `doh_resolver_policy` in the API. - Refactored related functions to accommodate the new DoH profile structure, ensuring backward compatibility with existing `doh_profile_id`. - Enhanced UI components to allow selection and management of DoH profiles and policies in the web interface. - Updated database interactions to handle new fields and ensure proper data normalization.
19 lines
706 B
SQL
19 lines
706 B
SQL
ALTER TABLE module
|
|
ADD COLUMN doh_resolver_policy TEXT NOT NULL DEFAULT 'primary_only'
|
|
CHECK (doh_resolver_policy IN ('primary_only', 'failover', 'union'));
|
|
|
|
CREATE TABLE module_doh_profile (
|
|
module_id TEXT NOT NULL REFERENCES module (id) ON DELETE CASCADE,
|
|
doh_profile_id TEXT NOT NULL REFERENCES doh_profile (id) ON DELETE CASCADE,
|
|
sort_order INTEGER NOT NULL DEFAULT 0,
|
|
PRIMARY KEY (module_id, doh_profile_id)
|
|
);
|
|
|
|
CREATE INDEX idx_module_doh_profile_doh ON module_doh_profile (doh_profile_id);
|
|
|
|
INSERT INTO module_doh_profile (module_id, doh_profile_id, sort_order)
|
|
SELECT id, doh_profile_id, 0
|
|
FROM module
|
|
WHERE doh_profile_id IS NOT NULL
|
|
AND deleted_at IS NULL;
|