2 -- Copyright © 2012 - 2018 camunda services GmbH and various authors (info@camunda.com)
4 -- Licensed under the Apache License, Version 2.0 (the "License");
5 -- you may not use this file except in compliance with the License.
6 -- You may obtain a copy of the License at
8 -- http://www.apache.org/licenses/LICENSE-2.0
10 -- Unless required by applicable law or agreed to in writing, software
11 -- distributed under the License is distributed on an "AS IS" BASIS,
12 -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 -- See the License for the specific language governing permissions and
14 -- limitations under the License.
17 create table ACT_ID_GROUP (
23 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
25 create table ACT_ID_MEMBERSHIP (
27 GROUP_ID_ varchar(64),
28 primary key (USER_ID_, GROUP_ID_)
29 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
31 create table ACT_ID_USER (
39 LOCK_EXP_TIME_ timestamp NULL,
41 PICTURE_ID_ varchar(64),
43 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
45 create table ACT_ID_INFO (
53 PARENT_ID_ varchar(255),
55 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
57 create table ACT_ID_TENANT (
62 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
64 create table ACT_ID_TENANT_MEMBER (
65 ID_ varchar(64) not null,
66 TENANT_ID_ varchar(64) not null,
68 GROUP_ID_ varchar(64),
70 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
72 alter table ACT_ID_MEMBERSHIP
73 add constraint ACT_FK_MEMB_GROUP
74 foreign key (GROUP_ID_)
75 references ACT_ID_GROUP (ID_);
77 alter table ACT_ID_MEMBERSHIP
78 add constraint ACT_FK_MEMB_USER
79 foreign key (USER_ID_)
80 references ACT_ID_USER (ID_);
82 alter table ACT_ID_TENANT_MEMBER
83 add constraint ACT_UNIQ_TENANT_MEMB_USER
84 unique (TENANT_ID_, USER_ID_);
86 alter table ACT_ID_TENANT_MEMBER
87 add constraint ACT_UNIQ_TENANT_MEMB_GROUP
88 unique (TENANT_ID_, GROUP_ID_);
90 alter table ACT_ID_TENANT_MEMBER
91 add constraint ACT_FK_TENANT_MEMB
92 foreign key (TENANT_ID_)
93 references ACT_ID_TENANT (ID_);
95 alter table ACT_ID_TENANT_MEMBER
96 add constraint ACT_FK_TENANT_MEMB_USER
97 foreign key (USER_ID_)
98 references ACT_ID_USER (ID_);
100 alter table ACT_ID_TENANT_MEMBER
101 add constraint ACT_FK_TENANT_MEMB_GROUP
102 foreign key (GROUP_ID_)
103 references ACT_ID_GROUP (ID_);