Difference between revisions of "PowerDNS OpenDBX Backend/Migration"
From Linuxnetworks
(migration) |
|||
| Line 1: | Line 1: | ||
| + | == From gMySQL == | ||
| + | |||
To convert an existing gMySQL Database to an OpenDBX MySQL database, an additional status column is required since patch 2.9.20-3: | To convert an existing gMySQL Database to an OpenDBX MySQL database, an additional status column is required since patch 2.9.20-3: | ||
| − | ALTER TABLE domains ADD | + | SET SESSION sql_mode='ANSI'; |
| + | ALTER TABLE "domains" ADD "status" CHARACTER(1) NOT NULL DEFAULT 'A'; | ||
Adding a foreign key constraint from records.domain_id to domains.id is a good idea too: | Adding a foreign key constraint from records.domain_id to domains.id is a good idea too: | ||
| − | ALTER TABLE records ADD CONSTRAINT | + | ALTER TABLE "records" ADD CONSTRAINT "pdns_fk_records_domainid" |
| − | FOREIGN KEY (domain_id) REFERENCES domains (id) | + | FOREIGN KEY ("domain_id") REFERENCES "domains" ("id") |
ON UPDATE CASCADE ON DELETE CASCADE | ON UPDATE CASCADE ON DELETE CASCADE | ||
You should also recreate your indices for optimal performance. Please have a look in the appropriate file listed in the section above. | You should also recreate your indices for optimal performance. Please have a look in the appropriate file listed in the section above. | ||
| + | |||
| + | == Add auto_serial == | ||
| + | |||
| + | The latest version supports automatic generation of serials for SOA records but requires an additional column "auto_serial" in the "domains" table: | ||
| + | |||
| + | ALTER TABLE "domains" ADD "auto_serial" INTEGER DEFAULT 0; | ||
---- | ---- | ||
Back to [[PowerDNS_OpenDBX_Backend|Overview]] | Back to [[PowerDNS_OpenDBX_Backend|Overview]] | ||
Revision as of 20:06, 8 March 2008
From gMySQL
To convert an existing gMySQL Database to an OpenDBX MySQL database, an additional status column is required since patch 2.9.20-3:
SET SESSION sql_mode='ANSI'; ALTER TABLE "domains" ADD "status" CHARACTER(1) NOT NULL DEFAULT 'A';
Adding a foreign key constraint from records.domain_id to domains.id is a good idea too:
ALTER TABLE "records" ADD CONSTRAINT "pdns_fk_records_domainid"
FOREIGN KEY ("domain_id") REFERENCES "domains" ("id")
ON UPDATE CASCADE ON DELETE CASCADE
You should also recreate your indices for optimal performance. Please have a look in the appropriate file listed in the section above.
Add auto_serial
The latest version supports automatic generation of serials for SOA records but requires an additional column "auto_serial" in the "domains" table:
ALTER TABLE "domains" ADD "auto_serial" INTEGER DEFAULT 0;
Back to Overview