2 -- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
 
   3 -- under one or more contributor license agreements. See the NOTICE file
 
   4 -- distributed with this work for additional information regarding copyright
 
   5 -- ownership. Camunda licenses this file to you under the Apache License,
 
   6 -- Version 2.0; you may not use this file except in compliance with the License.
 
   7 -- You may obtain a copy of the License at
 
   9 --     http://www.apache.org/licenses/LICENSE-2.0
 
  11 -- Unless required by applicable law or agreed to in writing, software
 
  12 -- distributed under the License is distributed on an "AS IS" BASIS,
 
  13 -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  14 -- See the License for the specific language governing permissions and
 
  15 -- limitations under the License.
 
  20 create table ACT_ID_GROUP (
 
  26 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
 
  28 create table ACT_ID_MEMBERSHIP (
 
  30     GROUP_ID_ varchar(64),
 
  31     primary key (USER_ID_, GROUP_ID_)
 
  32 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
 
  34 create table ACT_ID_USER (
 
  42     LOCK_EXP_TIME_ datetime(3) NULL,
 
  44     PICTURE_ID_ varchar(64),
 
  46 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
 
  48 create table ACT_ID_INFO (
 
  56     PARENT_ID_ varchar(255),
 
  58 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
 
  60 create table ACT_ID_TENANT (
 
  65 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
 
  67 create table ACT_ID_TENANT_MEMBER (
 
  68     ID_ varchar(64) not null,
 
  69     TENANT_ID_ varchar(64) not null,
 
  71     GROUP_ID_ varchar(64),
 
  73 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
 
  75 alter table ACT_ID_MEMBERSHIP
 
  76     add constraint ACT_FK_MEMB_GROUP
 
  77     foreign key (GROUP_ID_)
 
  78     references ACT_ID_GROUP (ID_);
 
  80 alter table ACT_ID_MEMBERSHIP
 
  81     add constraint ACT_FK_MEMB_USER
 
  82     foreign key (USER_ID_)
 
  83     references ACT_ID_USER (ID_);
 
  85 alter table ACT_ID_TENANT_MEMBER
 
  86     add constraint ACT_UNIQ_TENANT_MEMB_USER
 
  87     unique (TENANT_ID_, USER_ID_);
 
  89 alter table ACT_ID_TENANT_MEMBER
 
  90     add constraint ACT_UNIQ_TENANT_MEMB_GROUP
 
  91     unique (TENANT_ID_, GROUP_ID_);
 
  93 alter table ACT_ID_TENANT_MEMBER
 
  94     add constraint ACT_FK_TENANT_MEMB
 
  95     foreign key (TENANT_ID_)
 
  96     references ACT_ID_TENANT (ID_);
 
  98 alter table ACT_ID_TENANT_MEMBER
 
  99     add constraint ACT_FK_TENANT_MEMB_USER
 
 100     foreign key (USER_ID_)
 
 101     references ACT_ID_USER (ID_);
 
 103 alter table ACT_ID_TENANT_MEMBER
 
 104     add constraint ACT_FK_TENANT_MEMB_GROUP
 
 105     foreign key (GROUP_ID_)
 
 106     references ACT_ID_GROUP (ID_);