2011-11-17 12:00:54 +00:00
|
|
|
# $Id$
|
|
|
|
#
|
2017-06-10 22:10:52 +00:00
|
|
|
# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
2011-11-17 12:00:54 +00:00
|
|
|
#
|
|
|
|
# Licensed under The MIT License
|
2013-02-08 12:26:18 +00:00
|
|
|
# For full copyright and license information, please see the LICENSE.txt
|
2011-11-17 12:00:54 +00:00
|
|
|
# Redistributions of files must retain the above copyright notice.
|
2017-06-10 22:23:14 +00:00
|
|
|
# MIT License (https://opensource.org/licenses/mit-license.php)
|
2011-11-17 12:00:54 +00:00
|
|
|
|
|
|
|
CREATE TABLE acos (
|
|
|
|
id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
parent_id INTEGER(10) DEFAULT NULL,
|
|
|
|
model VARCHAR(255) DEFAULT '',
|
|
|
|
foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
|
|
|
|
alias VARCHAR(255) DEFAULT '',
|
|
|
|
lft INTEGER(10) DEFAULT NULL,
|
|
|
|
rght INTEGER(10) DEFAULT NULL,
|
|
|
|
PRIMARY KEY (id)
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE aros_acos (
|
|
|
|
id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
aro_id INTEGER(10) UNSIGNED NOT NULL,
|
|
|
|
aco_id INTEGER(10) UNSIGNED NOT NULL,
|
|
|
|
_create CHAR(2) NOT NULL DEFAULT 0,
|
|
|
|
_read CHAR(2) NOT NULL DEFAULT 0,
|
|
|
|
_update CHAR(2) NOT NULL DEFAULT 0,
|
|
|
|
_delete CHAR(2) NOT NULL DEFAULT 0,
|
|
|
|
PRIMARY KEY(id)
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE aros (
|
|
|
|
id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
parent_id INTEGER(10) DEFAULT NULL,
|
|
|
|
model VARCHAR(255) DEFAULT '',
|
|
|
|
foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
|
|
|
|
alias VARCHAR(255) DEFAULT '',
|
|
|
|
lft INTEGER(10) DEFAULT NULL,
|
|
|
|
rght INTEGER(10) DEFAULT NULL,
|
|
|
|
PRIMARY KEY (id)
|
2014-06-20 17:49:02 +00:00
|
|
|
);
|
|
|
|
|
2018-06-26 04:42:50 +00:00
|
|
|
/* this indexes will improve acl performance */
|
2014-07-22 01:30:05 +00:00
|
|
|
CREATE INDEX idx_acos_lft_rght ON `acos` (`lft`, `rght`);
|
2014-06-20 17:49:02 +00:00
|
|
|
|
|
|
|
CREATE INDEX idx_acos_alias ON `acos` (`alias`);
|
|
|
|
|
2014-07-22 01:30:05 +00:00
|
|
|
CREATE INDEX idx_aros_lft_rght ON `aros` (`lft`, `rght`);
|
2014-06-20 17:49:02 +00:00
|
|
|
|
|
|
|
CREATE INDEX idx_aros_alias ON `aros` (`alias`);
|
|
|
|
|
2014-07-22 01:30:05 +00:00
|
|
|
CREATE INDEX idx_aco_id ON `aros_acos` (`aco_id`);
|