OpenStack DNS As A Service (Designate)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

backend-pdns4-mysql-db.sql 2.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. CREATE TABLE domains (
  2. id INT AUTO_INCREMENT,
  3. name VARCHAR(255) NOT NULL,
  4. master VARCHAR(128) DEFAULT NULL,
  5. last_check INT DEFAULT NULL,
  6. type VARCHAR(6) NOT NULL,
  7. notified_serial INT DEFAULT NULL,
  8. account VARCHAR(40) DEFAULT NULL,
  9. PRIMARY KEY (id)
  10. ) Engine=InnoDB;
  11. CREATE UNIQUE INDEX name_index ON domains(name);
  12. CREATE TABLE records (
  13. id INT AUTO_INCREMENT,
  14. domain_id INT DEFAULT NULL,
  15. name VARCHAR(255) DEFAULT NULL,
  16. type VARCHAR(10) DEFAULT NULL,
  17. -- Changed to "TEXT", as VARCHAR(65000) is too big for most MySQL installs
  18. content TEXT DEFAULT NULL,
  19. ttl INT DEFAULT NULL,
  20. prio INT DEFAULT NULL,
  21. change_date INT DEFAULT NULL,
  22. disabled TINYINT(1) DEFAULT 0,
  23. ordername VARCHAR(255) BINARY DEFAULT NULL,
  24. auth TINYINT(1) DEFAULT 1,
  25. PRIMARY KEY (id)
  26. ) Engine=InnoDB;
  27. CREATE INDEX nametype_index ON records(name,type);
  28. CREATE INDEX domain_id ON records(domain_id);
  29. CREATE INDEX recordorder ON records (domain_id, ordername);
  30. CREATE TABLE supermasters (
  31. ip VARCHAR(64) NOT NULL,
  32. nameserver VARCHAR(255) NOT NULL,
  33. account VARCHAR(40) NOT NULL,
  34. PRIMARY KEY (ip, nameserver)
  35. ) Engine=InnoDB;
  36. CREATE TABLE comments (
  37. id INT AUTO_INCREMENT,
  38. domain_id INT NOT NULL,
  39. name VARCHAR(255) NOT NULL,
  40. type VARCHAR(10) NOT NULL,
  41. modified_at INT NOT NULL,
  42. account VARCHAR(40) NOT NULL,
  43. -- Changed to "TEXT", as VARCHAR(65000) is too big for most MySQL installs
  44. comment TEXT NOT NULL,
  45. PRIMARY KEY (id)
  46. ) Engine=InnoDB;
  47. CREATE INDEX comments_domain_id_idx ON comments (domain_id);
  48. CREATE INDEX comments_name_type_idx ON comments (name, type);
  49. CREATE INDEX comments_order_idx ON comments (domain_id, modified_at);
  50. CREATE TABLE domainmetadata (
  51. id INT AUTO_INCREMENT,
  52. domain_id INT NOT NULL,
  53. kind VARCHAR(32),
  54. content TEXT,
  55. PRIMARY KEY (id)
  56. ) Engine=InnoDB;
  57. CREATE INDEX domainmetadata_idx ON domainmetadata (domain_id, kind);
  58. CREATE TABLE cryptokeys (
  59. id INT AUTO_INCREMENT,
  60. domain_id INT NOT NULL,
  61. flags INT NOT NULL,
  62. active BOOL,
  63. content TEXT,
  64. PRIMARY KEY(id)
  65. ) Engine=InnoDB;
  66. CREATE INDEX domainidindex ON cryptokeys(domain_id);
  67. CREATE TABLE tsigkeys (
  68. id INT AUTO_INCREMENT,
  69. name VARCHAR(255),
  70. algorithm VARCHAR(50),
  71. secret VARCHAR(255),
  72. PRIMARY KEY (id)
  73. ) Engine=InnoDB;
  74. CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm);