a
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
-- Re-add NS record support and extend record types
|
||||
ALTER TABLE dns_records DROP CONSTRAINT dns_records_record_type_check;
|
||||
ALTER TABLE dns_records ADD CONSTRAINT dns_records_record_type_check
|
||||
CHECK (record_type IN ('A', 'AAAA', 'CNAME', 'TXT', 'NS', 'MX'));
|
||||
-- MySQL doesn't support direct DROP CONSTRAINT syntax
|
||||
-- MySQL 8.0+ supports CHECK constraints, but we'll skip adding for compatibility
|
||||
|
||||
-- Add index for efficient NS record lookups during delegation
|
||||
CREATE INDEX idx_dns_records_ns_lookup ON dns_records(record_type, name) WHERE record_type = 'NS';
|
||||
-- MySQL doesn't support WHERE clause in CREATE INDEX
|
||||
CREATE INDEX idx_dns_records_ns_lookup ON dns_records(record_type, name);
|
||||
|
||||
-- Add index for subdomain resolution optimization
|
||||
CREATE INDEX idx_dns_records_subdomain_lookup ON dns_records(domain_id, name, record_type);
|
||||
Reference in New Issue
Block a user