[Pdns-users] Removing zones from the (g)MySQL backend...

Mark Watts m.watts at eris.qinetiq.com
Mon Nov 15 10:23:48 UTC 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> On Fri, 12 Nov 2004 14:36:41 +0000, Mark Watts <m.watts at eris.qinetiq.com> 
wrote:
> >I've got a pdns server running nicely with MySQL as its backend (using the
> >generic sql backend).
> >
> >I've added a zone for pdns to be a slave for and that worked just fine...
> >
> >How do I remove that zone and stop pdn from being a slave (for that zone)
>
> hi
> actually you simply remove the domain from the domains-table and o'coz the
> records regarding the very same domain_id from the records table - I
> suggest to either set a referential integrity here so you can easily
> cascade a delete for the domain to the records or vice-versa restrict a
> domain-delete as long as there are records associated to this domain.
>
> hth
> hk
> _______________________________________________
> Pdns-users mailing list
> Pdns-users at mailman.powerdns.com
> http://mailman.powerdns.com/mailman/listinfo/pdns-users

ALTER TABLE records ADD FOREIGN KEY (domain_id) REFERENCES domains(id) ON 
DELETE CASCADE;

Works nicely :)

Mark.

- -- 
Mark Watts
Senior Systems Engineer
QinetiQ Trusted Information Management
Trusted Solutions and Services group
GPG Public Key ID: 455420ED

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBmIO0Bn4EFUVUIO0RAuPkAJ0W2sZzgRhbxV6a1F181+zSbclphQCfQkVA
/Aw4rrCVxZnz01N98AWjNSo=
=+rYc
-----END PGP SIGNATURE-----


More information about the Pdns-users mailing list