Feature/multi tenant (#377)

* [feature] Add tenantManager

* [fix] Fix export

* [schema] Change schema for tenants

* [de] For auth

* [config] Remove unused secret.browser param to unify with multitenancy

* [feature] Add OperationContext to store state of request

* [log] Remove docId and userId from log message

* [feature] Add OperationContext class

* [feature] For logging

* [feature] Add content to some methods

* [feature] For multitenancy

* [feature] For multitenancy

* [feature] For multitenancy

* [feature] For multitenancy

* [feature] For multitenancy

* [feature] For multitenancy

* [feature] Move all tenant logic to tenantManager

* [feature] Fix reading of tenant license

* [feature] Move tenant logic to EditorData interface

* [feature] Use context in SQL queries

* [feature] Refactoring

* [feature] Fix editorDataMemory

* [feature] Fix before merge
This commit is contained in:
Sergey Konovalov
2022-08-02 17:34:06 +03:00
committed by GitHub
parent 0c215cefa9
commit 41399fa3d4
32 changed files with 2159 additions and 1661 deletions

View File

@ -26,6 +26,7 @@ USE onlyoffice;
--
CREATE TABLE IF NOT EXISTS `doc_changes` (
`tenant` varchar(255) NOT NULL,
`id` varchar(255) NOT NULL,
`change_id` int(10) unsigned NOT NULL,
`user_id` varchar(255) NOT NULL,
@ -33,7 +34,7 @@ CREATE TABLE IF NOT EXISTS `doc_changes` (
`user_name` varchar(255) NOT NULL,
`change_data` longtext NOT NULL,
`change_date` datetime NOT NULL,
PRIMARY KEY (`id`,`change_id`)
PRIMARY KEY (`tenant`, `id`,`change_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
@ -48,6 +49,7 @@ CREATE TABLE IF NOT EXISTS `doc_changes` (
--
CREATE TABLE IF NOT EXISTS `task_result` (
`tenant` varchar(255) NOT NULL,
`id` varchar(255) NOT NULL,
`status` tinyint(3) NOT NULL,
`status_info` int(10) NOT NULL,
@ -59,7 +61,7 @@ CREATE TABLE IF NOT EXISTS `task_result` (
`baseurl` text NOT NULL,
`password` longtext NULL,
`additional` longtext NULL,
PRIMARY KEY (`id`)
PRIMARY KEY (`tenant`, `id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--