選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

poweradmin-mysql-db-structure.sql 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. -- PowerAdmin
  2. -- MySQL Database Structure
  3. --
  4. CREATE TABLE users (
  5. id INTEGER NOT NULL AUTO_INCREMENT,
  6. username VARCHAR(64) NOT NULL,
  7. `password` VARCHAR(128) NOT NULL,
  8. fullname VARCHAR(255) NOT NULL,
  9. email VARCHAR(255) NOT NULL,
  10. description TEXT NOT NULL,
  11. perm_templ TINYINT NOT NULL,
  12. active TINYINT NOT NULL,
  13. use_ldap TINYINT NOT NULL,
  14. PRIMARY KEY (id)
  15. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  16. START TRANSACTION;
  17. INSERT INTO users ( id, username, `password`, fullname, email
  18. , description, perm_templ, active, use_ldap )
  19. VALUES ( 1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'Administrator'
  20. , 'admin@example.net', 'Administrator with full rights.', 1, 1, 0 );
  21. COMMIT;
  22. CREATE TABLE perm_items (
  23. id INTEGER NOT NULL AUTO_INCREMENT,
  24. name VARCHAR(64) NOT NULL,
  25. descr TEXT NOT NULL,
  26. PRIMARY KEY (id)
  27. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  28. START TRANSACTION;
  29. INSERT INTO perm_items ( id, name, descr ) VALUES ( 41, 'zone_master_add', 'User is allowed to add new master zones.' );
  30. INSERT INTO perm_items ( id, name, descr ) VALUES ( 42, 'zone_slave_add', 'User is allowed to add new slave zones.' );
  31. INSERT INTO perm_items ( id, name, descr ) VALUES ( 43, 'zone_content_view_own', 'User is allowed to see the content and meta data of zones he owns.' );
  32. INSERT INTO perm_items ( id, name, descr ) VALUES ( 44, 'zone_content_edit_own', 'User is allowed to edit the content of zones he owns.' );
  33. INSERT INTO perm_items ( id, name, descr ) VALUES ( 45, 'zone_meta_edit_own', 'User is allowed to edit the meta data of zones he owns.' );
  34. INSERT INTO perm_items ( id, name, descr ) VALUES ( 46, 'zone_content_view_others', 'User is allowed to see the content and meta data of zones he does not own.' );
  35. INSERT INTO perm_items ( id, name, descr ) VALUES ( 47, 'zone_content_edit_others', 'User is allowed to edit the content of zones he does not own.' );
  36. INSERT INTO perm_items ( id, name, descr ) VALUES ( 48, 'zone_meta_edit_others', 'User is allowed to edit the meta data of zones he does not own.' );
  37. INSERT INTO perm_items ( id, name, descr ) VALUES ( 49, 'search', 'User is allowed to perform searches.' );
  38. INSERT INTO perm_items ( id, name, descr ) VALUES ( 50, 'supermaster_view', 'User is allowed to view supermasters.' );
  39. INSERT INTO perm_items ( id, name, descr ) VALUES ( 51, 'supermaster_add', 'User is allowed to add new supermasters.' );
  40. INSERT INTO perm_items ( id, name, descr ) VALUES ( 52, 'supermaster_edit', 'User is allowed to edit supermasters.' );
  41. INSERT INTO perm_items ( id, name, descr ) VALUES ( 53, 'user_is_ueberuser', 'User has full access. God-like. Redeemer.' );
  42. INSERT INTO perm_items ( id, name, descr ) VALUES ( 54, 'user_view_others', 'User is allowed to see other users and their details.' );
  43. INSERT INTO perm_items ( id, name, descr ) VALUES ( 55, 'user_add_new', 'User is allowed to add new users.' );
  44. INSERT INTO perm_items ( id, name, descr ) VALUES ( 56, 'user_edit_own', 'User is allowed to edit their own details.' );
  45. INSERT INTO perm_items ( id, name, descr ) VALUES ( 57, 'user_edit_others', 'User is allowed to edit other users.' );
  46. INSERT INTO perm_items ( id, name, descr ) VALUES ( 58, 'user_passwd_edit_others', 'User is allowed to edit the password of other users.' );
  47. INSERT INTO perm_items ( id, name, descr ) VALUES ( 59, 'user_edit_templ_perm', 'User is allowed to change the permission template that is assigned to a user.' );
  48. INSERT INTO perm_items ( id, name, descr ) VALUES ( 60, 'templ_perm_add', 'User is allowed to add new permission templates.' );
  49. INSERT INTO perm_items ( id, name, descr ) VALUES ( 61, 'templ_perm_edit', 'User is allowed to edit existing permission templates.' );
  50. COMMIT;
  51. CREATE TABLE perm_templ (
  52. id INTEGER NOT NULL AUTO_INCREMENT,
  53. name VARCHAR(128) NOT NULL,
  54. descr TEXT NOT NULL,
  55. PRIMARY KEY (id)
  56. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  57. START TRANSACTION;
  58. INSERT INTO perm_templ ( id, name, descr )
  59. VALUES ( 1, 'Administrator'
  60. , 'Administrator template with full rights.' );
  61. COMMIT;
  62. CREATE TABLE perm_templ_items (
  63. id INTEGER NOT NULL AUTO_INCREMENT,
  64. templ_id INTEGER NOT NULL,
  65. perm_id INTEGER NOT NULL,
  66. PRIMARY KEY (id)
  67. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  68. START TRANSACTION;
  69. INSERT INTO perm_templ_items ( id, templ_id, perm_id )
  70. VALUES ( 1, 1, 53 );
  71. COMMIT;
  72. CREATE TABLE zones (
  73. id INTEGER NOT NULL AUTO_INCREMENT,
  74. domain_id INTEGER NOT NULL,
  75. owner INTEGER NOT NULL,
  76. `comment` TEXT,
  77. zone_templ_id INTEGER NOT NULL,
  78. PRIMARY KEY (id),
  79. KEY owner (owner)
  80. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  81. CREATE TABLE zone_templ (
  82. id INTEGER NOT NULL AUTO_INCREMENT,
  83. name VARCHAR(128) NOT NULL,
  84. descr TEXT NOT NULL,
  85. owner INTEGER NOT NULL,
  86. PRIMARY KEY (id)
  87. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  88. CREATE TABLE zone_templ_records (
  89. id INTEGER NOT NULL AUTO_INCREMENT,
  90. zone_templ_id INTEGER NOT NULL,
  91. name VARCHAR(255) NOT NULL,
  92. `type` VARCHAR(6) NOT NULL,
  93. content VARCHAR(255) NOT NULL,
  94. ttl INTEGER NOT NULL,
  95. prio INTEGER NOT NULL,
  96. PRIMARY KEY (id)
  97. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  98. CREATE TABLE records_zone_templ (
  99. domain_id INTEGER NOT NULL,
  100. record_id INTEGER NOT NULL,
  101. zone_templ_id INTEGER NOT NULL
  102. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  103. CREATE TABLE migrations (
  104. version VARCHAR(255) NOT NULL,
  105. apply_time INTEGER NOT NULL
  106. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;