Base for a static organization website

db_acl.sql 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # $Id$
  2. #
  3. # Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  4. #
  5. # Licensed under The MIT License
  6. # For full copyright and license information, please see the LICENSE.txt
  7. # Redistributions of files must retain the above copyright notice.
  8. # MIT License (http://www.opensource.org/licenses/mit-license.php)
  9. CREATE TABLE acos (
  10. id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  11. parent_id INTEGER(10) DEFAULT NULL,
  12. model VARCHAR(255) DEFAULT '',
  13. foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
  14. alias VARCHAR(255) DEFAULT '',
  15. lft INTEGER(10) DEFAULT NULL,
  16. rght INTEGER(10) DEFAULT NULL,
  17. PRIMARY KEY (id)
  18. );
  19. CREATE TABLE aros_acos (
  20. id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  21. aro_id INTEGER(10) UNSIGNED NOT NULL,
  22. aco_id INTEGER(10) UNSIGNED NOT NULL,
  23. _create CHAR(2) NOT NULL DEFAULT 0,
  24. _read CHAR(2) NOT NULL DEFAULT 0,
  25. _update CHAR(2) NOT NULL DEFAULT 0,
  26. _delete CHAR(2) NOT NULL DEFAULT 0,
  27. PRIMARY KEY(id)
  28. );
  29. CREATE TABLE aros (
  30. id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  31. parent_id INTEGER(10) DEFAULT NULL,
  32. model VARCHAR(255) DEFAULT '',
  33. foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
  34. alias VARCHAR(255) DEFAULT '',
  35. lft INTEGER(10) DEFAULT NULL,
  36. rght INTEGER(10) DEFAULT NULL,
  37. PRIMARY KEY (id)
  38. );
  39. /* this indexes will improve acl perfomance */
  40. CREATE INDEX idx_acos_lft_rght ON `acos` (`lft`, `rght`);
  41. CREATE INDEX idx_acos_alias ON `acos` (`alias`);
  42. CREATE INDEX idx_aros_lft_rght ON `aros` (`lft`, `rght`);
  43. CREATE INDEX idx_aros_alias ON `aros` (`alias`);
  44. CREATE INDEX idx_aco_id ON `aros_acos` (`aco_id`);