-- Re-add NS record support and extend record types
-- 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
-- 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);