mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
parent
ee10e6db3b
commit
ca91cd8e49
4 changed files with 30 additions and 18 deletions
|
@ -227,6 +227,8 @@ CREATE TABLE IF NOT EXISTS `search` (
|
|||
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin
|
||||
ENGINE = MyISAM;
|
||||
|
||||
-- FULLTEXT search requires MyISAM and NOT InnoDB
|
||||
|
||||
DROP TABLE IF EXISTS `revision`;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `revision` (
|
||||
|
@ -258,7 +260,8 @@ CREATE TABLE IF NOT EXISTS `config` (
|
|||
`key` CHAR(255) NOT NULL,
|
||||
`config` JSON,
|
||||
UNIQUE INDEX `idx_config_area` (`key` ASC))
|
||||
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
|
||||
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin
|
||||
ENGINE = InnoDB;
|
||||
|
||||
INSERT INTO `config` VALUES ('SMTP','{\"userid\": \"\",\"password\": \"\",\"host\": \"\",\"port\": \"\",\"sender\": \"\"}');
|
||||
INSERT INTO `config` VALUES ('FILEPLUGINS',
|
||||
|
|
|
@ -44,6 +44,7 @@ CREATE TABLE IF NOT EXISTS `search` (
|
|||
FULLTEXT INDEX `idx_search_content` (`content`))
|
||||
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
|
||||
ENGINE = MyISAM;
|
||||
-- FULLTEXT search requires MyISAM and NOT InnoDB
|
||||
|
||||
-- migrate page content
|
||||
INSERT INTO search (orgid, documentid, itemid, itemtype, content) SELECT orgid, documentid, id AS itemid, 'page' AS itemtype, TRIM(body) AS content FROM search_old;
|
||||
|
|
|
@ -22,7 +22,7 @@ CREATE TABLE IF NOT EXISTS `permission` (
|
|||
UNIQUE INDEX `idx_permission_id` (`id` ASC),
|
||||
INDEX `idx_permission_orgid` (`orgid` ASC))
|
||||
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
|
||||
ENGINE = MyISAM;
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE INDEX idx_permission_1 ON permission(orgid,who,whoid,location);
|
||||
CREATE INDEX idx_permission_2 ON permission(orgid,who,whoid,location,action);
|
||||
|
@ -44,7 +44,7 @@ CREATE TABLE IF NOT EXISTS `category` (
|
|||
INDEX `idx_category_refid` (`refid` ASC),
|
||||
INDEX `idx_category_orgid` (`orgid` ASC))
|
||||
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
|
||||
ENGINE = MyISAM;
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE INDEX idx_category_1 ON category(orgid,labelid);
|
||||
|
||||
|
@ -63,12 +63,12 @@ CREATE TABLE IF NOT EXISTS `categorymember` (
|
|||
UNIQUE INDEX `idx_categorymember_id` (`id` ASC),
|
||||
INDEX `idx_category_documentid` (`documentid`))
|
||||
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
|
||||
ENGINE = MyISAM;
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE INDEX idx_categorymember_1 ON categorymember(orgid,documentid);
|
||||
CREATE INDEX idx_categorymember_2 ON categorymember(orgid,labelid);
|
||||
|
||||
-- rolee represent user groups
|
||||
-- rolee represent user groups
|
||||
DROP TABLE IF EXISTS `role`;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `role` (
|
||||
|
@ -81,7 +81,7 @@ CREATE TABLE IF NOT EXISTS `role` (
|
|||
INDEX `idx_category_refid` (`refid` ASC),
|
||||
INDEX `idx_category_orgid` (`orgid` ASC))
|
||||
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
|
||||
ENGINE = MyISAM;
|
||||
ENGINE = InnoDB;
|
||||
|
||||
-- role member records user role membership
|
||||
DROP TABLE IF EXISTS `rolemember`;
|
||||
|
@ -93,49 +93,49 @@ CREATE TABLE IF NOT EXISTS `rolemember` (
|
|||
`userid` CHAR(16) NOT NULL COLLATE utf8_bin,
|
||||
UNIQUE INDEX `idx_category_id` (`id` ASC))
|
||||
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
|
||||
ENGINE = MyISAM;
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE INDEX idx_rolemember_1 ON rolemember(roleid,userid);
|
||||
CREATE INDEX idx_rolemember_2 ON rolemember(orgid,roleid,userid);
|
||||
|
||||
-- user account can have global permssion to state if user can see all other users
|
||||
-- provides granular control for external users
|
||||
-- provides granular control for external users
|
||||
ALTER TABLE account ADD COLUMN `users` BOOL NOT NULL DEFAULT 1 AFTER `admin`;
|
||||
|
||||
-- migrate space/document permissions
|
||||
|
||||
-- space own
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
SELECT orgid, 'user' as who, userid as whois, 'own' as `action`, 'object' as scope, 'space' as location, refid
|
||||
FROM label;
|
||||
|
||||
-- space manage (same as owner)
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
SELECT orgid, 'user' as who, userid as whois, 'manage' as `action`, 'object' as scope, 'space' as location, refid
|
||||
FROM label;
|
||||
|
||||
-- view space
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
SELECT orgid, 'user' as who, userid as whois, 'view' as `action`, 'object' as scope, 'space' as location, labelid as refid
|
||||
FROM labelrole WHERE canview=1;
|
||||
|
||||
-- edit space => add/edit/delete/move/copy/template documents
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
SELECT orgid, 'user' as who, userid as whois, 'doc-add' as `action`, 'object' as scope, 'space' as location, labelid as refid
|
||||
FROM labelrole WHERE canedit=1;
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
SELECT orgid, 'user' as who, userid as whois, 'doc-edit' as `action`, 'object' as scope, 'space' as location, labelid as refid
|
||||
FROM labelrole WHERE canedit=1;
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
SELECT orgid, 'user' as who, userid as whois, 'doc-delete' as `action`, 'object' as scope, 'space' as location, labelid as refid
|
||||
FROM labelrole WHERE canedit=1;
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
SELECT orgid, 'user' as who, userid as whois, 'doc-move' as `action`, 'object' as scope, 'space' as location, labelid as refid
|
||||
FROM labelrole WHERE canedit=1;
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
SELECT orgid, 'user' as who, userid as whois, 'doc-copy' as `action`, 'object' as scope, 'space' as location, labelid as refid
|
||||
FROM labelrole WHERE canedit=1;
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
INSERT INTO permission (orgid, who, whoid, `action`, scope, location, refid)
|
||||
SELECT orgid, 'user' as who, userid as whois, 'doc-template' as `action`, 'object' as scope, 'space' as location, labelid as refid
|
||||
FROM labelrole WHERE canedit=1;
|
||||
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
/* enterprise edition */
|
||||
|
||||
-- consistency of table engines
|
||||
ALTER TABLE config ENGINE = InnoDB;
|
||||
ALTER TABLE permission ENGINE = InnoDB;
|
||||
ALTER TABLE category ENGINE = InnoDB;
|
||||
ALTER TABLE categorymember ENGINE = InnoDB;
|
||||
ALTER TABLE role ENGINE = InnoDB;
|
||||
ALTER TABLE rolemember ENGINE = InnoDB;
|
||||
|
||||
-- content analytics
|
||||
ALTER TABLE useractivity ADD COLUMN `metadata` VARCHAR(1000) NOT NULL DEFAULT '' AFTER `activitytype`;
|
||||
|
||||
|
@ -21,7 +29,7 @@ ALTER TABLE useractivity ADD COLUMN `metadata` VARCHAR(1000) NOT NULL DEFAULT ''
|
|||
-- INDEX `idx_vote_documentid` (`documentid` ASC),
|
||||
-- INDEX `idx_vote_orgid` (`orgid` ASC))
|
||||
-- DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
|
||||
-- ENGINE = MyISAM;
|
||||
-- ENGINE = InnoDB;
|
||||
|
||||
-- CREATE INDEX idx_vote_1 ON vaote(orgid,documentid);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue