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.

poweradmin-pgsql-db-structure.sql 4.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. CREATE TABLE users (
  2. id SERIAL PRIMARY KEY,
  3. username varchar(64) NOT NULL,
  4. password varchar(128) NOT NULL,
  5. fullname varchar(255) NOT NULL,
  6. email varchar(255) NOT NULL,
  7. description text NOT NULL,
  8. perm_templ integer default 0,
  9. active smallint default 0,
  10. use_ldap smallint default 0
  11. );
  12. INSERT INTO users (username, password, fullname, email, description, perm_templ, active, use_ldap) VALUES ('admin','21232f297a57a5a743894a0e4a801fc3','Administrator','admin@example.net','Administrator with full rights.',1,1,0);
  13. CREATE TABLE perm_items (
  14. id SERIAL PRIMARY KEY,
  15. name varchar(64) NOT NULL,
  16. descr text NOT NULL
  17. );
  18. INSERT INTO perm_items (name, descr) VALUES ('user_is_ueberuser','User has full access. God-like. Redeemer.');
  19. INSERT INTO perm_items (name, descr) VALUES ('zone_master_add','User is allowed to add new master zones.');
  20. INSERT INTO perm_items (name, descr) VALUES ('zone_slave_add','User is allowed to add new slave zones.');
  21. INSERT INTO perm_items (name, descr) VALUES ('zone_content_view_own','User is allowed to see the content and meta data of zones he owns.');
  22. INSERT INTO perm_items (name, descr) VALUES ('zone_content_edit_own','User is allowed to edit the content of zones he owns.');
  23. INSERT INTO perm_items (name, descr) VALUES ('zone_meta_edit_own','User is allowed to edit the meta data of zones he owns.');
  24. INSERT INTO perm_items (name, descr) VALUES ('zone_content_view_others','User is allowed to see the content and meta data of zones he does not own.');
  25. INSERT INTO perm_items (name, descr) VALUES ('zone_content_edit_others','User is allowed to edit the content of zones he does not own.');
  26. INSERT INTO perm_items (name, descr) VALUES ('zone_meta_edit_others','User is allowed to edit the meta data of zones he does not own.');
  27. INSERT INTO perm_items (name, descr) VALUES ('search','User is allowed to perform searches.');
  28. INSERT INTO perm_items (name, descr) VALUES ('supermaster_view','User is allowed to view supermasters.');
  29. INSERT INTO perm_items (name, descr) VALUES ('supermaster_add','User is allowed to add new supermasters.');
  30. INSERT INTO perm_items (name, descr) VALUES ('supermaster_edit','User is allowed to edit supermasters.');
  31. INSERT INTO perm_items (name, descr) VALUES ('user_view_others','User is allowed to see other users and their details.');
  32. INSERT INTO perm_items (name, descr) VALUES ('user_add_new','User is allowed to add new users.');
  33. INSERT INTO perm_items (name, descr) VALUES ('user_edit_own','User is allowed to edit their own details.');
  34. INSERT INTO perm_items (name, descr) VALUES ('user_edit_others','User is allowed to edit other users.');
  35. INSERT INTO perm_items (name, descr) VALUES ('user_passwd_edit_others','User is allowed to edit the password of other users.');
  36. INSERT INTO perm_items (name, descr) VALUES ('user_edit_templ_perm','User is allowed to change the permission template that is assigned to a user.');
  37. INSERT INTO perm_items (name, descr) VALUES ('templ_perm_add','User is allowed to add new permission templates.');
  38. INSERT INTO perm_items (name, descr) VALUES ('templ_perm_edit','User is allowed to edit existing permission templates.');
  39. CREATE TABLE perm_templ (
  40. id SERIAL PRIMARY KEY,
  41. name varchar(128) NOT NULL,
  42. descr text NOT NULL
  43. );
  44. INSERT INTO perm_templ (name, descr) VALUES ('Administrator','Administrator template with full rights.');
  45. CREATE TABLE perm_templ_items (
  46. id SERIAL PRIMARY KEY,
  47. templ_id integer NOT NULL,
  48. perm_id integer NOT NULL
  49. );
  50. INSERT INTO perm_templ_items (templ_id, perm_id) VALUES (1,1);
  51. CREATE TABLE zones (
  52. id SERIAL PRIMARY KEY,
  53. domain_id integer default 0,
  54. owner integer default 0,
  55. comment text,
  56. zone_templ_id integer NOT NULL
  57. );
  58. CREATE INDEX zone_domain_owner ON zones(domain_id, owner);
  59. CREATE TABLE zone_templ (
  60. id SERIAL PRIMARY KEY,
  61. name varchar(128) NOT NULL,
  62. descr text NOT NULL,
  63. owner integer default 0
  64. );
  65. CREATE TABLE zone_templ_records (
  66. id SERIAL PRIMARY KEY,
  67. zone_templ_id integer NOT NULL,
  68. name varchar(255) NOT NULL,
  69. type varchar(6) NOT NULL,
  70. content varchar(255) NOT NULL,
  71. ttl integer default NULL,
  72. prio integer default NULL
  73. );
  74. CREATE TABLE records_zone_templ (
  75. domain_id integer NOT NULL,
  76. record_id integer NOT NULL,
  77. zone_templ_id integer NOT NULL
  78. );
  79. CREATE TABLE migrations (
  80. version varchar(255) NOT NULL,
  81. apply_time integer NOT NULL
  82. );