From: Mark Schouten Date: Tue, 9 Jun 2015 13:19:47 +0000 (+0200) Subject: Add a comment explaining the use and doubts about this patch X-Git-Tag: dnsdist-1.0.0-alpha1~59^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b4208199baae1d8f83e50f2d6b67c0d3344b759;p=thirdparty%2Fpdns.git Add a comment explaining the use and doubts about this patch --- diff --git a/modules/gmysqlbackend/enable-foreign-keys.mysql.sql b/modules/gmysqlbackend/enable-foreign-keys.mysql.sql index 9ecdeb9c68..391936c006 100644 --- a/modules/gmysqlbackend/enable-foreign-keys.mysql.sql +++ b/modules/gmysqlbackend/enable-foreign-keys.mysql.sql @@ -1,3 +1,13 @@ +/* +Using this SQL causes Mysql to create foreign keys on your database. This will +make sure that no records, comments or keys exists for domains that you already +removed. This is not enabled by default, because we're not sure what the +consequences are from a performance point of view. If you do have feedback, +please let us know how this effects your setup. + +Please note that it's not possible to apply this, before you cleaned up your +database, as the foreign keys do not exist. +*/ ALTER TABLE records ADD CONSTRAINT `records_domain_id_ibfk` FOREIGN KEY (`domain_id`) REFERENCES `domains` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE comments ADD CONSTRAINT `comments_domain_id_ibfk` FOREIGN KEY (`domain_id`) REFERENCES `domains` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE domainmetadata ADD CONSTRAINT `domainmetadata_domain_id_ibfk` FOREIGN KEY (`domain_id`) REFERENCES `domains` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;