diff --git a/distro/src/notice.txt b/distro/src/notice.txt index 4bcd443a5c8..958d26a0006 100644 --- a/distro/src/notice.txt +++ b/distro/src/notice.txt @@ -100,7 +100,6 @@ org.apache.geronimo.bundles json 20090211_1 The org.apache.groovy groovy 4.0.17 The Apache Software License, Version 2.0 org.apache.groovy groovy-jsr223 4.0.17 The Apache Software License, Version 2.0 org.eclipse.angus angus-mail 2.0.2 EDL 1.0 / EPL 2.0 -org.liquibase liquibase-core 4.5.0 Apache License, Version 2.0 org.mybatis mybatis 3.5.13 The Apache Software License, Version 2.0 org.mybatis mybatis-spring 3.0.3 The Apache Software License, Version 2.0 org.mvel mvel2 2.2.6.Final The Apache Software License, Version 2.0 diff --git a/modules/flowable-app-engine-api/pom.xml b/modules/flowable-app-engine-api/pom.xml index 2a5ecb83fb4..c7db8397465 100644 --- a/modules/flowable-app-engine-api/pom.xml +++ b/modules/flowable-app-engine-api/pom.xml @@ -25,6 +25,10 @@ org.flowable flowable-engine-common-api + + org.flowable + flowable-engine-common + org.flowable flowable-variable-service-api diff --git a/modules/flowable-app-engine-api/src/main/java/org/flowable/app/api/AppManagementService.java b/modules/flowable-app-engine-api/src/main/java/org/flowable/app/api/AppManagementService.java index 39ed6b69b19..71a4f7d114c 100644 --- a/modules/flowable-app-engine-api/src/main/java/org/flowable/app/api/AppManagementService.java +++ b/modules/flowable-app-engine-api/src/main/java/org/flowable/app/api/AppManagementService.java @@ -15,6 +15,8 @@ import java.util.Collection; import java.util.Map; +import org.flowable.common.engine.api.lock.LockManager; + /** * @author Tijs Rademakers */ @@ -30,4 +32,15 @@ public interface AppManagementService { */ Collection getTableNames(); + /** + * Acquire a lock manager for the requested lock. + * This is a stateless call, this means that every time a lock manager + * is requested a new one would be created. Make sure that you release the lock + * once you are done. + * + * @param lockName the name of the lock that is being requested + * + * @return the lock manager for the given lock + */ + LockManager getLockManager(String lockName); } diff --git a/modules/flowable-app-engine-rest/src/test/java/org/flowable/app/rest/service/BaseSpringRestTestCase.java b/modules/flowable-app-engine-rest/src/test/java/org/flowable/app/rest/service/BaseSpringRestTestCase.java index 3a8f416a9c0..0d458a24653 100644 --- a/modules/flowable-app-engine-rest/src/test/java/org/flowable/app/rest/service/BaseSpringRestTestCase.java +++ b/modules/flowable-app-engine-rest/src/test/java/org/flowable/app/rest/service/BaseSpringRestTestCase.java @@ -273,15 +273,7 @@ protected void assertAndEnsureCleanDb() throws Throwable { appEngineConfiguration, TABLENAMES_EXCLUDED_FROM_DB_CLEAN_CHECK, exception == null, - new Command() { - @Override - public Void execute(CommandContext commandContext) { - SchemaManager schemaManager = CommandContextUtil.getAppEngineConfiguration(commandContext).getSchemaManager(); - schemaManager.schemaDrop(); - schemaManager.schemaCreate(); - return null; - } - } + appEngineConfiguration.getSchemaManagementCmd() ); } diff --git a/modules/flowable-app-engine-spring/src/main/java/org/flowable/app/spring/SpringAppEngineConfiguration.java b/modules/flowable-app-engine-spring/src/main/java/org/flowable/app/spring/SpringAppEngineConfiguration.java index bd51301366f..8c04fcb6c70 100644 --- a/modules/flowable-app-engine-spring/src/main/java/org/flowable/app/spring/SpringAppEngineConfiguration.java +++ b/modules/flowable-app-engine-spring/src/main/java/org/flowable/app/spring/SpringAppEngineConfiguration.java @@ -62,8 +62,8 @@ public SpringAppEngineConfiguration() { } @Override - public AppEngine buildAppEngine() { - AppEngine appEngine = super.buildAppEngine(); + public AppEngine buildEngine() { + AppEngine appEngine = super.buildEngine(); AppEngines.setInitialized(true); enginesBuild.add(appEngine.getName()); return appEngine; diff --git a/modules/flowable-app-engine-spring/src/main/java/org/flowable/app/spring/autodeployment/AbstractAppAutoDeploymentStrategy.java b/modules/flowable-app-engine-spring/src/main/java/org/flowable/app/spring/autodeployment/AbstractAppAutoDeploymentStrategy.java index 362495fc5af..c0ec473faa7 100644 --- a/modules/flowable-app-engine-spring/src/main/java/org/flowable/app/spring/autodeployment/AbstractAppAutoDeploymentStrategy.java +++ b/modules/flowable-app-engine-spring/src/main/java/org/flowable/app/spring/autodeployment/AbstractAppAutoDeploymentStrategy.java @@ -20,7 +20,7 @@ import org.flowable.app.api.repository.AppDeploymentBuilder; import org.flowable.app.engine.AppEngine; -import org.flowable.common.engine.impl.lock.LockManager; +import org.flowable.common.engine.api.lock.LockManager; import org.flowable.common.spring.CommonAutoDeploymentProperties; import org.flowable.common.spring.CommonAutoDeploymentStrategy; import org.springframework.core.io.Resource; diff --git a/modules/flowable-app-engine/pom.xml b/modules/flowable-app-engine/pom.xml index 758a66c8e3b..566aafd7aa3 100644 --- a/modules/flowable-app-engine/pom.xml +++ b/modules/flowable-app-engine/pom.xml @@ -51,10 +51,6 @@ org.flowable flowable-identitylink-service - - org.liquibase - liquibase-core - com.fasterxml.uuid java-uuid-generator diff --git a/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/AppEngineConfiguration.java b/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/AppEngineConfiguration.java index ae3d4a4ab25..eb3e792fc34 100644 --- a/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/AppEngineConfiguration.java +++ b/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/AppEngineConfiguration.java @@ -28,10 +28,10 @@ import org.flowable.app.api.AppRepositoryService; import org.flowable.app.api.repository.AppResourceConverter; import org.flowable.app.engine.impl.AppEngineImpl; +import org.flowable.app.engine.impl.AppEnginePostEngineBuildConsumer; import org.flowable.app.engine.impl.AppManagementServiceImpl; import org.flowable.app.engine.impl.AppRepositoryServiceImpl; import org.flowable.app.engine.impl.cfg.StandaloneInMemAppEngineConfiguration; -import org.flowable.app.engine.impl.cmd.SchemaOperationsAppEngineBuild; import org.flowable.app.engine.impl.db.AppDbSchemaManager; import org.flowable.app.engine.impl.db.EntityDependencyOrder; import org.flowable.app.engine.impl.deployer.AppDeployer; @@ -52,6 +52,7 @@ import org.flowable.app.engine.impl.persistence.entity.data.impl.MybatisResourceDataManager; import org.flowable.app.engine.impl.persistence.entity.deploy.AppDefinitionCacheEntry; import org.flowable.common.engine.api.scope.ScopeTypes; +import org.flowable.common.engine.impl.AbstractBuildableEngineConfiguration; import org.flowable.common.engine.impl.AbstractEngineConfiguration; import org.flowable.common.engine.impl.EngineConfigurator; import org.flowable.common.engine.impl.EngineDeployer; @@ -73,7 +74,6 @@ import org.flowable.common.engine.impl.persistence.entity.TableDataManager; import org.flowable.eventregistry.impl.configurator.EventRegistryEngineConfigurator; import org.flowable.identitylink.service.IdentityLinkServiceConfiguration; -import org.flowable.identitylink.service.impl.db.IdentityLinkDbSchemaManager; import org.flowable.idm.api.IdmEngineConfigurationApi; import org.flowable.idm.api.IdmIdentityService; import org.flowable.idm.engine.configurator.IdmEngineConfigurator; @@ -81,7 +81,6 @@ import org.flowable.variable.api.types.VariableTypes; import org.flowable.variable.service.VariableServiceConfiguration; import org.flowable.variable.service.impl.db.IbatisVariableTypeHandler; -import org.flowable.variable.service.impl.db.VariableDbSchemaManager; import org.flowable.variable.service.impl.types.BooleanType; import org.flowable.variable.service.impl.types.ByteArrayType; import org.flowable.variable.service.impl.types.DateType; @@ -103,11 +102,10 @@ import org.flowable.variable.service.impl.types.StringType; import org.flowable.variable.service.impl.types.UUIDType; -public class AppEngineConfiguration extends AbstractEngineConfiguration implements +public class AppEngineConfiguration extends AbstractBuildableEngineConfiguration implements AppEngineConfigurationApi, HasExpressionManagerEngineConfiguration, HasVariableTypes { public static final String DEFAULT_MYBATIS_MAPPING_FILE = "org/flowable/app/db/mapping/mappings.xml"; - public static final String LIQUIBASE_CHANGELOG_PREFIX = "ACT_APP_"; protected String appEngineName = AppEngines.NAME_DEFAULT; @@ -124,8 +122,6 @@ public class AppEngineConfiguration extends AbstractEngineConfiguration implemen protected boolean disableIdmEngine; protected boolean disableEventRegistry; - - protected boolean executeServiceSchemaManagers = true; protected AppDeployer appDeployer; protected AppDeploymentManager deploymentManager; @@ -136,8 +132,6 @@ public class AppEngineConfiguration extends AbstractEngineConfiguration implemen protected ExpressionManager expressionManager; protected Collection> expressionManagerConfigurers; - protected SchemaManager identityLinkSchemaManager; - protected SchemaManager variableSchemaManager; // Identitylink support protected IdentityLinkServiceConfiguration identityLinkServiceConfiguration; @@ -191,11 +185,21 @@ public static AppEngineConfiguration createStandaloneInMemAppEngineConfiguration return new StandaloneInMemAppEngineConfiguration(); } - public AppEngine buildAppEngine() { - init(); + @Override + protected AppEngine createEngine() { return new AppEngineImpl(this); } + @Override + protected Consumer createPostEngineBuildConsumer() { + return new AppEnginePostEngineBuildConsumer(); + } + + public AppEngine buildAppEngine() { + return buildEngine(); + } + + @Override protected void init() { initEngineConfigurations(); initConfigurators(); @@ -241,40 +245,8 @@ protected void init() { } @Override - public void initSchemaManager() { - super.initSchemaManager(); - initAppSchemaManager(); - - if (executeServiceSchemaManagers) { - initIdentityLinkSchemaManager(); - initVariableSchemaManager(); - } - } - - public void initSchemaManagementCommand() { - if (schemaManagementCmd == null) { - if (usingRelationalDatabase && databaseSchemaUpdate != null) { - this.schemaManagementCmd = new SchemaOperationsAppEngineBuild(); - } - } - } - - protected void initAppSchemaManager() { - if (this.schemaManager == null) { - this.schemaManager = new AppDbSchemaManager(); - } - } - - protected void initVariableSchemaManager() { - if (this.variableSchemaManager == null) { - this.variableSchemaManager = new VariableDbSchemaManager(); - } - } - - protected void initIdentityLinkSchemaManager() { - if (this.identityLinkSchemaManager == null) { - this.identityLinkSchemaManager = new IdentityLinkDbSchemaManager(); - } + protected SchemaManager createEngineSchemaManager() { + return new AppDbSchemaManager(); } @Override @@ -675,14 +647,6 @@ public AppEngineConfiguration setDataSource(DataSource dataSource) { return this; } - public boolean isExecuteServiceSchemaManagers() { - return executeServiceSchemaManagers; - } - - public void setExecuteServiceSchemaManagers(boolean executeServiceSchemaManagers) { - this.executeServiceSchemaManagers = executeServiceSchemaManagers; - } - @Override public ExpressionManager getExpressionManager() { return expressionManager; @@ -707,24 +671,6 @@ public AbstractEngineConfiguration addExpressionManagerConfigurer(Consumer { + + @Override + public void accept(AppEngine appEngine) { + AppEngineConfiguration engineConfiguration = appEngine.getAppEngineConfiguration(); + if (engineConfiguration.getEngineLifecycleListeners() != null) { + for (EngineLifecycleListener engineLifecycleListener : engineConfiguration.getEngineLifecycleListeners()) { + engineLifecycleListener.onEngineBuilt(appEngine); + } + } + } +} diff --git a/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/AppManagementServiceImpl.java b/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/AppManagementServiceImpl.java index 4ebbfec6c00..f2a160d57e9 100644 --- a/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/AppManagementServiceImpl.java +++ b/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/AppManagementServiceImpl.java @@ -18,7 +18,9 @@ import org.flowable.app.api.AppManagementService; import org.flowable.app.engine.AppEngineConfiguration; import org.flowable.app.engine.impl.cmd.GetTableNamesCmd; +import org.flowable.common.engine.api.lock.LockManager; import org.flowable.common.engine.impl.cmd.GetTableCountCmd; +import org.flowable.common.engine.impl.lock.LockManagerImpl; import org.flowable.common.engine.impl.service.CommonEngineServiceImpl; /** @@ -39,5 +41,9 @@ public Map getTableCounts() { public Collection getTableNames() { return commandExecutor.execute(new GetTableNamesCmd()); } - + + @Override + public LockManager getLockManager(String lockName) { + return new LockManagerImpl(commandExecutor, lockName, getConfiguration().getLockPollRate(), configuration.getEngineCfgKey()); + } } diff --git a/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/aot/FlowableAppRuntimeHints.java b/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/aot/FlowableAppRuntimeHints.java index 76235896c78..901e525947a 100644 --- a/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/aot/FlowableAppRuntimeHints.java +++ b/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/aot/FlowableAppRuntimeHints.java @@ -25,7 +25,6 @@ public class FlowableAppRuntimeHints implements RuntimeHintsRegistrar { @Override public void registerHints(RuntimeHints hints, ClassLoader classLoader) { ResourceHints resourceHints = hints.resources(); - resourceHints.registerPattern("org/flowable/app/db/liquibase/flowable-app-db-changelog.xml"); FlowableMyBatisResourceHintsRegistrar.registerMappingResources("org/flowable/app/db/mapping", hints, classLoader); } } diff --git a/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/cmd/SchemaOperationsAppEngineBuild.java b/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/cmd/SchemaOperationsAppEngineBuild.java deleted file mode 100644 index 0c47cac82c1..00000000000 --- a/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/cmd/SchemaOperationsAppEngineBuild.java +++ /dev/null @@ -1,31 +0,0 @@ -/* Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.flowable.app.engine.impl.cmd; - -import org.flowable.app.engine.impl.db.AppDbSchemaManager; -import org.flowable.app.engine.impl.util.CommandContextUtil; -import org.flowable.common.engine.impl.interceptor.Command; -import org.flowable.common.engine.impl.interceptor.CommandContext; - -/** - * @author Tijs Rademakers - */ -public class SchemaOperationsAppEngineBuild implements Command { - - @Override - public Void execute(CommandContext commandContext) { - ((AppDbSchemaManager) CommandContextUtil.getAppEngineConfiguration(commandContext).getSchemaManager()).initSchema(); - return null; - } - -} diff --git a/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/db/AppDbSchemaManager.java b/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/db/AppDbSchemaManager.java index 64af0b663fd..2d11324c466 100644 --- a/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/db/AppDbSchemaManager.java +++ b/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/db/AppDbSchemaManager.java @@ -12,100 +12,72 @@ */ package org.flowable.app.engine.impl.db; -import org.flowable.app.engine.AppEngineConfiguration; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.flowable.app.engine.AppEngine; import org.flowable.app.engine.impl.util.CommandContextUtil; -import org.flowable.common.engine.api.FlowableException; -import org.flowable.common.engine.impl.db.EngineDatabaseConfiguration; -import org.flowable.common.engine.impl.db.LiquibaseBasedSchemaManager; -import org.flowable.common.engine.impl.db.LiquibaseDatabaseConfiguration; -import org.flowable.common.engine.impl.db.SchemaManager; +import org.flowable.common.engine.impl.AbstractEngineConfiguration; +import org.flowable.common.engine.impl.db.EngineSqlScriptBasedDbSchemaManager; -public class AppDbSchemaManager extends LiquibaseBasedSchemaManager { +public class AppDbSchemaManager extends EngineSqlScriptBasedDbSchemaManager { + + protected static final String APP_DB_SCHEMA_LOCK_NAME = "appDbSchemaLock"; - public static final String LIQUIBASE_CHANGELOG = "org/flowable/app/db/liquibase/flowable-app-db-changelog.xml"; + protected static final Map changeLogVersionMap = Map.ofEntries( + Map.entry("1", "6.3.1.0"), + Map.entry("2", "6.4.0.0"), + Map.entry("3", "6.4.1.3") + ); public AppDbSchemaManager() { - super("app", LIQUIBASE_CHANGELOG, AppEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX); + super("app"); } @Override - protected LiquibaseDatabaseConfiguration getDatabaseConfiguration() { - return new EngineDatabaseConfiguration(CommandContextUtil.getAppEngineConfiguration()); + protected String getEngineVersion() { + return AppEngine.VERSION; } - public void initSchema() { - initSchema(CommandContextUtil.getAppEngineConfiguration().getDatabaseSchemaUpdate()); - } - @Override - public void schemaCreate() { - try { - - getCommonSchemaManager().schemaCreate(); - getIdentityLinkSchemaManager().schemaCreate(); - getVariableSchemaManager().schemaCreate(); - - super.schemaCreate(); - } catch (Exception e) { - throw new FlowableException("Error creating App engine tables", e); - } + protected String getSchemaVersionPropertyName() { + return "app.schema.version"; } @Override - public void schemaDrop() { - try { - super.schemaDrop(); - } catch (Exception e) { - logger.info("Error dropping App engine tables", e); - } - - try { - getVariableSchemaManager().schemaDrop(); - } catch (Exception e) { - logger.info("Error dropping variable tables", e); - } - - try { - getIdentityLinkSchemaManager().schemaDrop(); - } catch (Exception e) { - logger.info("Error dropping identity link tables", e); - } - - try { - getCommonSchemaManager().schemaDrop(); - } catch (Exception e) { - logger.info("Error dropping common tables", e); - } + protected String getDbSchemaLockName() { + return APP_DB_SCHEMA_LOCK_NAME; } @Override - public String schemaUpdate() { - try { - - getCommonSchemaManager().schemaUpdate(); - - if (CommandContextUtil.getAppEngineConfiguration().isExecuteServiceSchemaManagers()) { - getIdentityLinkSchemaManager().schemaUpdate(); - getVariableSchemaManager().schemaUpdate(); - } - - super.schemaUpdate(); + protected String getEngineTableName() { + return "ACT_APP_DEPLOYMENT"; + } - } catch (Exception e) { - throw new FlowableException("Error updating App engine tables", e); - } - return null; + @Override + protected String getChangeLogTableName() { + return "ACT_APP_DATABASECHANGELOG"; } - protected SchemaManager getCommonSchemaManager() { - return CommandContextUtil.getAppEngineConfiguration().getCommonSchemaManager(); + @Override + protected String getChangeLogTablePrefixName() { + return "ACT_APP"; } - - protected SchemaManager getIdentityLinkSchemaManager() { - return CommandContextUtil.getAppEngineConfiguration().getIdentityLinkSchemaManager(); + + @Override + protected String getDbVersionForChangelogVersion(String changeLogVersion) { + if (StringUtils.isNotEmpty(changeLogVersion) && changeLogVersionMap.containsKey(changeLogVersion)) { + return changeLogVersionMap.get(changeLogVersion); + } + return "6.3.0.1"; } - - protected SchemaManager getVariableSchemaManager() { - return CommandContextUtil.getAppEngineConfiguration().getVariableSchemaManager(); + + @Override + protected AbstractEngineConfiguration getEngineConfiguration() { + return CommandContextUtil.getAppEngineConfiguration(); + } + @Override + protected String getResourcesRootDirectory() { + return "org/flowable/app/db/"; } } diff --git a/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/db/DbSchemaDrop.java b/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/db/DbSchemaDrop.java index 6658a346d18..8a5063e9717 100644 --- a/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/db/DbSchemaDrop.java +++ b/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/db/DbSchemaDrop.java @@ -18,11 +18,9 @@ import org.flowable.app.engine.AppEngine; import org.flowable.app.engine.AppEngineConfiguration; -import org.flowable.app.engine.impl.util.CommandContextUtil; import org.flowable.app.engine.test.FlowableAppTestCase; -import org.flowable.common.engine.impl.interceptor.Command; +import org.flowable.common.engine.impl.db.SchemaOperationsEngineDropDbCmd; import org.flowable.common.engine.impl.interceptor.CommandConfig; -import org.flowable.common.engine.impl.interceptor.CommandContext; import org.flowable.common.engine.impl.interceptor.CommandExecutor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,13 +37,7 @@ public static void main(String[] args) { AppEngine cmmnEngine = AppEngineConfiguration.createAppEngineConfigurationFromInputStream(inputStream).buildAppEngine(); CommandExecutor commandExecutor = cmmnEngine.getAppEngineConfiguration().getCommandExecutor(); CommandConfig config = new CommandConfig().transactionNotSupported(); - commandExecutor.execute(config, new Command<>() { - @Override - public Object execute(CommandContext commandContext) { - CommandContextUtil.getAppEngineConfiguration(commandContext).getSchemaManager().schemaDrop(); - return null; - } - }); + commandExecutor.execute(config, new SchemaOperationsEngineDropDbCmd(cmmnEngine.getAppEngineConfiguration().getEngineScopeType())); } catch (IOException e) { LOGGER.error("Could not create App engine", e); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.db2.create.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.db2.create.app.sql new file mode 100644 index 00000000000..a073f293d1a --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.db2.create.app.sql @@ -0,0 +1,18 @@ +CREATE TABLE ACT_APP_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), KEY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_APP_DEPLOY PRIMARY KEY (ID_)); + +CREATE TABLE ACT_APP_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_APP_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_APP_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_RSRC_DPL ON ACT_APP_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_APP_APPDEF (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ INTEGER NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_APP_APPDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_APPDEF ADD CONSTRAINT ACT_FK_APP_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_); + +CREATE UNIQUE INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_); + +insert into ACT_GE_PROPERTY +values ('app.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.h2.create.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.h2.create.app.sql new file mode 100644 index 00000000000..e569bfd4bb5 --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.h2.create.app.sql @@ -0,0 +1,18 @@ +CREATE TABLE ACT_APP_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), KEY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_APP_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_APP_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_APP_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_APP_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_RSRC_DPL ON ACT_APP_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_APP_APPDEF (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ INT NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_APP_APPDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_APPDEF ADD CONSTRAINT ACT_FK_APP_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_); + +CREATE UNIQUE INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_); + +insert into ACT_GE_PROPERTY +values ('app.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.mssql.create.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.mssql.create.app.sql new file mode 100644 index 00000000000..96b04c6d745 --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.mssql.create.app.sql @@ -0,0 +1,18 @@ +CREATE TABLE ACT_APP_DEPLOYMENT (ID_ varchar(255) NOT NULL, NAME_ varchar(255), CATEGORY_ varchar(255), KEY_ varchar(255), DEPLOY_TIME_ datetime, TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_APP_DEPLOYMENT_TENANT_ID_ DEFAULT '', CONSTRAINT PK_ACT_APP_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_APP_DEPLOYMENT_RESOURCE (ID_ varchar(255) NOT NULL, NAME_ varchar(255), DEPLOYMENT_ID_ varchar(255), RESOURCE_BYTES_ varbinary(MAX), CONSTRAINT PK_APP_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_APP_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_APP_RSRC_DPL ON ACT_APP_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_APP_APPDEF (ID_ varchar(255) NOT NULL, REV_ int NOT NULL, NAME_ varchar(255), KEY_ varchar(255) NOT NULL, VERSION_ int NOT NULL, CATEGORY_ varchar(255), DEPLOYMENT_ID_ varchar(255), RESOURCE_NAME_ varchar(4000), DESCRIPTION_ varchar(4000), TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_APP_APPDEF_TENANT_ID_ DEFAULT '', CONSTRAINT PK_ACT_APP_APPDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_APPDEF ADD CONSTRAINT ACT_FK_APP_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_); + +CREATE UNIQUE NONCLUSTERED INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_); + +insert into ACT_GE_PROPERTY +values ('app.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.mysql.create.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.mysql.create.app.sql new file mode 100644 index 00000000000..008baf25d54 --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.mysql.create.app.sql @@ -0,0 +1,20 @@ +CREATE TABLE ACT_APP_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NULL, CATEGORY_ VARCHAR(255) NULL, KEY_ VARCHAR(255) NULL, DEPLOY_TIME_ datetime NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_APP_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_APP_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NULL, DEPLOYMENT_ID_ VARCHAR(255) NULL, RESOURCE_BYTES_ LONGBLOB NULL, CONSTRAINT PK_APP_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_APP_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_RSRC_DPL ON ACT_APP_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_APP_APPDEF (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NULL, KEY_ VARCHAR(255) NOT NULL, VERSION_ INT NOT NULL, CATEGORY_ VARCHAR(255) NULL, DEPLOYMENT_ID_ VARCHAR(255) NULL, RESOURCE_NAME_ VARCHAR(4000) NULL, DESCRIPTION_ VARCHAR(4000) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_APP_APPDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_APPDEF ADD CONSTRAINT ACT_FK_APP_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_); + +ALTER TABLE ACT_APP_DEPLOYMENT MODIFY DEPLOY_TIME_ datetime(3); + +CREATE UNIQUE INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_); + +insert into ACT_GE_PROPERTY +values ('app.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.oracle.create.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.oracle.create.app.sql new file mode 100644 index 00000000000..f6ff143894c --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.oracle.create.app.sql @@ -0,0 +1,18 @@ +CREATE TABLE ACT_APP_DEPLOYMENT (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255), CATEGORY_ VARCHAR2(255), KEY_ VARCHAR2(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_APP_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_APP_DEPLOYMENT_RESOURCE (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255), DEPLOYMENT_ID_ VARCHAR2(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_APP_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_APP_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_RSRC_DPL ON ACT_APP_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_APP_APPDEF (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR2(255), KEY_ VARCHAR2(255) NOT NULL, VERSION_ INTEGER NOT NULL, CATEGORY_ VARCHAR2(255), DEPLOYMENT_ID_ VARCHAR2(255), RESOURCE_NAME_ VARCHAR2(4000), DESCRIPTION_ VARCHAR2(4000), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_APP_APPDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_APPDEF ADD CONSTRAINT ACT_FK_APP_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_); + +CREATE UNIQUE INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_); + +insert into ACT_GE_PROPERTY +values ('app.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.postgres.create.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.postgres.create.app.sql new file mode 100644 index 00000000000..c591e253c20 --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/create/flowable.postgres.create.app.sql @@ -0,0 +1,18 @@ +CREATE TABLE ACT_APP_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), KEY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP WITHOUT TIME ZONE, TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT "ACT_APP_DEPLOYMENT_pkey" PRIMARY KEY (ID_)); + +CREATE TABLE ACT_APP_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BYTEA, CONSTRAINT PK_APP_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_APP_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_RSRC_DPL ON ACT_APP_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_APP_APPDEF (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ INTEGER NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT "ACT_APP_APPDEF_pkey" PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_APPDEF ADD CONSTRAINT ACT_FK_APP_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_); + +CREATE UNIQUE INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_); + +insert into ACT_GE_PROPERTY +values ('app.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/liquibase/flowable-app-db-changelog.xml b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/liquibase/flowable-app-db-changelog.xml deleted file mode 100644 index ded278eceea..00000000000 --- a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/liquibase/flowable-app-db-changelog.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.all.upgradestep.7100.to.7101.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.all.upgradestep.7100.to.7101.app.sql new file mode 100644 index 00000000000..e06fb9c6585 --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.all.upgradestep.7100.to.7101.app.sql @@ -0,0 +1,5 @@ +insert into ACT_GE_PROPERTY +values ('app.schema.version', '7.1.0.1', 1); + +drop table ACT_APP_DATABASECHANGELOG; +drop table ACT_APP_DATABASECHANGELOGLOCK; diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.db2.upgradestep.6301.to.6310.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.db2.upgradestep.6301.to.6310.app.sql new file mode 100644 index 00000000000..37c2141e0d1 --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.db2.upgradestep.6301.to.6310.app.sql @@ -0,0 +1,13 @@ +CREATE TABLE ACT_APP_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), KEY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_APP_DEPLOY PRIMARY KEY (ID_)); + +CREATE TABLE ACT_APP_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_APP_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_APP_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_RSRC_DPL ON ACT_APP_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_APP_APPDEF (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ INTEGER NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_APP_APPDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_APPDEF ADD CONSTRAINT ACT_FK_APP_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.db2.upgradestep.6412.to.6413.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.db2.upgradestep.6412.to.6413.app.sql new file mode 100644 index 00000000000..7e274a76f87 --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.db2.upgradestep.6412.to.6413.app.sql @@ -0,0 +1 @@ +CREATE UNIQUE INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.h2.upgradestep.6301.to.6310.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.h2.upgradestep.6301.to.6310.app.sql new file mode 100644 index 00000000000..44b1cc1dd2a --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.h2.upgradestep.6301.to.6310.app.sql @@ -0,0 +1,13 @@ +CREATE TABLE ACT_APP_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), KEY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_APP_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_APP_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_APP_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_APP_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_RSRC_DPL ON ACT_APP_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_APP_APPDEF (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ INT NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_APP_APPDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_APPDEF ADD CONSTRAINT ACT_FK_APP_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.h2.upgradestep.6412.to.6413.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.h2.upgradestep.6412.to.6413.app.sql new file mode 100644 index 00000000000..7e274a76f87 --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.h2.upgradestep.6412.to.6413.app.sql @@ -0,0 +1 @@ +CREATE UNIQUE INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.mssql.upgradestep.6301.to.6310.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.mssql.upgradestep.6301.to.6310.app.sql new file mode 100644 index 00000000000..60c3d9abe81 --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.mssql.upgradestep.6301.to.6310.app.sql @@ -0,0 +1,13 @@ +CREATE TABLE ACT_APP_DEPLOYMENT (ID_ varchar(255) NOT NULL, NAME_ varchar(255), CATEGORY_ varchar(255), KEY_ varchar(255), DEPLOY_TIME_ datetime, TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_APP_DEPLOYMENT_TENANT_ID_ DEFAULT '', CONSTRAINT PK_ACT_APP_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_APP_DEPLOYMENT_RESOURCE (ID_ varchar(255) NOT NULL, NAME_ varchar(255), DEPLOYMENT_ID_ varchar(255), RESOURCE_BYTES_ varbinary(MAX), CONSTRAINT PK_APP_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_APP_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_APP_RSRC_DPL ON ACT_APP_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_APP_APPDEF (ID_ varchar(255) NOT NULL, REV_ int NOT NULL, NAME_ varchar(255), KEY_ varchar(255) NOT NULL, VERSION_ int NOT NULL, CATEGORY_ varchar(255), DEPLOYMENT_ID_ varchar(255), RESOURCE_NAME_ varchar(4000), DESCRIPTION_ varchar(4000), TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_APP_APPDEF_TENANT_ID_ DEFAULT '', CONSTRAINT PK_ACT_APP_APPDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_APPDEF ADD CONSTRAINT ACT_FK_APP_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.mssql.upgradestep.6412.to.6413.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.mssql.upgradestep.6412.to.6413.app.sql new file mode 100644 index 00000000000..4528bad72fc --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.mssql.upgradestep.6412.to.6413.app.sql @@ -0,0 +1 @@ +CREATE UNIQUE NONCLUSTERED INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.mysql.upgradestep.6301.to.6310.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.mysql.upgradestep.6301.to.6310.app.sql new file mode 100644 index 00000000000..4a271e06f98 --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.mysql.upgradestep.6301.to.6310.app.sql @@ -0,0 +1,13 @@ +CREATE TABLE ACT_APP_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NULL, CATEGORY_ VARCHAR(255) NULL, KEY_ VARCHAR(255) NULL, DEPLOY_TIME_ datetime NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_APP_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_APP_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NULL, DEPLOYMENT_ID_ VARCHAR(255) NULL, RESOURCE_BYTES_ LONGBLOB NULL, CONSTRAINT PK_APP_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_APP_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_RSRC_DPL ON ACT_APP_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_APP_APPDEF (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NULL, KEY_ VARCHAR(255) NOT NULL, VERSION_ INT NOT NULL, CATEGORY_ VARCHAR(255) NULL, DEPLOYMENT_ID_ VARCHAR(255) NULL, RESOURCE_NAME_ VARCHAR(4000) NULL, DESCRIPTION_ VARCHAR(4000) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_APP_APPDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_APPDEF ADD CONSTRAINT ACT_FK_APP_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.mysql.upgradestep.6320.to.6400.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.mysql.upgradestep.6320.to.6400.app.sql new file mode 100644 index 00000000000..12c23a4c5bb --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.mysql.upgradestep.6320.to.6400.app.sql @@ -0,0 +1 @@ +ALTER TABLE ACT_APP_DEPLOYMENT MODIFY DEPLOY_TIME_ datetime(3); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.mysql.upgradestep.6412.to.6413.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.mysql.upgradestep.6412.to.6413.app.sql new file mode 100644 index 00000000000..7e274a76f87 --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.mysql.upgradestep.6412.to.6413.app.sql @@ -0,0 +1 @@ +CREATE UNIQUE INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.oracle.upgradestep.6301.to.6310.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.oracle.upgradestep.6301.to.6310.app.sql new file mode 100644 index 00000000000..fce61aec53b --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.oracle.upgradestep.6301.to.6310.app.sql @@ -0,0 +1,13 @@ +CREATE TABLE ACT_APP_DEPLOYMENT (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255), CATEGORY_ VARCHAR2(255), KEY_ VARCHAR2(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_APP_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_APP_DEPLOYMENT_RESOURCE (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255), DEPLOYMENT_ID_ VARCHAR2(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_APP_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_APP_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_RSRC_DPL ON ACT_APP_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_APP_APPDEF (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR2(255), KEY_ VARCHAR2(255) NOT NULL, VERSION_ INTEGER NOT NULL, CATEGORY_ VARCHAR2(255), DEPLOYMENT_ID_ VARCHAR2(255), RESOURCE_NAME_ VARCHAR2(4000), DESCRIPTION_ VARCHAR2(4000), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_APP_APPDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_APPDEF ADD CONSTRAINT ACT_FK_APP_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.oracle.upgradestep.6412.to.6413.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.oracle.upgradestep.6412.to.6413.app.sql new file mode 100644 index 00000000000..7e274a76f87 --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.oracle.upgradestep.6412.to.6413.app.sql @@ -0,0 +1 @@ +CREATE UNIQUE INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.postgres.upgradestep.6301.to.6310.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.postgres.upgradestep.6301.to.6310.app.sql new file mode 100644 index 00000000000..6b5f6f3854d --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.postgres.upgradestep.6301.to.6310.app.sql @@ -0,0 +1,13 @@ +CREATE TABLE ACT_APP_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), KEY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP WITHOUT TIME ZONE, TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT "ACT_APP_DEPLOYMENT_pkey" PRIMARY KEY (ID_)); + +CREATE TABLE ACT_APP_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BYTEA, CONSTRAINT PK_APP_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_APP_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_RSRC_DPL ON ACT_APP_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_APP_APPDEF (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ INTEGER NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT "ACT_APP_APPDEF_pkey" PRIMARY KEY (ID_)); + +ALTER TABLE ACT_APP_APPDEF ADD CONSTRAINT ACT_FK_APP_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_APP_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_); diff --git a/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.postgres.upgradestep.6412.to.6413.app.sql b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.postgres.upgradestep.6412.to.6413.app.sql new file mode 100644 index 00000000000..7e274a76f87 --- /dev/null +++ b/modules/flowable-app-engine/src/main/resources/org/flowable/app/db/upgrade/flowable.postgres.upgradestep.6412.to.6413.app.sql @@ -0,0 +1 @@ +CREATE UNIQUE INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_); diff --git a/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationTest.java b/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationTest.java index 4a192f4444a..b505890bbc7 100644 --- a/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationTest.java +++ b/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationTest.java @@ -57,7 +57,6 @@ public void contextShouldLoadPropertiesInACorrectOrder() { "class path resource [engine.properties]", "Config resource 'class path resource [application.properties]' via location 'optional:classpath:/'", "flowableDefaultConfig: [classpath:/flowable-default.properties]", - "flowable-liquibase-override", "Management Server" ); diff --git a/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationWithEnabledJmsKafkaAndRabbitTest.java b/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationWithEnabledJmsKafkaAndRabbitTest.java index 0887ced4261..4ad4e0b0e28 100644 --- a/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationWithEnabledJmsKafkaAndRabbitTest.java +++ b/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationWithEnabledJmsKafkaAndRabbitTest.java @@ -62,7 +62,6 @@ public void contextShouldLoad() { "class path resource [engine.properties]", "Config resource 'class path resource [application.properties]' via location 'optional:classpath:/'", "flowableDefaultConfig: [classpath:/flowable-default.properties]", - "flowable-liquibase-override", "Management Server" ); diff --git a/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationWithEnabledJmsTest.java b/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationWithEnabledJmsTest.java index 6d36542a3db..df08201532c 100644 --- a/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationWithEnabledJmsTest.java +++ b/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationWithEnabledJmsTest.java @@ -58,7 +58,6 @@ public void contextShouldLoad() { "class path resource [engine.properties]", "Config resource 'class path resource [application.properties]' via location 'optional:classpath:/'", "flowableDefaultConfig: [classpath:/flowable-default.properties]", - "flowable-liquibase-override", "Management Server" ); diff --git a/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationWithEnabledKafkaTest.java b/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationWithEnabledKafkaTest.java index ccea1c1e8d3..ae042e40c5c 100644 --- a/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationWithEnabledKafkaTest.java +++ b/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationWithEnabledKafkaTest.java @@ -58,7 +58,6 @@ public void contextShouldLoad() { "class path resource [engine.properties]", "Config resource 'class path resource [application.properties]' via location 'optional:classpath:/'", "flowableDefaultConfig: [classpath:/flowable-default.properties]", - "flowable-liquibase-override", "Management Server" ); diff --git a/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationWithEnabledRabbitTest.java b/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationWithEnabledRabbitTest.java index 92450d97a8f..bd8df236b27 100644 --- a/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationWithEnabledRabbitTest.java +++ b/modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationWithEnabledRabbitTest.java @@ -58,7 +58,6 @@ public void contextShouldLoad() { "class path resource [engine.properties]", "Config resource 'class path resource [application.properties]' via location 'optional:classpath:/'", "flowableDefaultConfig: [classpath:/flowable-default.properties]", - "flowable-liquibase-override", "Management Server" ); diff --git a/modules/flowable-batch-service/src/main/java/org/flowable/batch/service/impl/db/BatchDbSchemaManager.java b/modules/flowable-batch-service/src/main/java/org/flowable/batch/service/impl/db/BatchDbSchemaManager.java deleted file mode 100644 index 06a3195afca..00000000000 --- a/modules/flowable-batch-service/src/main/java/org/flowable/batch/service/impl/db/BatchDbSchemaManager.java +++ /dev/null @@ -1,35 +0,0 @@ -/* Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.flowable.batch.service.impl.db; - -import org.flowable.common.engine.impl.db.ServiceSqlScriptBasedDbSchemaManager; - -/** - * @author Tijs Rademakers - */ -public class BatchDbSchemaManager extends ServiceSqlScriptBasedDbSchemaManager { - - private static final String TABLE = "FLW_RU_BATCH"; - private static final String VERSION_PROPERTY = "batch.schema.version"; - private static final String SCHEMA_COMPONENT = "batch"; - - public BatchDbSchemaManager() { - super(TABLE, SCHEMA_COMPONENT, null, VERSION_PROPERTY); - } - - @Override - protected String getResourcesRootDirectory() { - return "org/flowable/batch/service/db/"; - } - -} diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.cockroachdb.create.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.cockroachdb.create.batch.sql deleted file mode 100644 index bd0be2a75c8..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.cockroachdb.create.batch.sql +++ /dev/null @@ -1,42 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ varchar(64) not null, - REV_ integer, - TYPE_ varchar(64) not null, - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - BATCH_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create table FLW_RU_BATCH_PART ( - ID_ varchar(64) not null, - REV_ integer, - BATCH_ID_ varchar(64), - TYPE_ varchar(64) not null, - SCOPE_ID_ varchar(64), - SUB_SCOPE_ID_ varchar(64), - SCOPE_TYPE_ varchar(64), - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - RESULT_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '7.1.0.0', 1); - --- force-commit \ No newline at end of file diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.db2.create.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.db2.create.batch.sql deleted file mode 100644 index 9dd57b7d73f..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.db2.create.batch.sql +++ /dev/null @@ -1,40 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ varchar(64) not null, - REV_ integer, - TYPE_ varchar(64) not null, - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - BATCH_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create table FLW_RU_BATCH_PART ( - ID_ varchar(64) not null, - REV_ integer, - BATCH_ID_ varchar(64), - TYPE_ varchar(64) not null, - SCOPE_ID_ varchar(64), - SUB_SCOPE_ID_ varchar(64), - SCOPE_TYPE_ varchar(64), - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - RESULT_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '7.1.0.0', 1); diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.h2.create.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.h2.create.batch.sql deleted file mode 100644 index 9dd57b7d73f..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.h2.create.batch.sql +++ /dev/null @@ -1,40 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ varchar(64) not null, - REV_ integer, - TYPE_ varchar(64) not null, - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - BATCH_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create table FLW_RU_BATCH_PART ( - ID_ varchar(64) not null, - REV_ integer, - BATCH_ID_ varchar(64), - TYPE_ varchar(64) not null, - SCOPE_ID_ varchar(64), - SUB_SCOPE_ID_ varchar(64), - SCOPE_TYPE_ varchar(64), - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - RESULT_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '7.1.0.0', 1); diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.hsql.create.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.hsql.create.batch.sql deleted file mode 100644 index 9dd57b7d73f..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.hsql.create.batch.sql +++ /dev/null @@ -1,40 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ varchar(64) not null, - REV_ integer, - TYPE_ varchar(64) not null, - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - BATCH_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create table FLW_RU_BATCH_PART ( - ID_ varchar(64) not null, - REV_ integer, - BATCH_ID_ varchar(64), - TYPE_ varchar(64) not null, - SCOPE_ID_ varchar(64), - SUB_SCOPE_ID_ varchar(64), - SCOPE_TYPE_ varchar(64), - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - RESULT_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '7.1.0.0', 1); diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.mssql.create.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.mssql.create.batch.sql deleted file mode 100644 index c17d50cab44..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.mssql.create.batch.sql +++ /dev/null @@ -1,40 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ nvarchar(64) not null, - REV_ int, - TYPE_ nvarchar(64) not null, - SEARCH_KEY_ nvarchar(255), - SEARCH_KEY2_ nvarchar(255), - CREATE_TIME_ datetime not null, - COMPLETE_TIME_ datetime, - STATUS_ nvarchar(255), - BATCH_DOC_ID_ nvarchar(64), - TENANT_ID_ nvarchar(255) default '', - primary key (ID_) -); - -create table FLW_RU_BATCH_PART ( - ID_ nvarchar(64) not null, - REV_ int, - BATCH_ID_ nvarchar(64), - TYPE_ nvarchar(64) not null, - SCOPE_ID_ nvarchar(64), - SUB_SCOPE_ID_ nvarchar(64), - SCOPE_TYPE_ nvarchar(64), - SEARCH_KEY_ nvarchar(255), - SEARCH_KEY2_ nvarchar(255), - CREATE_TIME_ datetime not null, - COMPLETE_TIME_ datetime, - STATUS_ nvarchar(255), - RESULT_DOC_ID_ nvarchar(64), - TENANT_ID_ nvarchar(255) default '', - primary key (ID_) -); - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '7.1.0.0', 1); diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.mysql.create.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.mysql.create.batch.sql deleted file mode 100644 index d0d65d77073..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.mysql.create.batch.sql +++ /dev/null @@ -1,40 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ varchar(64) not null, - REV_ integer, - TYPE_ varchar(64) not null, - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ datetime(3) not null, - COMPLETE_TIME_ datetime(3), - STATUS_ varchar(255), - BATCH_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; - -create table FLW_RU_BATCH_PART ( - ID_ varchar(64) not null, - REV_ integer, - BATCH_ID_ varchar(64), - TYPE_ varchar(64) not null, - SCOPE_ID_ varchar(64), - SUB_SCOPE_ID_ varchar(64), - SCOPE_TYPE_ varchar(64), - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ datetime(3) not null, - COMPLETE_TIME_ datetime(3), - STATUS_ varchar(255), - RESULT_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '7.1.0.0', 1); diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.mysql55.create.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.mysql55.create.batch.sql deleted file mode 100644 index 82104a0e750..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.mysql55.create.batch.sql +++ /dev/null @@ -1,40 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ varchar(64) not null, - REV_ integer, - TYPE_ varchar(64) not null, - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ datetime not null, - COMPLETE_TIME_ datetime, - STATUS_ varchar(255), - BATCH_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; - -create table FLW_RU_BATCH_PART ( - ID_ varchar(64) not null, - REV_ integer, - BATCH_ID_ varchar(64), - TYPE_ varchar(64) not null, - SCOPE_ID_ varchar(64), - SUB_SCOPE_ID_ varchar(64), - SCOPE_TYPE_ varchar(64), - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ datetime not null, - COMPLETE_TIME_ datetime, - STATUS_ varchar(255), - RESULT_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '7.1.0.0', 1); diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.oracle.create.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.oracle.create.batch.sql deleted file mode 100644 index 61979b31580..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.oracle.create.batch.sql +++ /dev/null @@ -1,40 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ NVARCHAR2(64) not null, - REV_ INTEGER, - TYPE_ NVARCHAR2(64) not null, - SEARCH_KEY_ NVARCHAR2(255), - SEARCH_KEY2_ NVARCHAR2(255), - CREATE_TIME_ TIMESTAMP(6) not null, - COMPLETE_TIME_ TIMESTAMP(6), - STATUS_ NVARCHAR2(255), - BATCH_DOC_ID_ NVARCHAR2(64), - TENANT_ID_ NVARCHAR2(255) default '', - primary key (ID_) -); - -create table FLW_RU_BATCH_PART ( - ID_ NVARCHAR2(64) not null, - REV_ INTEGER, - BATCH_ID_ NVARCHAR2(64), - TYPE_ NVARCHAR2(64) not null, - SCOPE_ID_ NVARCHAR2(64), - SUB_SCOPE_ID_ NVARCHAR2(64), - SCOPE_TYPE_ NVARCHAR2(64), - SEARCH_KEY_ NVARCHAR2(255), - SEARCH_KEY2_ NVARCHAR2(255), - CREATE_TIME_ TIMESTAMP(6) not null, - COMPLETE_TIME_ TIMESTAMP(6), - STATUS_ NVARCHAR2(255), - RESULT_DOC_ID_ NVARCHAR2(64), - TENANT_ID_ NVARCHAR2(255) default '', - primary key (ID_) -); - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '7.1.0.0', 1); diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.postgres.create.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.postgres.create.batch.sql deleted file mode 100644 index 9dd57b7d73f..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/create/flowable.postgres.create.batch.sql +++ /dev/null @@ -1,40 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ varchar(64) not null, - REV_ integer, - TYPE_ varchar(64) not null, - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - BATCH_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create table FLW_RU_BATCH_PART ( - ID_ varchar(64) not null, - REV_ integer, - BATCH_ID_ varchar(64), - TYPE_ varchar(64) not null, - SCOPE_ID_ varchar(64), - SUB_SCOPE_ID_ varchar(64), - SCOPE_TYPE_ varchar(64), - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - RESULT_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '7.1.0.0', 1); diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.cockroachdb.drop.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.cockroachdb.drop.batch.sql deleted file mode 100644 index 7ef35633e9e..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.cockroachdb.drop.batch.sql +++ /dev/null @@ -1,4 +0,0 @@ -drop table if exists flw_ru_batch_part cascade; -drop table if exists flw_ru_batch cascade; - --- force-commit \ No newline at end of file diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.db2.drop.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.db2.drop.batch.sql deleted file mode 100644 index 52f5777152f..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.db2.drop.batch.sql +++ /dev/null @@ -1,4 +0,0 @@ -drop index FLW_IDX_BATCH_PART; - -drop table FLW_RU_BATCH_PART; -drop table FLW_RU_BATCH; \ No newline at end of file diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.h2.drop.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.h2.drop.batch.sql deleted file mode 100644 index 10c7f7a32a5..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.h2.drop.batch.sql +++ /dev/null @@ -1,4 +0,0 @@ -drop table if exists FLW_RU_BATCH_PART cascade constraints; -drop table if exists FLW_RU_BATCH cascade constraints; - -drop index if exists FLW_IDX_BATCH_PART; \ No newline at end of file diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.hsql.drop.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.hsql.drop.batch.sql deleted file mode 100644 index 10c7f7a32a5..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.hsql.drop.batch.sql +++ /dev/null @@ -1,4 +0,0 @@ -drop table if exists FLW_RU_BATCH_PART cascade constraints; -drop table if exists FLW_RU_BATCH cascade constraints; - -drop index if exists FLW_IDX_BATCH_PART; \ No newline at end of file diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.mssql.drop.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.mssql.drop.batch.sql deleted file mode 100644 index ff0d60881df..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.mssql.drop.batch.sql +++ /dev/null @@ -1,4 +0,0 @@ -IF EXISTS (SELECT name FROM sysindexes WHERE name = 'FLW_IDX_BATCH_PART') drop index FLW_RU_BATCH_PART.FLW_IDX_BATCH_PART; - -if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'FLW_RU_BATCH_PART') drop table FLW_RU_BATCH_PART; -if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'FLW_RU_BATCH') drop table FLW_RU_BATCH; \ No newline at end of file diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.mysql.drop.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.mysql.drop.batch.sql deleted file mode 100644 index 14e8e22dcdf..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.mysql.drop.batch.sql +++ /dev/null @@ -1,4 +0,0 @@ -drop index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART; - -drop table if exists FLW_RU_BATCH_PART; -drop table if exists FLW_RU_BATCH; \ No newline at end of file diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.oracle.drop.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.oracle.drop.batch.sql deleted file mode 100644 index 52f5777152f..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.oracle.drop.batch.sql +++ /dev/null @@ -1,4 +0,0 @@ -drop index FLW_IDX_BATCH_PART; - -drop table FLW_RU_BATCH_PART; -drop table FLW_RU_BATCH; \ No newline at end of file diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.postgres.drop.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.postgres.drop.batch.sql deleted file mode 100644 index 9424b70e474..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/drop/flowable.postgres.drop.batch.sql +++ /dev/null @@ -1,2 +0,0 @@ -drop table if exists FLW_RU_BATCH_PART cascade; -drop table if exists FLW_RU_BATCH cascade; \ No newline at end of file diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6502.to.6503.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6502.to.6503.batch.sql deleted file mode 100644 index 6d3a49c7647..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6502.to.6503.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.5.0.3' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6503.to.6504.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6503.to.6504.batch.sql deleted file mode 100644 index 9a5b3dfb074..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6503.to.6504.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.5.0.4' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6504.to.6505.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6504.to.6505.batch.sql deleted file mode 100644 index 0e5e73ea1ad..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6504.to.6505.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.5.0.5' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6505.to.6506.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6505.to.6506.batch.sql deleted file mode 100644 index 97d69d430ca..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6505.to.6506.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.5.0.6' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6506.to.6510.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6506.to.6510.batch.sql deleted file mode 100644 index 076c40d9dfe..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6506.to.6510.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.5.1.0' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6510.to.6511.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6510.to.6511.batch.sql deleted file mode 100644 index 341d24ddd41..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6510.to.6511.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.5.1.1' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6511.to.6512.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6511.to.6512.batch.sql deleted file mode 100644 index 09aa935d50f..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6511.to.6512.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.5.1.2' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6512.to.6513.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6512.to.6513.batch.sql deleted file mode 100644 index dd41663c4fe..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6512.to.6513.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.5.1.3' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6513.to.6514.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6513.to.6514.batch.sql deleted file mode 100644 index cdb07c37d8f..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6513.to.6514.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.5.1.4' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6514.to.6515.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6514.to.6515.batch.sql deleted file mode 100644 index 504719191fc..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6514.to.6515.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.5.1.5' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6515.to.6516.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6515.to.6516.batch.sql deleted file mode 100644 index c2346637fda..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6515.to.6516.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.5.1.6' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6516.to.6600.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6516.to.6600.batch.sql deleted file mode 100644 index 837e02088d0..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6516.to.6600.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.6.0.0' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6600.to.6601.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6600.to.6601.batch.sql deleted file mode 100644 index da8fde93de4..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6600.to.6601.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.6.0.1' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6601.to.6610.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6601.to.6610.batch.sql deleted file mode 100644 index 4e00e00bee5..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6601.to.6610.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.6.1.0' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6610.to.6620.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6610.to.6620.batch.sql deleted file mode 100644 index 7a8365a802f..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6610.to.6620.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.6.2.0' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6620.to.6621.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6620.to.6621.batch.sql deleted file mode 100644 index b9cdb2becc3..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6620.to.6621.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.6.2.1' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6621.to.6700.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6621.to.6700.batch.sql deleted file mode 100644 index 3f815e8f5d1..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6621.to.6700.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.7.0.0' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6700.to.6701.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6700.to.6701.batch.sql deleted file mode 100644 index d4e6b3e2090..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6700.to.6701.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.7.0.1' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6701.to.6710.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6701.to.6710.batch.sql deleted file mode 100644 index 0de68c02e2a..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6701.to.6710.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.7.1.0' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6710.to.6720.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6710.to.6720.batch.sql deleted file mode 100644 index f17787f4654..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6710.to.6720.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.7.2.0' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6720.to.6721.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6720.to.6721.batch.sql deleted file mode 100644 index 5f515678da5..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6720.to.6721.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.7.2.1' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6721.to.6722.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6721.to.6722.batch.sql deleted file mode 100644 index 705d49909e8..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6721.to.6722.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.7.2.2' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6722.to.6723.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6722.to.6723.batch.sql deleted file mode 100644 index 2453667ba45..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6722.to.6723.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.7.2.3' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6723.to.6800.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6723.to.6800.batch.sql deleted file mode 100644 index ae11356130b..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6723.to.6800.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.8.0.0' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6800.to.6810.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6800.to.6810.batch.sql deleted file mode 100644 index a1fb019cbd1..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6800.to.6810.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '6.8.1.0' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6810.to.7000.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6810.to.7000.batch.sql deleted file mode 100644 index cd69c861ba9..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.6810.to.7000.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '7.0.0.0' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.7000.to.7010.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.7000.to.7010.batch.sql deleted file mode 100644 index 4aed409f55b..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.7000.to.7010.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '7.0.1.0' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.7010.to.7011.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.7010.to.7011.batch.sql deleted file mode 100644 index c5e88d32d92..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.7010.to.7011.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '7.0.1.1' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.7011.to.7100.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.7011.to.7100.batch.sql deleted file mode 100644 index f1581a24866..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.all.upgradestep.7011.to.7100.batch.sql +++ /dev/null @@ -1 +0,0 @@ -update ACT_GE_PROPERTY set VALUE_ = '7.1.0.0' where NAME_ = 'batch.schema.version'; diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.db2.upgradestep.6501.to.6502.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.db2.upgradestep.6501.to.6502.batch.sql deleted file mode 100644 index edaa99467f1..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.db2.upgradestep.6501.to.6502.batch.sql +++ /dev/null @@ -1,40 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ varchar(64) not null, - REV_ integer, - TYPE_ varchar(64) not null, - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - BATCH_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create table FLW_RU_BATCH_PART ( - ID_ varchar(64) not null, - REV_ integer, - BATCH_ID_ varchar(64), - TYPE_ varchar(64) not null, - SCOPE_ID_ varchar(64), - SUB_SCOPE_ID_ varchar(64), - SCOPE_TYPE_ varchar(64), - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - RESULT_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '6.5.0.2', 1); diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.h2.upgradestep.6501.to.6502.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.h2.upgradestep.6501.to.6502.batch.sql deleted file mode 100644 index edaa99467f1..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.h2.upgradestep.6501.to.6502.batch.sql +++ /dev/null @@ -1,40 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ varchar(64) not null, - REV_ integer, - TYPE_ varchar(64) not null, - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - BATCH_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create table FLW_RU_BATCH_PART ( - ID_ varchar(64) not null, - REV_ integer, - BATCH_ID_ varchar(64), - TYPE_ varchar(64) not null, - SCOPE_ID_ varchar(64), - SUB_SCOPE_ID_ varchar(64), - SCOPE_TYPE_ varchar(64), - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - RESULT_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '6.5.0.2', 1); diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.hsql.upgradestep.6501.to.6502.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.hsql.upgradestep.6501.to.6502.batch.sql deleted file mode 100644 index edaa99467f1..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.hsql.upgradestep.6501.to.6502.batch.sql +++ /dev/null @@ -1,40 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ varchar(64) not null, - REV_ integer, - TYPE_ varchar(64) not null, - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - BATCH_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create table FLW_RU_BATCH_PART ( - ID_ varchar(64) not null, - REV_ integer, - BATCH_ID_ varchar(64), - TYPE_ varchar(64) not null, - SCOPE_ID_ varchar(64), - SUB_SCOPE_ID_ varchar(64), - SCOPE_TYPE_ varchar(64), - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - RESULT_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '6.5.0.2', 1); diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.mssql.upgradestep.6501.to.6502.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.mssql.upgradestep.6501.to.6502.batch.sql deleted file mode 100644 index 262e50e817a..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.mssql.upgradestep.6501.to.6502.batch.sql +++ /dev/null @@ -1,40 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ nvarchar(64) not null, - REV_ int, - TYPE_ nvarchar(64) not null, - SEARCH_KEY_ nvarchar(255), - SEARCH_KEY2_ nvarchar(255), - CREATE_TIME_ datetime not null, - COMPLETE_TIME_ datetime, - STATUS_ nvarchar(255), - BATCH_DOC_ID_ nvarchar(64), - TENANT_ID_ nvarchar(255) default '', - primary key (ID_) -); - -create table FLW_RU_BATCH_PART ( - ID_ nvarchar(64) not null, - REV_ int, - BATCH_ID_ nvarchar(64), - TYPE_ nvarchar(64) not null, - SCOPE_ID_ nvarchar(64), - SUB_SCOPE_ID_ nvarchar(64), - SCOPE_TYPE_ nvarchar(64), - SEARCH_KEY_ nvarchar(255), - SEARCH_KEY2_ nvarchar(255), - CREATE_TIME_ datetime not null, - COMPLETE_TIME_ datetime, - STATUS_ nvarchar(255), - RESULT_DOC_ID_ nvarchar(64), - TENANT_ID_ nvarchar(255) default '', - primary key (ID_) -); - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '6.5.0.2', 1); diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.mysql.upgradestep.6501.to.6502.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.mysql.upgradestep.6501.to.6502.batch.sql deleted file mode 100644 index afa523a0789..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.mysql.upgradestep.6501.to.6502.batch.sql +++ /dev/null @@ -1,40 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ varchar(64) not null, - REV_ integer, - TYPE_ varchar(64) not null, - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ datetime(3) not null, - COMPLETE_TIME_ datetime(3), - STATUS_ varchar(255), - BATCH_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; - -create table FLW_RU_BATCH_PART ( - ID_ varchar(64) not null, - REV_ integer, - BATCH_ID_ varchar(64), - TYPE_ varchar(64) not null, - SCOPE_ID_ varchar(64), - SUB_SCOPE_ID_ varchar(64), - SCOPE_TYPE_ varchar(64), - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ datetime(3) not null, - COMPLETE_TIME_ datetime(3), - STATUS_ varchar(255), - RESULT_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '6.5.0.2', 1); diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.mysql55.upgradestep.6501.to.6502.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.mysql55.upgradestep.6501.to.6502.batch.sql deleted file mode 100644 index 4505546588e..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.mysql55.upgradestep.6501.to.6502.batch.sql +++ /dev/null @@ -1,40 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ varchar(64) not null, - REV_ integer, - TYPE_ varchar(64) not null, - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ datetime not null, - COMPLETE_TIME_ datetime, - STATUS_ varchar(255), - BATCH_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; - -create table FLW_RU_BATCH_PART ( - ID_ varchar(64) not null, - REV_ integer, - BATCH_ID_ varchar(64), - TYPE_ varchar(64) not null, - SCOPE_ID_ varchar(64), - SUB_SCOPE_ID_ varchar(64), - SCOPE_TYPE_ varchar(64), - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ datetime not null, - COMPLETE_TIME_ datetime, - STATUS_ varchar(255), - RESULT_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '6.5.0.2', 1); diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.oracle.upgradestep.6501.to.6502.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.oracle.upgradestep.6501.to.6502.batch.sql deleted file mode 100644 index 816e585b847..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.oracle.upgradestep.6501.to.6502.batch.sql +++ /dev/null @@ -1,40 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ NVARCHAR2(64) not null, - REV_ INTEGER, - TYPE_ NVARCHAR2(64) not null, - SEARCH_KEY_ NVARCHAR2(255), - SEARCH_KEY2_ NVARCHAR2(255), - CREATE_TIME_ TIMESTAMP(6) not null, - COMPLETE_TIME_ TIMESTAMP(6), - STATUS_ NVARCHAR2(255), - BATCH_DOC_ID_ NVARCHAR2(64), - TENANT_ID_ NVARCHAR2(255) default '', - primary key (ID_) -); - -create table FLW_RU_BATCH_PART ( - ID_ NVARCHAR2(64) not null, - REV_ INTEGER, - BATCH_ID_ NVARCHAR2(64), - TYPE_ NVARCHAR2(64) not null, - SCOPE_ID_ NVARCHAR2(64), - SUB_SCOPE_ID_ NVARCHAR2(64), - SCOPE_TYPE_ NVARCHAR2(64), - SEARCH_KEY_ NVARCHAR2(255), - SEARCH_KEY2_ NVARCHAR2(255), - CREATE_TIME_ TIMESTAMP(6) not null, - COMPLETE_TIME_ TIMESTAMP(6), - STATUS_ NVARCHAR2(255), - RESULT_DOC_ID_ NVARCHAR2(64), - TENANT_ID_ NVARCHAR2(255) default '', - primary key (ID_) -); - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '6.5.0.2', 1); diff --git a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.postgres.upgradestep.6501.to.6502.batch.sql b/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.postgres.upgradestep.6501.to.6502.batch.sql deleted file mode 100644 index edaa99467f1..00000000000 --- a/modules/flowable-batch-service/src/main/resources/org/flowable/batch/service/db/upgrade/flowable.postgres.upgradestep.6501.to.6502.batch.sql +++ /dev/null @@ -1,40 +0,0 @@ -create table FLW_RU_BATCH ( - ID_ varchar(64) not null, - REV_ integer, - TYPE_ varchar(64) not null, - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - BATCH_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create table FLW_RU_BATCH_PART ( - ID_ varchar(64) not null, - REV_ integer, - BATCH_ID_ varchar(64), - TYPE_ varchar(64) not null, - SCOPE_ID_ varchar(64), - SUB_SCOPE_ID_ varchar(64), - SCOPE_TYPE_ varchar(64), - SEARCH_KEY_ varchar(255), - SEARCH_KEY2_ varchar(255), - CREATE_TIME_ timestamp not null, - COMPLETE_TIME_ timestamp, - STATUS_ varchar(255), - RESULT_DOC_ID_ varchar(64), - TENANT_ID_ varchar(255) default '', - primary key (ID_) -); - -create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); - -alter table FLW_RU_BATCH_PART - add constraint FLW_FK_BATCH_PART_PARENT - foreign key (BATCH_ID_) - references FLW_RU_BATCH (ID_); - -insert into ACT_GE_PROPERTY values ('batch.schema.version', '6.5.0.2', 1); diff --git a/modules/flowable-cmmn-api/src/main/java/org/flowable/cmmn/api/CmmnManagementService.java b/modules/flowable-cmmn-api/src/main/java/org/flowable/cmmn/api/CmmnManagementService.java index 00cf9ef98f5..2eadc362151 100644 --- a/modules/flowable-cmmn-api/src/main/java/org/flowable/cmmn/api/CmmnManagementService.java +++ b/modules/flowable-cmmn-api/src/main/java/org/flowable/cmmn/api/CmmnManagementService.java @@ -23,6 +23,7 @@ import org.flowable.batch.api.BatchQuery; import org.flowable.cmmn.api.runtime.CmmnExternalWorkerTransitionBuilder; import org.flowable.common.engine.api.FlowableObjectNotFoundException; +import org.flowable.common.engine.api.lock.LockManager; import org.flowable.common.engine.api.tenant.ChangeTenantIdBuilder; import org.flowable.job.api.DeadLetterJobQuery; import org.flowable.job.api.ExternalWorkerJobAcquireBuilder; @@ -424,4 +425,16 @@ public interface CmmnManagementService { * will be changed to the target tenant id. */ ChangeTenantIdBuilder createChangeTenantIdBuilder(String fromTenantId, String toTenantId); + + /** + * Acquire a lock manager for the requested lock. + * This is a stateless call, this means that every time a lock manager + * is requested a new one would be created. Make sure that you release the lock + * once you are done. + * + * @param lockName the name of the lock that is being requested + * + * @return the lock manager for the given lock + */ + LockManager getLockManager(String lockName); } diff --git a/modules/flowable-cmmn-engine-configurator/src/main/java/org/flowable/cmmn/engine/configurator/CmmnEngineConfigurator.java b/modules/flowable-cmmn-engine-configurator/src/main/java/org/flowable/cmmn/engine/configurator/CmmnEngineConfigurator.java index d20cebafa4c..e9f8c26c5e1 100644 --- a/modules/flowable-cmmn-engine-configurator/src/main/java/org/flowable/cmmn/engine/configurator/CmmnEngineConfigurator.java +++ b/modules/flowable-cmmn-engine-configurator/src/main/java/org/flowable/cmmn/engine/configurator/CmmnEngineConfigurator.java @@ -41,7 +41,7 @@ /** * @author Joram Barrez */ -public class CmmnEngineConfigurator extends AbstractEngineConfigurator { +public class CmmnEngineConfigurator extends AbstractEngineConfigurator { protected CmmnEngineConfiguration cmmnEngineConfiguration; @@ -89,9 +89,7 @@ public void configure(AbstractEngineConfiguration engineConfiguration) { } - cmmnEngineConfiguration.setExecuteServiceSchemaManagers(false); - - initCmmnEngine(); + initEngine(); if (processEngineConfiguration != null) { cmmnEngineConfiguration.getJobServiceConfiguration().getInternalJobManager() @@ -178,7 +176,8 @@ protected List> getEntityDeletionOrder() { return EntityDependencyOrder.DELETE_ORDER; } - protected synchronized CmmnEngine initCmmnEngine() { + @Override + protected CmmnEngine buildEngine() { if (cmmnEngineConfiguration == null) { throw new FlowableException("CmmnEngineConfiguration is required"); } diff --git a/modules/flowable-cmmn-engine-configurator/src/test/java/org/flowable/cmmn/test/DbSchemaDrop.java b/modules/flowable-cmmn-engine-configurator/src/test/java/org/flowable/cmmn/test/DbSchemaDrop.java index 4fbc90c6a5e..d60044bfd64 100644 --- a/modules/flowable-cmmn-engine-configurator/src/test/java/org/flowable/cmmn/test/DbSchemaDrop.java +++ b/modules/flowable-cmmn-engine-configurator/src/test/java/org/flowable/cmmn/test/DbSchemaDrop.java @@ -12,13 +12,11 @@ */ package org.flowable.cmmn.test; -import org.flowable.common.engine.impl.interceptor.Command; +import org.flowable.common.engine.impl.db.SchemaOperationsEngineDropDbCmd; import org.flowable.common.engine.impl.interceptor.CommandConfig; -import org.flowable.common.engine.impl.interceptor.CommandContext; import org.flowable.common.engine.impl.interceptor.CommandExecutor; import org.flowable.engine.ProcessEngines; import org.flowable.engine.impl.ProcessEngineImpl; -import org.flowable.engine.impl.util.CommandContextUtil; /** * @author Filip Hrisafov @@ -29,14 +27,7 @@ public static void main(String[] args) { ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine(); CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutor(); CommandConfig config = new CommandConfig().transactionNotSupported(); - commandExecutor.execute(config, new Command<>() { - @Override - public Object execute(CommandContext commandContext) { - CommandContextUtil.getProcessEngineConfiguration(commandContext).getSchemaManager().schemaDrop(); - org.flowable.cmmn.engine.impl.util.CommandContextUtil.getCmmnEngineConfiguration(commandContext).getSchemaManager().schemaDrop(); - return null; - } - }); + commandExecutor.execute(config, new SchemaOperationsEngineDropDbCmd(processEngine.getProcessEngineConfiguration().getEngineScopeType())); } } diff --git a/modules/flowable-cmmn-engine/pom.xml b/modules/flowable-cmmn-engine/pom.xml index 25f3148bbae..38c504810f7 100644 --- a/modules/flowable-cmmn-engine/pom.xml +++ b/modules/flowable-cmmn-engine/pom.xml @@ -103,10 +103,6 @@ org.flowable flowable-case-validation - - org.liquibase - liquibase-core - com.fasterxml.uuid java-uuid-generator @@ -216,6 +212,8 @@ org.flowable.cmmn.engine + org.flowable.cmmn.db.create, + org.flowable.cmmn.db.upgrade, org.flowable.cmmn.db.mapping.entity diff --git a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/CmmnEngineConfiguration.java b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/CmmnEngineConfiguration.java index 1700f48eb62..4733422fee3 100644 --- a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/CmmnEngineConfiguration.java +++ b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/CmmnEngineConfiguration.java @@ -24,6 +24,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; @@ -34,7 +35,6 @@ import org.apache.ibatis.session.Configuration; import org.apache.ibatis.type.JdbcType; import org.flowable.batch.service.BatchServiceConfiguration; -import org.flowable.batch.service.impl.db.BatchDbSchemaManager; import org.flowable.cmmn.api.CallbackTypes; import org.flowable.cmmn.api.CandidateManager; import org.flowable.cmmn.api.CmmnChangeTenantIdEntityTypes; @@ -53,6 +53,7 @@ import org.flowable.cmmn.api.listener.PlanItemInstanceLifecycleListener; import org.flowable.cmmn.api.migration.CaseInstanceMigrationCallback; import org.flowable.cmmn.engine.impl.CmmnEngineImpl; +import org.flowable.cmmn.engine.impl.CmmnEnginePostEngineBuildConsumer; import org.flowable.cmmn.engine.impl.CmmnHistoryServiceImpl; import org.flowable.cmmn.engine.impl.CmmnManagementServiceImpl; import org.flowable.cmmn.engine.impl.CmmnRepositoryServiceImpl; @@ -68,7 +69,6 @@ import org.flowable.cmmn.engine.impl.cfg.DelegateExpressionFieldInjectionMode; import org.flowable.cmmn.engine.impl.cfg.StandaloneInMemCmmnEngineConfiguration; import org.flowable.cmmn.engine.impl.cmd.JobRetryCmd; -import org.flowable.cmmn.engine.impl.cmd.SchemaOperationsCmmnEngineBuild; import org.flowable.cmmn.engine.impl.db.CmmnDbSchemaManager; import org.flowable.cmmn.engine.impl.db.EntityDependencyOrder; import org.flowable.cmmn.engine.impl.delegate.CmmnClassDelegateFactory; @@ -206,6 +206,7 @@ import org.flowable.common.engine.api.async.AsyncTaskInvoker; import org.flowable.common.engine.api.delegate.FlowableFunctionDelegate; import org.flowable.common.engine.api.scope.ScopeTypes; +import org.flowable.common.engine.impl.AbstractBuildableEngineConfiguration; import org.flowable.common.engine.impl.AbstractEngineConfiguration; import org.flowable.common.engine.impl.EngineConfigurator; import org.flowable.common.engine.impl.EngineDeployer; @@ -262,15 +263,12 @@ import org.flowable.common.engine.impl.variablelistener.VariableListenerSession; import org.flowable.common.engine.impl.variablelistener.VariableListenerSessionFactory; import org.flowable.entitylink.service.EntityLinkServiceConfiguration; -import org.flowable.entitylink.service.impl.db.EntityLinkDbSchemaManager; import org.flowable.eventregistry.api.EventRegistryEventConsumer; import org.flowable.eventregistry.impl.configurator.EventRegistryEngineConfigurator; import org.flowable.eventsubscription.service.EventSubscriptionServiceConfiguration; -import org.flowable.eventsubscription.service.impl.db.EventSubscriptionDbSchemaManager; import org.flowable.form.api.FormFieldHandler; import org.flowable.identitylink.service.IdentityLinkEventHandler; import org.flowable.identitylink.service.IdentityLinkServiceConfiguration; -import org.flowable.identitylink.service.impl.db.IdentityLinkDbSchemaManager; import org.flowable.idm.api.IdmEngineConfigurationApi; import org.flowable.idm.api.IdmIdentityService; import org.flowable.idm.engine.configurator.IdmEngineConfigurator; @@ -288,7 +286,6 @@ import org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnableFactory; import org.flowable.job.service.impl.asyncexecutor.FailedJobCommandFactory; import org.flowable.job.service.impl.asyncexecutor.JobManager; -import org.flowable.job.service.impl.db.JobDbSchemaManager; import org.flowable.mail.common.api.client.FlowableMailClient; import org.flowable.task.service.InternalTaskAssignmentManager; import org.flowable.task.service.InternalTaskVariableScopeResolver; @@ -296,14 +293,12 @@ import org.flowable.task.service.TaskServiceConfiguration; import org.flowable.task.service.history.InternalHistoryTaskManager; import org.flowable.task.service.impl.DefaultTaskPostProcessor; -import org.flowable.task.service.impl.db.TaskDbSchemaManager; import org.flowable.task.service.impl.persistence.entity.HistoricTaskLogEntryEntityImpl; import org.flowable.variable.api.types.VariableType; import org.flowable.variable.api.types.VariableTypes; import org.flowable.variable.service.VariableServiceConfiguration; import org.flowable.variable.service.history.InternalHistoryVariableManager; import org.flowable.variable.service.impl.db.IbatisVariableTypeHandler; -import org.flowable.variable.service.impl.db.VariableDbSchemaManager; import org.flowable.variable.service.impl.types.BooleanType; import org.flowable.variable.service.impl.types.ByteArrayType; import org.flowable.variable.service.impl.types.DateType; @@ -325,12 +320,11 @@ import org.flowable.variable.service.impl.types.StringType; import org.flowable.variable.service.impl.types.UUIDType; -public class CmmnEngineConfiguration extends AbstractEngineConfiguration implements CmmnEngineConfigurationApi, +public class CmmnEngineConfiguration extends AbstractBuildableEngineConfiguration implements CmmnEngineConfigurationApi, ScriptingEngineAwareEngineConfiguration, HasExpressionManagerEngineConfiguration, HasVariableTypes, HasVariableServiceConfiguration { public static final String DEFAULT_MYBATIS_MAPPING_FILE = "org/flowable/cmmn/db/mapping/mappings.xml"; - public static final String LIQUIBASE_CHANGELOG_PREFIX = "ACT_CMMN_"; protected String cmmnEngineName = CmmnEngines.NAME_DEFAULT; @@ -396,8 +390,6 @@ public class CmmnEngineConfiguration extends AbstractEngineConfiguration impleme protected ChangeTenantIdManager changeTenantIdManager; protected Set changeTenantEntityTypes; - protected boolean executeServiceSchemaManagers = true; - protected boolean enableSafeCmmnXml; protected boolean disableCmmnXmlValidation; protected CmmnActivityBehaviorFactory activityBehaviorFactory; @@ -449,14 +441,6 @@ public class CmmnEngineConfiguration extends AbstractEngineConfiguration impleme */ protected DelegateExpressionFieldInjectionMode delegateExpressionFieldInjectionMode = DelegateExpressionFieldInjectionMode.MIXED; - protected SchemaManager identityLinkSchemaManager; - protected SchemaManager entityLinkSchemaManager; - protected SchemaManager eventSubscriptionSchemaManager; - protected SchemaManager variableSchemaManager; - protected SchemaManager taskSchemaManager; - protected SchemaManager jobSchemaManager; - protected SchemaManager batchSchemaManager; - /** * Case diagram generator. Default value is DefaultCaseDiagramGenerator */ @@ -710,16 +694,20 @@ public static CmmnEngineConfiguration createStandaloneInMemCmmnEngineConfigurati } public CmmnEngine buildCmmnEngine() { - init(); - CmmnEngineImpl cmmnEngine = new CmmnEngineImpl(this); + return buildEngine(); + } - if (handleCmmnEngineExecutorsAfterEngineCreate) { - cmmnEngine.startExecutors(); - } + @Override + protected CmmnEngine createEngine() { + return new CmmnEngineImpl(this); + } - return cmmnEngine; + @Override + protected Consumer createPostEngineBuildConsumer() { + return new CmmnEnginePostEngineBuildConsumer(); } + @Override protected void init() { initEngineConfigurations(); initConfigurators(); @@ -810,79 +798,8 @@ public void initCaseDiagramGenerator() { } @Override - public void initSchemaManager() { - super.initSchemaManager(); - initCmmnSchemaManager(); - - if (executeServiceSchemaManagers) { - initIdentityLinkSchemaManager(); - initEntityLinkSchemaManager(); - initEventSubscriptionSchemaManager(); - initVariableSchemaManager(); - initTaskSchemaManager(); - initJobSchemaManager(); - initBatchSchemaManager(); - } - } - - public void initSchemaManagementCommand() { - if (schemaManagementCmd == null) { - if (usingRelationalDatabase && databaseSchemaUpdate != null) { - this.schemaManagementCmd = new SchemaOperationsCmmnEngineBuild(); - } - } - } - - protected void initCmmnSchemaManager() { - if (this.schemaManager == null) { - if (DATABASE_TYPE_COCKROACHDB.equals(databaseType)) { - this.schemaManager = new CmmnDbSchemaManager(CmmnDbSchemaManager.LIQUIBASE_CHANGELOG_CRDB); - } else { - this.schemaManager = new CmmnDbSchemaManager(CmmnDbSchemaManager.LIQUIBASE_CHANGELOG); - } - } - } - - protected void initVariableSchemaManager() { - if (this.variableSchemaManager == null) { - this.variableSchemaManager = new VariableDbSchemaManager(); - } - } - - protected void initTaskSchemaManager() { - if (this.taskSchemaManager == null) { - this.taskSchemaManager = new TaskDbSchemaManager(); - } - } - - protected void initIdentityLinkSchemaManager() { - if (this.identityLinkSchemaManager == null) { - this.identityLinkSchemaManager = new IdentityLinkDbSchemaManager(); - } - } - - protected void initEntityLinkSchemaManager() { - if (this.entityLinkSchemaManager == null) { - this.entityLinkSchemaManager = new EntityLinkDbSchemaManager(); - } - } - - protected void initEventSubscriptionSchemaManager() { - if (this.eventSubscriptionSchemaManager == null) { - this.eventSubscriptionSchemaManager = new EventSubscriptionDbSchemaManager(); - } - } - - protected void initJobSchemaManager() { - if (this.jobSchemaManager == null) { - this.jobSchemaManager = new JobDbSchemaManager(); - } - } - - protected void initBatchSchemaManager() { - if (this.batchSchemaManager == null) { - this.batchSchemaManager = new BatchDbSchemaManager(); - } + protected SchemaManager createEngineSchemaManager() { + return new CmmnDbSchemaManager(); } @Override @@ -2635,14 +2552,6 @@ public CmmnEngineConfiguration setDataSource(DataSource dataSource) { return this; } - public boolean isExecuteServiceSchemaManagers() { - return executeServiceSchemaManagers; - } - - public void setExecuteServiceSchemaManagers(boolean executeServiceSchemaManagers) { - this.executeServiceSchemaManagers = executeServiceSchemaManagers; - } - public HistoryLevel getHistoryLevel() { return historyLevel; } @@ -2801,69 +2710,6 @@ public CmmnEngineConfiguration addPostDefaultELResolver(ELResolver elResolver) { return this; } - public SchemaManager getIdentityLinkSchemaManager() { - return identityLinkSchemaManager; - } - - public CmmnEngineConfiguration setIdentityLinkSchemaManager(SchemaManager identityLinkSchemaManager) { - this.identityLinkSchemaManager = identityLinkSchemaManager; - return this; - } - - public SchemaManager getEntityLinkSchemaManager() { - return entityLinkSchemaManager; - } - - public CmmnEngineConfiguration setEntityLinkSchemaManager(SchemaManager entityLinkSchemaManager) { - this.entityLinkSchemaManager = entityLinkSchemaManager; - return this; - } - - public SchemaManager getEventSubscriptionSchemaManager() { - return eventSubscriptionSchemaManager; - } - - public CmmnEngineConfiguration setEventSubscriptionSchemaManager(SchemaManager eventSubscriptionSchemaManager) { - this.eventSubscriptionSchemaManager = eventSubscriptionSchemaManager; - return this; - } - - public SchemaManager getVariableSchemaManager() { - return variableSchemaManager; - } - - public CmmnEngineConfiguration setVariableSchemaManager(SchemaManager variableSchemaManager) { - this.variableSchemaManager = variableSchemaManager; - return this; - } - - public SchemaManager getTaskSchemaManager() { - return taskSchemaManager; - } - - public CmmnEngineConfiguration setTaskSchemaManager(SchemaManager taskSchemaManager) { - this.taskSchemaManager = taskSchemaManager; - return this; - } - - public SchemaManager getJobSchemaManager() { - return jobSchemaManager; - } - - public CmmnEngineConfiguration setJobSchemaManager(SchemaManager jobSchemaManager) { - this.jobSchemaManager = jobSchemaManager; - return this; - } - - public SchemaManager getBatchSchemaManager() { - return batchSchemaManager; - } - - public CmmnEngineConfiguration setBatchSchemaManager(SchemaManager batchSchemaManager) { - this.batchSchemaManager = batchSchemaManager; - return this; - } - @Override public VariableTypes getVariableTypes() { return variableTypes; diff --git a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/CmmnEngineImpl.java b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/CmmnEngineImpl.java index e277e171f66..5b21f353d40 100644 --- a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/CmmnEngineImpl.java +++ b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/CmmnEngineImpl.java @@ -72,12 +72,6 @@ public CmmnEngineImpl(CmmnEngineConfiguration cmmnEngineConfiguration) { LOGGER.info("CmmnEngine {} created", name); CmmnEngines.registerCmmnEngine(this); - - if (cmmnEngineConfiguration.getEngineLifecycleListeners() != null) { - for (EngineLifecycleListener engineLifecycleListener : cmmnEngineConfiguration.getEngineLifecycleListeners()) { - engineLifecycleListener.onEngineBuilt(this); - } - } } @Override diff --git a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/CmmnEnginePostEngineBuildConsumer.java b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/CmmnEnginePostEngineBuildConsumer.java new file mode 100644 index 00000000000..55662c2b56a --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/CmmnEnginePostEngineBuildConsumer.java @@ -0,0 +1,39 @@ +/* Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flowable.cmmn.engine.impl; + +import java.util.function.Consumer; + +import org.flowable.cmmn.engine.CmmnEngine; +import org.flowable.cmmn.engine.CmmnEngineConfiguration; +import org.flowable.common.engine.api.engine.EngineLifecycleListener; + +/** + * @author Filip Hrisafov + */ +public class CmmnEnginePostEngineBuildConsumer implements Consumer { + + @Override + public void accept(CmmnEngine cmmnEngine) { + CmmnEngineConfiguration engineConfiguration = cmmnEngine.getCmmnEngineConfiguration(); + if (engineConfiguration.getEngineLifecycleListeners() != null) { + for (EngineLifecycleListener engineLifecycleListener : engineConfiguration.getEngineLifecycleListeners()) { + engineLifecycleListener.onEngineBuilt(cmmnEngine); + } + } + + if (engineConfiguration.isHandleCmmnEngineExecutorsAfterEngineCreate()) { + cmmnEngine.startExecutors(); + } + } +} diff --git a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/CmmnManagementServiceImpl.java b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/CmmnManagementServiceImpl.java index 9037010e76c..758fe8e555b 100644 --- a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/CmmnManagementServiceImpl.java +++ b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/CmmnManagementServiceImpl.java @@ -35,11 +35,13 @@ import org.flowable.cmmn.engine.impl.runtime.CmmnExternalWorkerTransitionBuilderImpl; import org.flowable.common.engine.api.FlowableException; import org.flowable.common.engine.api.FlowableIllegalArgumentException; +import org.flowable.common.engine.api.lock.LockManager; import org.flowable.common.engine.api.tenant.ChangeTenantIdBuilder; import org.flowable.common.engine.impl.cmd.GetTableCountCmd; import org.flowable.common.engine.impl.interceptor.Command; import org.flowable.common.engine.impl.interceptor.CommandConfig; import org.flowable.common.engine.impl.interceptor.EngineConfigurationConstants; +import org.flowable.common.engine.impl.lock.LockManagerImpl; import org.flowable.common.engine.impl.service.CommonEngineServiceImpl; import org.flowable.common.engine.impl.tenant.ChangeTenantIdBuilderImpl; import org.flowable.job.api.DeadLetterJobQuery; @@ -354,5 +356,10 @@ public T executeCommand(CommandConfig config, Command command) { } return commandExecutor.execute(config, command); } + + @Override + public LockManager getLockManager(String lockName) { + return new LockManagerImpl(commandExecutor, lockName, getConfiguration().getLockPollRate(), configuration.getEngineCfgKey()); + } } diff --git a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/aot/FlowableCmmnRuntimeHints.java b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/aot/FlowableCmmnRuntimeHints.java index 60821021edd..e0641134e42 100644 --- a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/aot/FlowableCmmnRuntimeHints.java +++ b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/aot/FlowableCmmnRuntimeHints.java @@ -28,8 +28,6 @@ public class FlowableCmmnRuntimeHints implements RuntimeHintsRegistrar { public void registerHints(RuntimeHints hints, ClassLoader classLoader) { ResourceHints resourceHints = hints.resources(); FlowableMyBatisResourceHintsRegistrar.registerMappingResources("org/flowable/cmmn/db/mapping", hints, classLoader); - resourceHints.registerPattern("org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog.xml"); - resourceHints.registerPattern("org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog-crdb.xml"); resourceHints.registerPattern("org/flowable/impl/cmmn/parser/*.xsd"); hints.reflection() diff --git a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/SchemaOperationsCmmnEngineBuild.java b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/SchemaOperationsCmmnEngineBuild.java deleted file mode 100644 index ebae5c34674..00000000000 --- a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/SchemaOperationsCmmnEngineBuild.java +++ /dev/null @@ -1,31 +0,0 @@ -/* Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.flowable.cmmn.engine.impl.cmd; - -import org.flowable.cmmn.engine.impl.db.CmmnDbSchemaManager; -import org.flowable.cmmn.engine.impl.util.CommandContextUtil; -import org.flowable.common.engine.impl.interceptor.Command; -import org.flowable.common.engine.impl.interceptor.CommandContext; - -/** - * @author Joram Barrez - */ -public class SchemaOperationsCmmnEngineBuild implements Command { - - @Override - public Void execute(CommandContext commandContext) { - ((CmmnDbSchemaManager) CommandContextUtil.getCmmnEngineConfiguration(commandContext).getSchemaManager()).initSchema(); - return null; - } - -} diff --git a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/db/CmmnDbSchemaManager.java b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/db/CmmnDbSchemaManager.java index 6bc256440e5..d5c31604bdf 100644 --- a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/db/CmmnDbSchemaManager.java +++ b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/db/CmmnDbSchemaManager.java @@ -12,181 +12,90 @@ */ package org.flowable.cmmn.engine.impl.db; -import org.flowable.cmmn.engine.CmmnEngineConfiguration; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.flowable.cmmn.engine.CmmnEngine; import org.flowable.cmmn.engine.impl.util.CommandContextUtil; -import org.flowable.common.engine.api.FlowableException; import org.flowable.common.engine.impl.AbstractEngineConfiguration; -import org.flowable.common.engine.impl.db.EngineDatabaseConfiguration; -import org.flowable.common.engine.impl.db.LiquibaseBasedSchemaManager; -import org.flowable.common.engine.impl.db.LiquibaseDatabaseConfiguration; -import org.flowable.common.engine.impl.db.SchemaManager; -import org.flowable.common.engine.impl.interceptor.EngineConfigurationConstants; -import org.flowable.idm.engine.IdmEngineConfiguration; - -public class CmmnDbSchemaManager extends LiquibaseBasedSchemaManager { - - public static final String LIQUIBASE_CHANGELOG = "org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog.xml"; - - public static final String LIQUIBASE_CHANGELOG_CRDB = "org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog-crdb.xml"; - - public CmmnDbSchemaManager(String changelogFile) { - super("cmmn", changelogFile, CmmnEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX); +import org.flowable.common.engine.impl.db.EngineSqlScriptBasedDbSchemaManager; + +public class CmmnDbSchemaManager extends EngineSqlScriptBasedDbSchemaManager { + + protected static final String CMMN_DB_SCHEMA_LOCK_NAME = "cmmnDbSchemaLock"; + + protected static final Map changeLogVersionMap = Map.ofEntries( + Map.entry("1", "6.2.0.0"), + Map.entry("2", "6.2.1.0"), + Map.entry("3", "6.3.0.0"), + Map.entry("4", "6.3.1.0"), + Map.entry("5", "6.4.0.0"), + Map.entry("6", "6.4.1.3"), + Map.entry("7", "6.4.1.3"), + Map.entry("8", "6.5.0.6"), + Map.entry("9", "6.5.0.6"), + Map.entry("10", "6.5.0.6"), + Map.entry("11", "6.5.0.6"), + Map.entry("12", "6.6.0.0"), + Map.entry("13", "6.6.0.0"), + Map.entry("14", "6.7.0.0"), + Map.entry("15", "6.7.1.0"), + Map.entry("16", "6.7.1.0"), + Map.entry("17", "6.8.0.0"), + Map.entry("18", "7.0.1.1"), + Map.entry("19", "7.1.0.0"), + Map.entry("20", "7.1.0.0") + ); + + public CmmnDbSchemaManager() { + super("cmmn"); } @Override - protected LiquibaseDatabaseConfiguration getDatabaseConfiguration() { - return new EngineDatabaseConfiguration(CommandContextUtil.getCmmnEngineConfiguration()); - } - - public void initSchema() { - initSchema(CommandContextUtil.getCmmnEngineConfiguration().getDatabaseSchemaUpdate()); + protected String getEngineVersion() { + return CmmnEngine.VERSION; } @Override - public void initSchema(String databaseSchemaUpdate) { - super.initSchema(databaseSchemaUpdate); - - // When the databaseSchemaUpdate is drop-create: - // the IDM engine will have done a drop-create due to the configurator running first - // The CmmnDbSchemaManager will go next, but it will do a dropAll, dropping the idm tables too. - if (AbstractEngineConfiguration.DB_SCHEMA_UPDATE_DROP_CREATE.equals(databaseSchemaUpdate)) { - AbstractEngineConfiguration abstractEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration().getEngineConfigurations() - .get(EngineConfigurationConstants.KEY_IDM_ENGINE_CONFIG); - if (abstractEngineConfiguration != null) { - IdmEngineConfiguration idmEngineConfiguration = (IdmEngineConfiguration) abstractEngineConfiguration; - idmEngineConfiguration.getSchemaManager().schemaCreate(); - } - } + protected String getSchemaVersionPropertyName() { + return "cmmn.schema.version"; } @Override - public void schemaCreate() { - try { - getCommonSchemaManager().schemaCreate(); - getIdentityLinkSchemaManager().schemaCreate(); - getEntityLinkSchemaManager().schemaCreate(); - getEventSubscriptionSchemaManager().schemaCreate(); - getTaskSchemaManager().schemaCreate(); - getVariableSchemaManager().schemaCreate(); - getJobSchemaManager().schemaCreate(); - getBatchSchemaManager().schemaCreate(); - - super.schemaCreate(); - } catch (Exception e) { - throw new FlowableException("Error creating CMMN engine tables", e); - } + protected String getDbSchemaLockName() { + return CMMN_DB_SCHEMA_LOCK_NAME; } @Override - public void schemaDrop() { - try { - super.schemaDrop(); - } catch (Exception e) { - logger.info("Error dropping CMMN engine tables", e); - } - - try { - getBatchSchemaManager().schemaDrop(); - } catch (Exception e) { - logger.info("Error dropping batch tables", e); - } - - try { - getJobSchemaManager().schemaDrop(); - } catch (Exception e) { - logger.info("Error dropping job tables", e); - } - - try { - getVariableSchemaManager().schemaDrop(); - } catch (Exception e) { - logger.info("Error dropping variable tables", e); - } - - try { - getTaskSchemaManager().schemaDrop(); - } catch (Exception e) { - logger.info("Error dropping task tables", e); - } - - try { - getEventSubscriptionSchemaManager().schemaDrop(); - } catch (Exception e) { - logger.info("Error dropping event subscription tables", e); - } - - try { - getEntityLinkSchemaManager().schemaDrop(); - } catch (Exception e) { - logger.info("Error dropping entity link tables", e); - } - - try { - getIdentityLinkSchemaManager().schemaDrop(); - } catch (Exception e) { - logger.info("Error dropping identity link tables", e); - } - - try { - getCommonSchemaManager().schemaDrop(); - } catch (Exception e) { - logger.info("Error dropping common tables", e); - } + protected String getEngineTableName() { + return "ACT_CMMN_RU_CASE_INST"; } @Override - public String schemaUpdate() { - try { - - getCommonSchemaManager().schemaUpdate(); - - if (CommandContextUtil.getCmmnEngineConfiguration().isExecuteServiceSchemaManagers()) { - getIdentityLinkSchemaManager().schemaUpdate(); - getEntityLinkSchemaManager().schemaUpdate(); - getEventSubscriptionSchemaManager().schemaUpdate(); - getTaskSchemaManager().schemaUpdate(); - getVariableSchemaManager().schemaUpdate(); - getJobSchemaManager().schemaUpdate(); - getBatchSchemaManager().schemaUpdate(); - } - - super.schemaUpdate(); - - } catch (Exception e) { - throw new FlowableException("Error updating CMMN engine tables", e); - } - return null; - } - - protected SchemaManager getCommonSchemaManager() { - return CommandContextUtil.getCmmnEngineConfiguration().getCommonSchemaManager(); - } - - protected SchemaManager getIdentityLinkSchemaManager() { - return CommandContextUtil.getCmmnEngineConfiguration().getIdentityLinkSchemaManager(); - } - - protected SchemaManager getEntityLinkSchemaManager() { - return CommandContextUtil.getCmmnEngineConfiguration().getEntityLinkSchemaManager(); - } - - protected SchemaManager getEventSubscriptionSchemaManager() { - return CommandContextUtil.getCmmnEngineConfiguration().getEventSubscriptionSchemaManager(); + protected String getChangeLogTableName() { + return "ACT_CMMN_DATABASECHANGELOG"; } - protected SchemaManager getVariableSchemaManager() { - return CommandContextUtil.getCmmnEngineConfiguration().getVariableSchemaManager(); + @Override + protected String getChangeLogTablePrefixName() { + return "ACT_CMMN"; } - - protected SchemaManager getTaskSchemaManager() { - return CommandContextUtil.getCmmnEngineConfiguration().getTaskSchemaManager(); + + @Override + protected String getDbVersionForChangelogVersion(String changeLogVersion) { + if (StringUtils.isNotEmpty(changeLogVersion) && changeLogVersionMap.containsKey(changeLogVersion)) { + return changeLogVersionMap.get(changeLogVersion); + } + return "6.1.2.0"; } - - protected SchemaManager getJobSchemaManager() { - return CommandContextUtil.getCmmnEngineConfiguration().getJobSchemaManager(); + + @Override + protected AbstractEngineConfiguration getEngineConfiguration() { + return CommandContextUtil.getCmmnEngineConfiguration(); } - protected SchemaManager getBatchSchemaManager() { - return CommandContextUtil.getCmmnEngineConfiguration().getBatchSchemaManager(); + @Override + protected String getResourcesRootDirectory() { + return "org/flowable/cmmn/db/"; } } diff --git a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/db/DbSchemaDrop.java b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/db/DbSchemaDrop.java index 24423dd5f0e..998fec90c7d 100644 --- a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/db/DbSchemaDrop.java +++ b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/db/DbSchemaDrop.java @@ -18,11 +18,9 @@ import org.flowable.cmmn.engine.CmmnEngine; import org.flowable.cmmn.engine.CmmnEngineConfiguration; -import org.flowable.cmmn.engine.impl.util.CommandContextUtil; import org.flowable.cmmn.engine.test.FlowableCmmnTestCase; -import org.flowable.common.engine.impl.interceptor.Command; +import org.flowable.common.engine.impl.db.SchemaOperationsEngineDropDbCmd; import org.flowable.common.engine.impl.interceptor.CommandConfig; -import org.flowable.common.engine.impl.interceptor.CommandContext; import org.flowable.common.engine.impl.interceptor.CommandExecutor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,13 +37,7 @@ public static void main(String[] args) { CmmnEngine cmmnEngine = CmmnEngineConfiguration.createCmmnEngineConfigurationFromInputStream(inputStream).buildCmmnEngine(); CommandExecutor commandExecutor = cmmnEngine.getCmmnEngineConfiguration().getCommandExecutor(); CommandConfig config = new CommandConfig().transactionNotSupported(); - commandExecutor.execute(config, new Command<>() { - @Override - public Object execute(CommandContext commandContext) { - CommandContextUtil.getCmmnEngineConfiguration(commandContext).getSchemaManager().schemaDrop(); - return null; - } - }); + commandExecutor.execute(config, new SchemaOperationsEngineDropDbCmd(cmmnEngine.getCmmnEngineConfiguration().getEngineScopeType())); } catch (IOException e) { LOGGER.error("Could not create CMMN engine", e); diff --git a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/eventregistry/CmmnEventRegistryEventConsumer.java b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/eventregistry/CmmnEventRegistryEventConsumer.java index e86cc08400e..9ce59f10e1e 100644 --- a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/eventregistry/CmmnEventRegistryEventConsumer.java +++ b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/eventregistry/CmmnEventRegistryEventConsumer.java @@ -31,8 +31,8 @@ import org.flowable.cmmn.model.ExtensionElement; import org.flowable.cmmn.model.PlanItem; import org.flowable.common.engine.api.constant.ReferenceTypes; +import org.flowable.common.engine.api.lock.LockManager; import org.flowable.common.engine.api.scope.ScopeTypes; -import org.flowable.common.engine.impl.lock.LockManager; import org.flowable.eventregistry.api.EventConsumerInfo; import org.flowable.eventregistry.api.EventRegistryProcessingInfo; import org.flowable.eventregistry.api.runtime.EventInstance; diff --git a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/test/impl/CmmnTestRunner.java b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/test/impl/CmmnTestRunner.java index 4fbd60eb3bf..8fba68646e0 100644 --- a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/test/impl/CmmnTestRunner.java +++ b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/test/impl/CmmnTestRunner.java @@ -207,17 +207,7 @@ protected void assertDatabaseEmpty(FrameworkMethod method) { cmmnEngineConfiguration, TABLENAMES_EXCLUDED_FROM_DB_CLEAN_CHECK, true, - new Command<>() { - - @Override - public Void execute(CommandContext commandContext) { - SchemaManager schemaManager = CommandContextUtil.getCmmnEngineConfiguration(commandContext).getSchemaManager(); - schemaManager.schemaDrop(); - schemaManager.schemaCreate(); - return null; - } - } - + cmmnEngineConfiguration.getSchemaManagementCmd() ); } diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.db2.cmmn.create.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.db2.cmmn.create.sql deleted file mode 100644 index af05239d57f..00000000000 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.db2.cmmn.create.sql +++ /dev/null @@ -1,65 +0,0 @@ - -CREATE TABLE DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP NOT NULL, ORDEREXECUTED INTEGER NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10)); - -CREATE TABLE ACT_CMMN_RE_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255), CONSTRAINT PK_ACT_CMMN_RE_DE PRIMARY KEY (ID_)); - -CREATE TABLE ACT_CMMN_RE_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_ACT_CMMN_RE_DE PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RE_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_RE_DEPLOYMENT (ID_); - -CREATE INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_RE_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); - -CREATE TABLE ACT_CMMN_RE_CASEDEF (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ VARCHAR(255) NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), HAS_GRAPHICAL_NOTATION_ SMALLINT, TENANT_ID_ VARCHAR(255) DEFAULT '' NOT NULL, CONSTRAINT PK_ACT_CMMN_RE_CA PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RE_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_RE_DEPLOYMENT (ID_); - -CREATE INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_RE_CASEDEF(DEPLOYMENT_ID_); - -CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_CA PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); - -CREATE INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); - -CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ SMALLINT, ELEMENT_ID_ VARCHAR(255), NAME_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_PL PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); - -ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); - -CREATE TABLE ACT_CMMN_RU_SENTRY_ON_PART_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), PLAN_ITEM_INST_ID_ VARCHAR(255), ON_PART_ID_ VARCHAR(255), TIME_STAMP_ TIMESTAMP, CONSTRAINT PK_ACT_CMMN_RU_SE PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_ON_PART_INST(CASE_DEF_ID_); - -ALTER TABLE ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_ON_PART_INST(CASE_INST_ID_); - -ALTER TABLE ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); - -CREATE INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_ON_PART_INST(PLAN_ITEM_INST_ID_); - -CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MI PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); - -ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); - -CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_CA PRIMARY KEY (ID_)); - -CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MI PRIMARY KEY (ID_)); - -INSERT INTO DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1', 'flowable', 'org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog.xml', CURRENT TIMESTAMP, 1, '7:28e5931d36abab0185c189c584a7c2d0', 'createTable tableName=ACT_CMMN_RE_DEPLOYMENT; createTable tableName=ACT_CMMN_RE_DEPLOYMENT_RESOURCE; addForeignKeyConstraint baseTableName=ACT_CMMN_RE_DEPLOYMENT_RESOURCE, constraintName=ACT_FK_CMMN_RSRC_DPL, referencedTableName=ACT_CMMN_RE_DEPLOY...', '', 'EXECUTED', NULL, NULL, '3.5.3', '4471204965'); - diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.db2.create.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.db2.create.cmmn.sql new file mode 100644 index 00000000000..715d0892d3e --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.db2.create.cmmn.sql @@ -0,0 +1,226 @@ +CREATE TABLE ACT_CMMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), KEY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_DEPLO PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_CMMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_CASEDEF (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ INTEGER NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), HAS_GRAPHICAL_NOTATION_ BOOLEAN, TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_CASED PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_CASEDEF(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_CA PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); + +CREATE INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); + +CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), NAME_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_CMMN_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_SENTRY_PART_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), PLAN_ITEM_INST_ID_ VARCHAR(255), ON_PART_ID_ VARCHAR(255), IF_PART_ID_ VARCHAR(255), TIME_STAMP_ TIMESTAMP, CONSTRAINT PK_CMMN_SENTRY_PART_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_PART_INST(PLAN_ITEM_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MI PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_CA PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MI PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD DGRM_RESOURCE_NAME_ VARCHAR(4000); + +ALTER TABLE ACT_CMMN_CASEDEF ADD HAS_START_FORM_KEY_ BOOLEAN; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_CASEDEF'); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD GENERATED_ BOOLEAN; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_DEPLOYMENT_RESOURCE'); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_TIME_ TIMESTAMP; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_CASE_INST'); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_TYPE_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COMPLETEABLE_ BOOLEAN; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD IS_COMPLETEABLE_ BOOLEAN; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_CASE_INST'); + +CREATE INDEX ACT_IDX_PLAN_ITEM_STAGE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(STAGE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COUNT_ENABLED_ BOOLEAN; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD VAR_COUNT_ INTEGER; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD SENTRY_PART_INST_COUNT_ INTEGER; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + +CREATE TABLE ACT_CMMN_HI_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR(255), STATE_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), ITEM_DEFINITION_ID_ VARCHAR(255), ITEM_DEFINITION_TYPE_ VARCHAR(255), CREATED_TIME_ TIMESTAMP, LAST_AVAILABLE_TIME_ TIMESTAMP, LAST_ENABLED_TIME_ TIMESTAMP, LAST_DISABLED_TIME_ TIMESTAMP, LAST_STARTED_TIME_ TIMESTAMP, LAST_SUSPENDED_TIME_ TIMESTAMP, COMPLETED_TIME_ TIMESTAMP, OCCURRED_TIME_ TIMESTAMP, TERMINATED_TIME_ TIMESTAMP, EXIT_TIME_ TIMESTAMP, ENDED_TIME_ TIMESTAMP, LAST_UPDATED_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_PL PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT ''; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_MIL_INST'); + +ALTER TABLE ACT_CMMN_HI_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT ''; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_MIL_INST'); + +CREATE UNIQUE INDEX ACT_IDX_CASE_DEF_UNIQ ON ACT_CMMN_CASEDEF(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST RENAME COLUMN START_TIME_ TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST RENAME COLUMN CREATED_TIME_ TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_AVAILABLE_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_ENABLED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_DISABLED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_STARTED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_SUSPENDED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD COMPLETED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD OCCURRED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD TERMINATED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENDED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD SHOW_IN_OVERVIEW_ BOOLEAN; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_ID_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_CASE_INST'); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_CASE_INST'); + +CREATE INDEX ACT_IDX_CASE_INST_REF_ID_ ON ACT_CMMN_RU_CASE_INST(REFERENCE_ID_); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_ID_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_CASE_INST'); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_CASE_INST'); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_OWNER_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_CASE_INST'); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP(3); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP(3); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_CASE_INST'); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_CASE_INST'); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_CASE_INST'); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_CASE_INST'); + +CREATE INDEX ACT_IDX_HI_CASE_INST_END ON ACT_CMMN_HI_CASE_INST(END_TIME_); + +CREATE INDEX ACT_IDX_HI_PLAN_ITEM_INST_CASE ON ACT_CMMN_HI_PLAN_ITEM_INST(CASE_INST_ID_); + +insert into ACT_GE_PROPERTY +values ('cmmn.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.h2.cmmn.create.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.h2.cmmn.create.sql deleted file mode 100644 index 927876f96bb..00000000000 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.h2.cmmn.create.sql +++ /dev/null @@ -1,65 +0,0 @@ - -CREATE TABLE PUBLIC.DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10)); - -CREATE TABLE PUBLIC.ACT_CMMN_RE_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255), CONSTRAINT PK_ACT_CMMN_RE_DEPLOYMENT PRIMARY KEY (ID_)); - -CREATE TABLE PUBLIC.ACT_CMMN_RE_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_ACT_CMMN_RE_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); - -ALTER TABLE PUBLIC.ACT_CMMN_RE_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES PUBLIC.ACT_CMMN_RE_DEPLOYMENT (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_CMMN_RSRC_DPL ON PUBLIC.ACT_CMMN_RE_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); - -CREATE TABLE PUBLIC.ACT_CMMN_RE_CASEDEF (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ VARCHAR(255) NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), HAS_GRAPHICAL_NOTATION_ BOOLEAN, TENANT_ID_ VARCHAR(255) DEFAULT '' NOT NULL, CONSTRAINT PK_ACT_CMMN_RE_CASEDEF PRIMARY KEY (ID_)); - -ALTER TABLE PUBLIC.ACT_CMMN_RE_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES PUBLIC.ACT_CMMN_RE_DEPLOYMENT (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_CASE_DEF_DPLY ON PUBLIC.ACT_CMMN_RE_CASEDEF(DEPLOYMENT_ID_); - -CREATE TABLE PUBLIC.ACT_CMMN_RU_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_CASE_INST PRIMARY KEY (ID_)); - -ALTER TABLE PUBLIC.ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES PUBLIC.ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_CASE_INST_CASE_DEF ON PUBLIC.ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); - -CREATE INDEX PUBLIC.ACT_IDX_CASE_INST_PARENT ON PUBLIC.ACT_CMMN_RU_CASE_INST(PARENT_ID_); - -CREATE TABLE PUBLIC.ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), NAME_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_PLAN_ITEM_INST PRIMARY KEY (ID_)); - -ALTER TABLE PUBLIC.ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES PUBLIC.ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_PLAN_ITEM_CASE_DEF ON PUBLIC.ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); - -ALTER TABLE PUBLIC.ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES PUBLIC.ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_PLAN_ITEM_CASE_INST ON PUBLIC.ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); - -CREATE TABLE PUBLIC.ACT_CMMN_RU_SENTRY_ON_PART_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), PLAN_ITEM_INST_ID_ VARCHAR(255), ON_PART_ID_ VARCHAR(255), TIME_STAMP_ TIMESTAMP, CONSTRAINT PK_ACT_CMMN_RU_SENTRY_ON_PART_INST PRIMARY KEY (ID_)); - -ALTER TABLE PUBLIC.ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES PUBLIC.ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_SENTRY_CASE_DEF ON PUBLIC.ACT_CMMN_RU_SENTRY_ON_PART_INST(CASE_DEF_ID_); - -ALTER TABLE PUBLIC.ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES PUBLIC.ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_SENTRY_CASE_INST ON PUBLIC.ACT_CMMN_RU_SENTRY_ON_PART_INST(CASE_INST_ID_); - -ALTER TABLE PUBLIC.ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES PUBLIC.ACT_CMMN_RU_PLAN_ITEM_INST (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_SENTRY_PLAN_ITEM ON PUBLIC.ACT_CMMN_RU_SENTRY_ON_PART_INST(PLAN_ITEM_INST_ID_); - -CREATE TABLE PUBLIC.ACT_CMMN_RU_MIL_INST (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MIL_INST PRIMARY KEY (ID_)); - -ALTER TABLE PUBLIC.ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES PUBLIC.ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_MIL_CASE_DEF ON PUBLIC.ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); - -ALTER TABLE PUBLIC.ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES PUBLIC.ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_MIL_CASE_INST ON PUBLIC.ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); - -CREATE TABLE PUBLIC.ACT_CMMN_HI_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_CASE_INST PRIMARY KEY (ID_)); - -CREATE TABLE PUBLIC.ACT_CMMN_HI_MIL_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MIL_INST PRIMARY KEY (ID_)); - -INSERT INTO PUBLIC.DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1', 'flowable', 'org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog.xml', NOW(), 1, '7:28e5931d36abab0185c189c584a7c2d0', 'createTable tableName=ACT_CMMN_RE_DEPLOYMENT; createTable tableName=ACT_CMMN_RE_DEPLOYMENT_RESOURCE; addForeignKeyConstraint baseTableName=ACT_CMMN_RE_DEPLOYMENT_RESOURCE, constraintName=ACT_FK_CMMN_RSRC_DPL, referencedTableName=ACT_CMMN_RE_DEPLOY...', '', 'EXECUTED', NULL, NULL, '3.5.3', '4471205191'); - diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.h2.create.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.h2.create.cmmn.sql new file mode 100644 index 00000000000..6b210343969 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.h2.create.cmmn.sql @@ -0,0 +1,168 @@ +CREATE TABLE ACT_CMMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), KEY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_CMMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_CASEDEF (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ INT NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), HAS_GRAPHICAL_NOTATION_ BOOLEAN, TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_CASEDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_CASEDEF(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_CASE_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); + +CREATE INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); + +CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), NAME_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_CMMN_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_SENTRY_PART_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), PLAN_ITEM_INST_ID_ VARCHAR(255), ON_PART_ID_ VARCHAR(255), IF_PART_ID_ VARCHAR(255), TIME_STAMP_ TIMESTAMP, CONSTRAINT PK_CMMN_SENTRY_PART_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_PART_INST(PLAN_ITEM_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MIL_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_CASE_INST PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MIL_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD DGRM_RESOURCE_NAME_ VARCHAR(4000); + +ALTER TABLE ACT_CMMN_CASEDEF ADD HAS_START_FORM_KEY_ BOOLEAN; + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD GENERATED_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_TYPE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COMPLETEABLE_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD IS_COMPLETEABLE_ BOOLEAN; + +CREATE INDEX ACT_IDX_PLAN_ITEM_STAGE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(STAGE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COUNT_ENABLED_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD VAR_COUNT_ INT; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD SENTRY_PART_INST_COUNT_ INT; + +CREATE TABLE ACT_CMMN_HI_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255), STATE_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), ITEM_DEFINITION_ID_ VARCHAR(255), ITEM_DEFINITION_TYPE_ VARCHAR(255), CREATED_TIME_ TIMESTAMP, LAST_AVAILABLE_TIME_ TIMESTAMP, LAST_ENABLED_TIME_ TIMESTAMP, LAST_DISABLED_TIME_ TIMESTAMP, LAST_STARTED_TIME_ TIMESTAMP, LAST_SUSPENDED_TIME_ TIMESTAMP, COMPLETED_TIME_ TIMESTAMP, OCCURRED_TIME_ TIMESTAMP, TERMINATED_TIME_ TIMESTAMP, EXIT_TIME_ TIMESTAMP, ENDED_TIME_ TIMESTAMP, LAST_UPDATED_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT ''; + +ALTER TABLE ACT_CMMN_HI_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT ''; + +CREATE UNIQUE INDEX ACT_IDX_CASE_DEF_UNIQ ON ACT_CMMN_CASEDEF(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ALTER COLUMN START_TIME_ RENAME TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ALTER COLUMN CREATED_TIME_ RENAME TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_AVAILABLE_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_ENABLED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_DISABLED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_STARTED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_SUSPENDED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD COMPLETED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD OCCURRED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD TERMINATED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENDED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD SHOW_IN_OVERVIEW_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255); + +CREATE INDEX ACT_IDX_CASE_INST_REF_ID_ ON ACT_CMMN_RU_CASE_INST(REFERENCE_ID_); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_OWNER_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255); + +CREATE INDEX ACT_IDX_HI_CASE_INST_END ON ACT_CMMN_HI_CASE_INST(END_TIME_); + +CREATE INDEX ACT_IDX_HI_PLAN_ITEM_INST_CASE ON ACT_CMMN_HI_PLAN_ITEM_INST(CASE_INST_ID_); + +insert into ACT_GE_PROPERTY +values ('cmmn.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.hsql.cmmn.create.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.hsql.cmmn.create.sql deleted file mode 100644 index 1f0fd553cd4..00000000000 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.hsql.cmmn.create.sql +++ /dev/null @@ -1,65 +0,0 @@ - -CREATE TABLE PUBLIC.DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10)); - -CREATE TABLE PUBLIC.ACT_CMMN_RE_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255), CONSTRAINT PK_ACT_CMMN_RE_DEPLOYMENT PRIMARY KEY (ID_)); - -CREATE TABLE PUBLIC.ACT_CMMN_RE_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_ACT_CMMN_RE_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); - -ALTER TABLE PUBLIC.ACT_CMMN_RE_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES PUBLIC.ACT_CMMN_RE_DEPLOYMENT (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_CMMN_RSRC_DPL ON PUBLIC.ACT_CMMN_RE_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); - -CREATE TABLE PUBLIC.ACT_CMMN_RE_CASEDEF (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ VARCHAR(255) NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), HAS_GRAPHICAL_NOTATION_ BOOLEAN, TENANT_ID_ VARCHAR(255) DEFAULT '' NOT NULL, CONSTRAINT PK_ACT_CMMN_RE_CASEDEF PRIMARY KEY (ID_)); - -ALTER TABLE PUBLIC.ACT_CMMN_RE_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES PUBLIC.ACT_CMMN_RE_DEPLOYMENT (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_CASE_DEF_DPLY ON PUBLIC.ACT_CMMN_RE_CASEDEF(DEPLOYMENT_ID_); - -CREATE TABLE PUBLIC.ACT_CMMN_RU_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_CASE_INST PRIMARY KEY (ID_)); - -ALTER TABLE PUBLIC.ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES PUBLIC.ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_CASE_INST_CASE_DEF ON PUBLIC.ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); - -CREATE INDEX PUBLIC.ACT_IDX_CASE_INST_PARENT ON PUBLIC.ACT_CMMN_RU_CASE_INST(PARENT_ID_); - -CREATE TABLE PUBLIC.ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), NAME_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_PLAN_ITEM_INST PRIMARY KEY (ID_)); - -ALTER TABLE PUBLIC.ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES PUBLIC.ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_PLAN_ITEM_CASE_DEF ON PUBLIC.ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); - -ALTER TABLE PUBLIC.ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES PUBLIC.ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_PLAN_ITEM_CASE_INST ON PUBLIC.ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); - -CREATE TABLE PUBLIC.ACT_CMMN_RU_SENTRY_ON_PART_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), PLAN_ITEM_INST_ID_ VARCHAR(255), ON_PART_ID_ VARCHAR(255), TIME_STAMP_ TIMESTAMP, CONSTRAINT PK_ACT_CMMN_RU_SENTRY_ON_PART_INST PRIMARY KEY (ID_)); - -ALTER TABLE PUBLIC.ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES PUBLIC.ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_SENTRY_CASE_DEF ON PUBLIC.ACT_CMMN_RU_SENTRY_ON_PART_INST(CASE_DEF_ID_); - -ALTER TABLE PUBLIC.ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES PUBLIC.ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_SENTRY_CASE_INST ON PUBLIC.ACT_CMMN_RU_SENTRY_ON_PART_INST(CASE_INST_ID_); - -ALTER TABLE PUBLIC.ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES PUBLIC.ACT_CMMN_RU_PLAN_ITEM_INST (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_SENTRY_PLAN_ITEM ON PUBLIC.ACT_CMMN_RU_SENTRY_ON_PART_INST(PLAN_ITEM_INST_ID_); - -CREATE TABLE PUBLIC.ACT_CMMN_RU_MIL_INST (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MIL_INST PRIMARY KEY (ID_)); - -ALTER TABLE PUBLIC.ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES PUBLIC.ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_MIL_CASE_DEF ON PUBLIC.ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); - -ALTER TABLE PUBLIC.ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES PUBLIC.ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX PUBLIC.ACT_IDX_MIL_CASE_INST ON PUBLIC.ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); - -CREATE TABLE PUBLIC.ACT_CMMN_HI_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_CASE_INST PRIMARY KEY (ID_)); - -CREATE TABLE PUBLIC.ACT_CMMN_HI_MIL_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MIL_INST PRIMARY KEY (ID_)); - -INSERT INTO PUBLIC.DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1', 'flowable', 'org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog.xml', NOW, 1, '7:28e5931d36abab0185c189c584a7c2d0', 'createTable tableName=ACT_CMMN_RE_DEPLOYMENT; createTable tableName=ACT_CMMN_RE_DEPLOYMENT_RESOURCE; addForeignKeyConstraint baseTableName=ACT_CMMN_RE_DEPLOYMENT_RESOURCE, constraintName=ACT_FK_CMMN_RSRC_DPL, referencedTableName=ACT_CMMN_RE_DEPLOY...', '', 'EXECUTED', NULL, NULL, '3.5.3', '4471205090'); - diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.hsql.create.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.hsql.create.cmmn.sql new file mode 100644 index 00000000000..6b210343969 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.hsql.create.cmmn.sql @@ -0,0 +1,168 @@ +CREATE TABLE ACT_CMMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), KEY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_CMMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_CASEDEF (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ INT NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), HAS_GRAPHICAL_NOTATION_ BOOLEAN, TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_CASEDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_CASEDEF(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_CASE_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); + +CREATE INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); + +CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), NAME_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_CMMN_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_SENTRY_PART_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), PLAN_ITEM_INST_ID_ VARCHAR(255), ON_PART_ID_ VARCHAR(255), IF_PART_ID_ VARCHAR(255), TIME_STAMP_ TIMESTAMP, CONSTRAINT PK_CMMN_SENTRY_PART_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_PART_INST(PLAN_ITEM_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MIL_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_CASE_INST PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MIL_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD DGRM_RESOURCE_NAME_ VARCHAR(4000); + +ALTER TABLE ACT_CMMN_CASEDEF ADD HAS_START_FORM_KEY_ BOOLEAN; + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD GENERATED_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_TYPE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COMPLETEABLE_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD IS_COMPLETEABLE_ BOOLEAN; + +CREATE INDEX ACT_IDX_PLAN_ITEM_STAGE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(STAGE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COUNT_ENABLED_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD VAR_COUNT_ INT; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD SENTRY_PART_INST_COUNT_ INT; + +CREATE TABLE ACT_CMMN_HI_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255), STATE_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), ITEM_DEFINITION_ID_ VARCHAR(255), ITEM_DEFINITION_TYPE_ VARCHAR(255), CREATED_TIME_ TIMESTAMP, LAST_AVAILABLE_TIME_ TIMESTAMP, LAST_ENABLED_TIME_ TIMESTAMP, LAST_DISABLED_TIME_ TIMESTAMP, LAST_STARTED_TIME_ TIMESTAMP, LAST_SUSPENDED_TIME_ TIMESTAMP, COMPLETED_TIME_ TIMESTAMP, OCCURRED_TIME_ TIMESTAMP, TERMINATED_TIME_ TIMESTAMP, EXIT_TIME_ TIMESTAMP, ENDED_TIME_ TIMESTAMP, LAST_UPDATED_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT ''; + +ALTER TABLE ACT_CMMN_HI_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT ''; + +CREATE UNIQUE INDEX ACT_IDX_CASE_DEF_UNIQ ON ACT_CMMN_CASEDEF(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ALTER COLUMN START_TIME_ RENAME TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ALTER COLUMN CREATED_TIME_ RENAME TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_AVAILABLE_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_ENABLED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_DISABLED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_STARTED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_SUSPENDED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD COMPLETED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD OCCURRED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD TERMINATED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENDED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD SHOW_IN_OVERVIEW_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255); + +CREATE INDEX ACT_IDX_CASE_INST_REF_ID_ ON ACT_CMMN_RU_CASE_INST(REFERENCE_ID_); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_OWNER_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255); + +CREATE INDEX ACT_IDX_HI_CASE_INST_END ON ACT_CMMN_HI_CASE_INST(END_TIME_); + +CREATE INDEX ACT_IDX_HI_PLAN_ITEM_INST_CASE ON ACT_CMMN_HI_PLAN_ITEM_INST(CASE_INST_ID_); + +insert into ACT_GE_PROPERTY +values ('cmmn.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.mssql.cmmn.create.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.mssql.cmmn.create.sql deleted file mode 100644 index 78b824fd5f9..00000000000 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.mssql.cmmn.create.sql +++ /dev/null @@ -1,97 +0,0 @@ - -CREATE TABLE [DATABASECHANGELOG] ([ID] [nvarchar](255) NOT NULL, [AUTHOR] [nvarchar](255) NOT NULL, [FILENAME] [nvarchar](255) NOT NULL, [DATEEXECUTED] [datetime2](3) NOT NULL, [ORDEREXECUTED] [int] NOT NULL, [EXECTYPE] [nvarchar](10) NOT NULL, [MD5SUM] [nvarchar](35), [DESCRIPTION] [nvarchar](255), [COMMENTS] [nvarchar](255), [TAG] [nvarchar](255), [LIQUIBASE] [nvarchar](20), [CONTEXTS] [nvarchar](255), [LABELS] [nvarchar](255), [DEPLOYMENT_ID] [nvarchar](10)) -GO - -CREATE TABLE [ACT_CMMN_RE_DEPLOYMENT] ([ID_] [varchar](255) NOT NULL, [NAME_] [varchar](255), [CATEGORY_] [varchar](255), [DEPLOY_TIME_] [datetime], [PARENT_DEPLOYMENT_ID_] [varchar](255), [TENANT_ID_] [varchar](255), CONSTRAINT [PK_ACT_CMMN_RE_DEPLOYMENT] PRIMARY KEY ([ID_])) -GO - -CREATE TABLE [ACT_CMMN_RE_DEPLOYMENT_RESOURCE] ([ID_] [varchar](255) NOT NULL, [NAME_] [varchar](255), [DEPLOYMENT_ID_] [varchar](255), [RESOURCE_BYTES_] [varbinary](MAX), CONSTRAINT [PK_ACT_CMMN_RE_DEPLOYMENT_RESOURCE] PRIMARY KEY ([ID_])) -GO - -ALTER TABLE [ACT_CMMN_RE_DEPLOYMENT_RESOURCE] ADD CONSTRAINT [ACT_FK_CMMN_RSRC_DPL] FOREIGN KEY ([DEPLOYMENT_ID_]) REFERENCES [ACT_CMMN_RE_DEPLOYMENT] ([ID_]) -GO - -CREATE NONCLUSTERED INDEX ACT_IDX_CMMN_RSRC_DPL ON [ACT_CMMN_RE_DEPLOYMENT_RESOURCE]([DEPLOYMENT_ID_]) -GO - -CREATE TABLE [ACT_CMMN_RE_CASEDEF] ([ID_] [varchar](255) NOT NULL, [REV_] [int] NOT NULL, [NAME_] [varchar](255), [KEY_] [varchar](255) NOT NULL, [VERSION_] [varchar](255) NOT NULL, [CATEGORY_] [varchar](255), [DEPLOYMENT_ID_] [varchar](255), [RESOURCE_NAME_] [varchar](4000), [DESCRIPTION_] [varchar](4000), [HAS_GRAPHICAL_NOTATION_] [bit], [TENANT_ID_] [varchar](255) CONSTRAINT [DF_ACT_CMMN_RE_CASEDEF_TENANT_ID_] DEFAULT '' NOT NULL, CONSTRAINT [PK_ACT_CMMN_RE_CASEDEF] PRIMARY KEY ([ID_])) -GO - -ALTER TABLE [ACT_CMMN_RE_CASEDEF] ADD CONSTRAINT [ACT_FK_CASE_DEF_DPLY] FOREIGN KEY ([DEPLOYMENT_ID_]) REFERENCES [ACT_CMMN_RE_DEPLOYMENT] ([ID_]) -GO - -CREATE NONCLUSTERED INDEX ACT_IDX_CASE_DEF_DPLY ON [ACT_CMMN_RE_CASEDEF]([DEPLOYMENT_ID_]) -GO - -CREATE TABLE [ACT_CMMN_RU_CASE_INST] ([ID_] [varchar](255) NOT NULL, [REV_] [int] NOT NULL, [BUSINESS_KEY_] [varchar](255), [NAME_] [varchar](255), [PARENT_ID_] [varchar](255), [CASE_DEF_ID_] [varchar](255), [STATE_] [varchar](255), [START_TIME_] [datetime], [START_USER_ID_] [varchar](255), [CALLBACK_ID_] [varchar](255), [CALLBACK_TYPE_] [varchar](255), [TENANT_ID_] [varchar](255) CONSTRAINT [DF_ACT_CMMN_RU_CASE_INST_TENANT_ID_] DEFAULT '', CONSTRAINT [PK_ACT_CMMN_RU_CASE_INST] PRIMARY KEY ([ID_])) -GO - -ALTER TABLE [ACT_CMMN_RU_CASE_INST] ADD CONSTRAINT [ACT_FK_CASE_INST_CASE_DEF] FOREIGN KEY ([CASE_DEF_ID_]) REFERENCES [ACT_CMMN_RE_CASEDEF] ([ID_]) -GO - -CREATE NONCLUSTERED INDEX ACT_IDX_CASE_INST_CASE_DEF ON [ACT_CMMN_RU_CASE_INST]([CASE_DEF_ID_]) -GO - -CREATE NONCLUSTERED INDEX ACT_IDX_CASE_INST_PARENT ON [ACT_CMMN_RU_CASE_INST]([PARENT_ID_]) -GO - -CREATE TABLE [ACT_CMMN_RU_PLAN_ITEM_INST] ([ID_] [varchar](255) NOT NULL, [REV_] [int] NOT NULL, [CASE_DEF_ID_] [varchar](255), [CASE_INST_ID_] [varchar](255), [STAGE_INST_ID_] [varchar](255), [IS_STAGE_] [bit], [ELEMENT_ID_] [varchar](255), [NAME_] [varchar](255), [STATE_] [varchar](255), [START_TIME_] [datetime], [START_USER_ID_] [varchar](255), [REFERENCE_ID_] [varchar](255), [REFERENCE_TYPE_] [varchar](255), [TENANT_ID_] [varchar](255) CONSTRAINT [DF_ACT_CMMN_RU_PLAN_ITEM_INST_TENANT_ID_] DEFAULT '', CONSTRAINT [PK_ACT_CMMN_RU_PLAN_ITEM_INST] PRIMARY KEY ([ID_])) -GO - -ALTER TABLE [ACT_CMMN_RU_PLAN_ITEM_INST] ADD CONSTRAINT [ACT_FK_PLAN_ITEM_CASE_DEF] FOREIGN KEY ([CASE_DEF_ID_]) REFERENCES [ACT_CMMN_RE_CASEDEF] ([ID_]) -GO - -CREATE NONCLUSTERED INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON [ACT_CMMN_RU_PLAN_ITEM_INST]([CASE_DEF_ID_]) -GO - -ALTER TABLE [ACT_CMMN_RU_PLAN_ITEM_INST] ADD CONSTRAINT [ACT_FK_PLAN_ITEM_CASE_INST] FOREIGN KEY ([CASE_INST_ID_]) REFERENCES [ACT_CMMN_RU_CASE_INST] ([ID_]) -GO - -CREATE NONCLUSTERED INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON [ACT_CMMN_RU_PLAN_ITEM_INST]([CASE_INST_ID_]) -GO - -CREATE TABLE [ACT_CMMN_RU_SENTRY_ON_PART_INST] ([ID_] [varchar](255) NOT NULL, [REV_] [int] NOT NULL, [CASE_DEF_ID_] [varchar](255), [CASE_INST_ID_] [varchar](255), [PLAN_ITEM_INST_ID_] [varchar](255), [ON_PART_ID_] [varchar](255), [TIME_STAMP_] [datetime], CONSTRAINT [PK_ACT_CMMN_RU_SENTRY_ON_PART_INST] PRIMARY KEY ([ID_])) -GO - -ALTER TABLE [ACT_CMMN_RU_SENTRY_ON_PART_INST] ADD CONSTRAINT [ACT_FK_SENTRY_CASE_DEF] FOREIGN KEY ([CASE_DEF_ID_]) REFERENCES [ACT_CMMN_RE_CASEDEF] ([ID_]) -GO - -CREATE NONCLUSTERED INDEX ACT_IDX_SENTRY_CASE_DEF ON [ACT_CMMN_RU_SENTRY_ON_PART_INST]([CASE_DEF_ID_]) -GO - -ALTER TABLE [ACT_CMMN_RU_SENTRY_ON_PART_INST] ADD CONSTRAINT [ACT_FK_SENTRY_CASE_INST] FOREIGN KEY ([CASE_INST_ID_]) REFERENCES [ACT_CMMN_RU_CASE_INST] ([ID_]) -GO - -CREATE NONCLUSTERED INDEX ACT_IDX_SENTRY_CASE_INST ON [ACT_CMMN_RU_SENTRY_ON_PART_INST]([CASE_INST_ID_]) -GO - -ALTER TABLE [ACT_CMMN_RU_SENTRY_ON_PART_INST] ADD CONSTRAINT [ACT_FK_SENTRY_PLAN_ITEM] FOREIGN KEY ([PLAN_ITEM_INST_ID_]) REFERENCES [ACT_CMMN_RU_PLAN_ITEM_INST] ([ID_]) -GO - -CREATE NONCLUSTERED INDEX ACT_IDX_SENTRY_PLAN_ITEM ON [ACT_CMMN_RU_SENTRY_ON_PART_INST]([PLAN_ITEM_INST_ID_]) -GO - -CREATE TABLE [ACT_CMMN_RU_MIL_INST] ([ID_] [varchar](255) NOT NULL, [NAME_] [varchar](255) NOT NULL, [TIME_STAMP_] [datetime] NOT NULL, [CASE_INST_ID_] [varchar](255) NOT NULL, [CASE_DEF_ID_] [varchar](255) NOT NULL, [ELEMENT_ID_] [varchar](255) NOT NULL, CONSTRAINT [PK_ACT_CMMN_RU_MIL_INST] PRIMARY KEY ([ID_])) -GO - -ALTER TABLE [ACT_CMMN_RU_MIL_INST] ADD CONSTRAINT [ACT_FK_MIL_CASE_DEF] FOREIGN KEY ([CASE_DEF_ID_]) REFERENCES [ACT_CMMN_RE_CASEDEF] ([ID_]) -GO - -CREATE NONCLUSTERED INDEX ACT_IDX_MIL_CASE_DEF ON [ACT_CMMN_RU_MIL_INST]([CASE_DEF_ID_]) -GO - -ALTER TABLE [ACT_CMMN_RU_MIL_INST] ADD CONSTRAINT [ACT_FK_MIL_CASE_INST] FOREIGN KEY ([CASE_INST_ID_]) REFERENCES [ACT_CMMN_RU_CASE_INST] ([ID_]) -GO - -CREATE NONCLUSTERED INDEX ACT_IDX_MIL_CASE_INST ON [ACT_CMMN_RU_MIL_INST]([CASE_INST_ID_]) -GO - -CREATE TABLE [ACT_CMMN_HI_CASE_INST] ([ID_] [varchar](255) NOT NULL, [REV_] [int] NOT NULL, [BUSINESS_KEY_] [varchar](255), [NAME_] [varchar](255), [PARENT_ID_] [varchar](255), [CASE_DEF_ID_] [varchar](255), [STATE_] [varchar](255), [START_TIME_] [datetime], [END_TIME_] [datetime], [START_USER_ID_] [varchar](255), [CALLBACK_ID_] [varchar](255), [CALLBACK_TYPE_] [varchar](255), [TENANT_ID_] [varchar](255) CONSTRAINT [DF_ACT_CMMN_HI_CASE_INST_TENANT_ID_] DEFAULT '', CONSTRAINT [PK_ACT_CMMN_HI_CASE_INST] PRIMARY KEY ([ID_])) -GO - -CREATE TABLE [ACT_CMMN_HI_MIL_INST] ([ID_] [varchar](255) NOT NULL, [REV_] [int] NOT NULL, [NAME_] [varchar](255) NOT NULL, [TIME_STAMP_] [datetime] NOT NULL, [CASE_INST_ID_] [varchar](255) NOT NULL, [CASE_DEF_ID_] [varchar](255) NOT NULL, [ELEMENT_ID_] [varchar](255) NOT NULL, CONSTRAINT [PK_ACT_CMMN_HI_MIL_INST] PRIMARY KEY ([ID_])) -GO - -INSERT INTO [DATABASECHANGELOG] ([ID], [AUTHOR], [FILENAME], [DATEEXECUTED], [ORDEREXECUTED], [MD5SUM], [DESCRIPTION], [COMMENTS], [EXECTYPE], [CONTEXTS], [LABELS], [LIQUIBASE], [DEPLOYMENT_ID]) VALUES ('1', 'flowable', 'org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog.xml', GETDATE(), 1, '7:28e5931d36abab0185c189c584a7c2d0', 'createTable tableName=ACT_CMMN_RE_DEPLOYMENT; createTable tableName=ACT_CMMN_RE_DEPLOYMENT_RESOURCE; addForeignKeyConstraint baseTableName=ACT_CMMN_RE_DEPLOYMENT_RESOURCE, constraintName=ACT_FK_CMMN_RSRC_DPL, referencedTableName=ACT_CMMN_RE_DEPLOY...', '', 'EXECUTED', NULL, NULL, '3.5.3', '4471205429') -GO - diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.mssql.create.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.mssql.create.cmmn.sql new file mode 100644 index 00000000000..c11feb348d3 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.mssql.create.cmmn.sql @@ -0,0 +1,200 @@ +CREATE TABLE ACT_CMMN_DEPLOYMENT (ID_ varchar(255) NOT NULL, NAME_ varchar(255), CATEGORY_ varchar(255), KEY_ varchar(255), DEPLOY_TIME_ datetime, PARENT_DEPLOYMENT_ID_ varchar(255), TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_CMMN_DEPLOYMENT_TENANT_ID_ DEFAULT '', CONSTRAINT PK_ACT_CMMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_DEPLOYMENT_RESOURCE (ID_ varchar(255) NOT NULL, NAME_ varchar(255), DEPLOYMENT_ID_ varchar(255), RESOURCE_BYTES_ varbinary(MAX), CONSTRAINT PK_CMMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_CASEDEF (ID_ varchar(255) NOT NULL, REV_ int NOT NULL, NAME_ varchar(255), KEY_ varchar(255) NOT NULL, VERSION_ int NOT NULL, CATEGORY_ varchar(255), DEPLOYMENT_ID_ varchar(255), RESOURCE_NAME_ varchar(4000), DESCRIPTION_ varchar(4000), HAS_GRAPHICAL_NOTATION_ bit, TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_CMMN_CASEDEF_TENANT_ID_ DEFAULT '', CONSTRAINT PK_ACT_CMMN_CASEDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_CASEDEF(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ varchar(255) NOT NULL, REV_ int NOT NULL, BUSINESS_KEY_ varchar(255), NAME_ varchar(255), PARENT_ID_ varchar(255), CASE_DEF_ID_ varchar(255), STATE_ varchar(255), START_TIME_ datetime, START_USER_ID_ varchar(255), CALLBACK_ID_ varchar(255), CALLBACK_TYPE_ varchar(255), TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_CMMN_RU_CASE_INST_TENANT_ID_ DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_CASE_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); + +CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ varchar(255) NOT NULL, REV_ int NOT NULL, CASE_DEF_ID_ varchar(255), CASE_INST_ID_ varchar(255), STAGE_INST_ID_ varchar(255), IS_STAGE_ bit, ELEMENT_ID_ varchar(255), NAME_ varchar(255), STATE_ varchar(255), START_TIME_ datetime, START_USER_ID_ varchar(255), REFERENCE_ID_ varchar(255), REFERENCE_TYPE_ varchar(255), TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_CMMN_RU_PLAN_ITEM_INST_TENANT_ID_ DEFAULT '', CONSTRAINT PK_CMMN_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_SENTRY_PART_INST (ID_ varchar(255) NOT NULL, REV_ int NOT NULL, CASE_DEF_ID_ varchar(255), CASE_INST_ID_ varchar(255), PLAN_ITEM_INST_ID_ varchar(255), ON_PART_ID_ varchar(255), IF_PART_ID_ varchar(255), TIME_STAMP_ datetime, CONSTRAINT PK_CMMN_SENTRY_PART_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_PART_INST(PLAN_ITEM_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ varchar(255) NOT NULL, NAME_ varchar(255) NOT NULL, TIME_STAMP_ datetime NOT NULL, CASE_INST_ID_ varchar(255) NOT NULL, CASE_DEF_ID_ varchar(255) NOT NULL, ELEMENT_ID_ varchar(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MIL_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ varchar(255) NOT NULL, REV_ int NOT NULL, BUSINESS_KEY_ varchar(255), NAME_ varchar(255), PARENT_ID_ varchar(255), CASE_DEF_ID_ varchar(255), STATE_ varchar(255), START_TIME_ datetime, END_TIME_ datetime, START_USER_ID_ varchar(255), CALLBACK_ID_ varchar(255), CALLBACK_TYPE_ varchar(255), TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_CMMN_HI_CASE_INST_TENANT_ID_ DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_CASE_INST PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ varchar(255) NOT NULL, REV_ int NOT NULL, NAME_ varchar(255) NOT NULL, TIME_STAMP_ datetime NOT NULL, CASE_INST_ID_ varchar(255) NOT NULL, CASE_DEF_ID_ varchar(255) NOT NULL, ELEMENT_ID_ varchar(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MIL_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD DGRM_RESOURCE_NAME_ varchar(4000); + +ALTER TABLE ACT_CMMN_CASEDEF ADD HAS_START_FORM_KEY_ bit; + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD GENERATED_ bit; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_TYPE_ varchar(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COMPLETEABLE_ bit; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD IS_COMPLETEABLE_ bit; + +CREATE NONCLUSTERED INDEX ACT_IDX_PLAN_ITEM_STAGE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(STAGE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COUNT_ENABLED_ bit; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD VAR_COUNT_ int; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD SENTRY_PART_INST_COUNT_ int; + +CREATE TABLE ACT_CMMN_HI_PLAN_ITEM_INST (ID_ varchar(255) NOT NULL, REV_ int NOT NULL, NAME_ varchar(255), STATE_ varchar(255), CASE_DEF_ID_ varchar(255), CASE_INST_ID_ varchar(255), STAGE_INST_ID_ varchar(255), IS_STAGE_ bit, ELEMENT_ID_ varchar(255), ITEM_DEFINITION_ID_ varchar(255), ITEM_DEFINITION_TYPE_ varchar(255), CREATED_TIME_ datetime, LAST_AVAILABLE_TIME_ datetime, LAST_ENABLED_TIME_ datetime, LAST_DISABLED_TIME_ datetime, LAST_STARTED_TIME_ datetime, LAST_SUSPENDED_TIME_ datetime, COMPLETED_TIME_ datetime, OCCURRED_TIME_ datetime, TERMINATED_TIME_ datetime, EXIT_TIME_ datetime, ENDED_TIME_ datetime, LAST_UPDATED_TIME_ datetime, START_USER_ID_ varchar(255), REFERENCE_ID_ varchar(255), REFERENCE_TYPE_ varchar(255), TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_CMMN_HI_PLAN_ITEM_INST_TENANT_ID_ DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_CMMN_RU_MIL_INST_TENANT_ID_ DEFAULT ''; + +ALTER TABLE ACT_CMMN_HI_MIL_INST ADD TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_CMMN_HI_MIL_INST_TENANT_ID_ DEFAULT ''; + +CREATE UNIQUE NONCLUSTERED INDEX ACT_IDX_CASE_DEF_UNIQ ON ACT_CMMN_CASEDEF(KEY_, VERSION_, TENANT_ID_); + +exec sp_rename 'ACT_CMMN_RU_PLAN_ITEM_INST.START_TIME_', 'CREATE_TIME_', 'COLUMN'; + +exec sp_rename 'ACT_CMMN_HI_PLAN_ITEM_INST.CREATED_TIME_', 'CREATE_TIME_', 'COLUMN'; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_AVAILABLE_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_ENABLED_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_DISABLED_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_STARTED_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_SUSPENDED_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD COMPLETED_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD OCCURRED_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD TERMINATED_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENDED_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD SHOW_IN_OVERVIEW_ bit; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXTRA_VALUE_ varchar(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXTRA_VALUE_ varchar(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_TYPE_ varchar(255); + +CREATE NONCLUSTERED INDEX ACT_IDX_CASE_INST_REF_ID_ ON ACT_CMMN_RU_CASE_INST(REFERENCE_ID_); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_TYPE_ varchar(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_OWNER_ varchar(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ datetime; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_USER_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_TIME_ datetime; + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_USER_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD BUSINESS_STATUS_ varchar(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD BUSINESS_STATUS_ varchar(255); + +CREATE NONCLUSTERED INDEX ACT_IDX_HI_CASE_INST_END ON ACT_CMMN_HI_CASE_INST(END_TIME_); + +CREATE NONCLUSTERED INDEX ACT_IDX_HI_PLAN_ITEM_INST_CASE ON ACT_CMMN_HI_PLAN_ITEM_INST(CASE_INST_ID_); + +ALTER TABLE ACT_CMMN_DEPLOYMENT ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_CASEDEF ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_CASEDEF ALTER COLUMN RESOURCE_NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_CASEDEF ALTER COLUMN DGRM_RESOURCE_NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ALTER COLUMN BUSINESS_KEY_ nvarchar(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ALTER COLUMN BUSINESS_STATUS_ nvarchar(255); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_HI_MIL_INST ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ALTER COLUMN BUSINESS_KEY_ nvarchar(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ALTER COLUMN BUSINESS_STATUS_ nvarchar(255); + +ALTER TABLE ACT_CMMN_CASEDEF ALTER COLUMN DESCRIPTION_ nvarchar(4000); + +insert into ACT_GE_PROPERTY +values ('cmmn.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.mysql.cmmn.create.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.mysql.cmmn.create.sql deleted file mode 100644 index eeeb2fbec41..00000000000 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.mysql.cmmn.create.sql +++ /dev/null @@ -1,65 +0,0 @@ - -CREATE TABLE DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED datetime NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35) NULL, DESCRIPTION VARCHAR(255) NULL, COMMENTS VARCHAR(255) NULL, TAG VARCHAR(255) NULL, LIQUIBASE VARCHAR(20) NULL, CONTEXTS VARCHAR(255) NULL, LABELS VARCHAR(255) NULL, DEPLOYMENT_ID VARCHAR(10) NULL); - -CREATE TABLE ACT_CMMN_RE_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NULL, CATEGORY_ VARCHAR(255) NULL, DEPLOY_TIME_ datetime NULL, PARENT_DEPLOYMENT_ID_ VARCHAR(255) NULL, TENANT_ID_ VARCHAR(255) NULL, CONSTRAINT PK_ACT_CMMN_RE_DEPLOYMENT PRIMARY KEY (ID_)); - -CREATE TABLE ACT_CMMN_RE_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NULL, DEPLOYMENT_ID_ VARCHAR(255) NULL, RESOURCE_BYTES_ LONGBLOB NULL, CONSTRAINT PK_ACT_CMMN_RE_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RE_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_RE_DEPLOYMENT (ID_); - -CREATE INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_RE_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); - -CREATE TABLE ACT_CMMN_RE_CASEDEF (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NULL, KEY_ VARCHAR(255) NOT NULL, VERSION_ VARCHAR(255) NOT NULL, CATEGORY_ VARCHAR(255) NULL, DEPLOYMENT_ID_ VARCHAR(255) NULL, RESOURCE_NAME_ VARCHAR(4000) NULL, DESCRIPTION_ VARCHAR(4000) NULL, HAS_GRAPHICAL_NOTATION_ BIT(1) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NOT NULL, CONSTRAINT PK_ACT_CMMN_RE_CASEDEF PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RE_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_RE_DEPLOYMENT (ID_); - -CREATE INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_RE_CASEDEF(DEPLOYMENT_ID_); - -CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255) NULL, NAME_ VARCHAR(255) NULL, PARENT_ID_ VARCHAR(255) NULL, CASE_DEF_ID_ VARCHAR(255) NULL, STATE_ VARCHAR(255) NULL, START_TIME_ datetime NULL, START_USER_ID_ VARCHAR(255) NULL, CALLBACK_ID_ VARCHAR(255) NULL, CALLBACK_TYPE_ VARCHAR(255) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_CMMN_RU_CASE_INST PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); - -CREATE INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); - -CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255) NULL, CASE_INST_ID_ VARCHAR(255) NULL, STAGE_INST_ID_ VARCHAR(255) NULL, IS_STAGE_ BIT(1) NULL, ELEMENT_ID_ VARCHAR(255) NULL, NAME_ VARCHAR(255) NULL, STATE_ VARCHAR(255) NULL, START_TIME_ datetime NULL, START_USER_ID_ VARCHAR(255) NULL, REFERENCE_ID_ VARCHAR(255) NULL, REFERENCE_TYPE_ VARCHAR(255) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_CMMN_RU_PLAN_ITEM_INST PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); - -ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); - -CREATE TABLE ACT_CMMN_RU_SENTRY_ON_PART_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255) NULL, CASE_INST_ID_ VARCHAR(255) NULL, PLAN_ITEM_INST_ID_ VARCHAR(255) NULL, ON_PART_ID_ VARCHAR(255) NULL, TIME_STAMP_ datetime NULL, CONSTRAINT PK_ACT_CMMN_RU_SENTRY_ON_PART_INST PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_ON_PART_INST(CASE_DEF_ID_); - -ALTER TABLE ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_ON_PART_INST(CASE_INST_ID_); - -ALTER TABLE ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); - -CREATE INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_ON_PART_INST(PLAN_ITEM_INST_ID_); - -CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ datetime NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MIL_INST PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); - -ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); - -CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255) NULL, NAME_ VARCHAR(255) NULL, PARENT_ID_ VARCHAR(255) NULL, CASE_DEF_ID_ VARCHAR(255) NULL, STATE_ VARCHAR(255) NULL, START_TIME_ datetime NULL, END_TIME_ datetime NULL, START_USER_ID_ VARCHAR(255) NULL, CALLBACK_ID_ VARCHAR(255) NULL, CALLBACK_TYPE_ VARCHAR(255) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_CMMN_HI_CASE_INST PRIMARY KEY (ID_)); - -CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ datetime NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MIL_INST PRIMARY KEY (ID_)); - -INSERT INTO DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1', 'flowable', 'org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog.xml', NOW(), 1, '7:28e5931d36abab0185c189c584a7c2d0', 'createTable tableName=ACT_CMMN_RE_DEPLOYMENT; createTable tableName=ACT_CMMN_RE_DEPLOYMENT_RESOURCE; addForeignKeyConstraint baseTableName=ACT_CMMN_RE_DEPLOYMENT_RESOURCE, constraintName=ACT_FK_CMMN_RSRC_DPL, referencedTableName=ACT_CMMN_RE_DEPLOY...', '', 'EXECUTED', NULL, NULL, '3.5.3', '4471205295'); - diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.mysql.create.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.mysql.create.cmmn.sql new file mode 100644 index 00000000000..2200d2bcf07 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.mysql.create.cmmn.sql @@ -0,0 +1,178 @@ +CREATE TABLE ACT_CMMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NULL, CATEGORY_ VARCHAR(255) NULL, KEY_ VARCHAR(255) NULL, DEPLOY_TIME_ datetime NULL, PARENT_DEPLOYMENT_ID_ VARCHAR(255) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_CMMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NULL, DEPLOYMENT_ID_ VARCHAR(255) NULL, RESOURCE_BYTES_ LONGBLOB NULL, CONSTRAINT PK_CMMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_CASEDEF (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NULL, KEY_ VARCHAR(255) NOT NULL, VERSION_ INT NOT NULL, CATEGORY_ VARCHAR(255) NULL, DEPLOYMENT_ID_ VARCHAR(255) NULL, RESOURCE_NAME_ VARCHAR(4000) NULL, DESCRIPTION_ VARCHAR(4000) NULL, HAS_GRAPHICAL_NOTATION_ TINYINT NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_CMMN_CASEDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_CASEDEF(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255) NULL, NAME_ VARCHAR(255) NULL, PARENT_ID_ VARCHAR(255) NULL, CASE_DEF_ID_ VARCHAR(255) NULL, STATE_ VARCHAR(255) NULL, START_TIME_ datetime NULL, START_USER_ID_ VARCHAR(255) NULL, CALLBACK_ID_ VARCHAR(255) NULL, CALLBACK_TYPE_ VARCHAR(255) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_CMMN_RU_CASE_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); + +CREATE INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); + +CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255) NULL, CASE_INST_ID_ VARCHAR(255) NULL, STAGE_INST_ID_ VARCHAR(255) NULL, IS_STAGE_ TINYINT NULL, ELEMENT_ID_ VARCHAR(255) NULL, NAME_ VARCHAR(255) NULL, STATE_ VARCHAR(255) NULL, START_TIME_ datetime NULL, START_USER_ID_ VARCHAR(255) NULL, REFERENCE_ID_ VARCHAR(255) NULL, REFERENCE_TYPE_ VARCHAR(255) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_CMMN_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_SENTRY_PART_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255) NULL, CASE_INST_ID_ VARCHAR(255) NULL, PLAN_ITEM_INST_ID_ VARCHAR(255) NULL, ON_PART_ID_ VARCHAR(255) NULL, IF_PART_ID_ VARCHAR(255) NULL, TIME_STAMP_ datetime NULL, CONSTRAINT PK_CMMN_SENTRY_PART_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_PART_INST(PLAN_ITEM_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ datetime NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MIL_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255) NULL, NAME_ VARCHAR(255) NULL, PARENT_ID_ VARCHAR(255) NULL, CASE_DEF_ID_ VARCHAR(255) NULL, STATE_ VARCHAR(255) NULL, START_TIME_ datetime NULL, END_TIME_ datetime NULL, START_USER_ID_ VARCHAR(255) NULL, CALLBACK_ID_ VARCHAR(255) NULL, CALLBACK_TYPE_ VARCHAR(255) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_CMMN_HI_CASE_INST PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ datetime NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MIL_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD DGRM_RESOURCE_NAME_ VARCHAR(4000) NULL, ADD HAS_START_FORM_KEY_ TINYINT NULL; + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD GENERATED_ TINYINT NULL; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_TIME_ datetime NULL; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_ID_ VARCHAR(255) NULL, ADD ITEM_DEFINITION_TYPE_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COMPLETEABLE_ TINYINT NULL; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD IS_COMPLETEABLE_ TINYINT NULL; + +CREATE INDEX ACT_IDX_PLAN_ITEM_STAGE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(STAGE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COUNT_ENABLED_ TINYINT NULL; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD VAR_COUNT_ INT NULL; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD SENTRY_PART_INST_COUNT_ INT NULL; + +CREATE TABLE ACT_CMMN_HI_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NULL, STATE_ VARCHAR(255) NULL, CASE_DEF_ID_ VARCHAR(255) NULL, CASE_INST_ID_ VARCHAR(255) NULL, STAGE_INST_ID_ VARCHAR(255) NULL, IS_STAGE_ TINYINT NULL, ELEMENT_ID_ VARCHAR(255) NULL, ITEM_DEFINITION_ID_ VARCHAR(255) NULL, ITEM_DEFINITION_TYPE_ VARCHAR(255) NULL, CREATED_TIME_ datetime NULL, LAST_AVAILABLE_TIME_ datetime NULL, LAST_ENABLED_TIME_ datetime NULL, LAST_DISABLED_TIME_ datetime NULL, LAST_STARTED_TIME_ datetime NULL, LAST_SUSPENDED_TIME_ datetime NULL, COMPLETED_TIME_ datetime NULL, OCCURRED_TIME_ datetime NULL, TERMINATED_TIME_ datetime NULL, EXIT_TIME_ datetime NULL, ENDED_TIME_ datetime NULL, LAST_UPDATED_TIME_ datetime NULL, START_USER_ID_ VARCHAR(255) NULL, REFERENCE_ID_ VARCHAR(255) NULL, REFERENCE_TYPE_ VARCHAR(255) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_CMMN_HI_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT '' NULL; + +ALTER TABLE ACT_CMMN_HI_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT '' NULL; + +ALTER TABLE ACT_CMMN_DEPLOYMENT MODIFY DEPLOY_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_RU_CASE_INST MODIFY START_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST MODIFY START_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST MODIFY TIME_STAMP_ datetime(3); + +ALTER TABLE ACT_CMMN_RU_MIL_INST MODIFY TIME_STAMP_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_CASE_INST MODIFY START_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_CASE_INST MODIFY END_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_MIL_INST MODIFY TIME_STAMP_ datetime(3); + +ALTER TABLE ACT_CMMN_RU_CASE_INST MODIFY LOCK_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY CREATED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY LAST_AVAILABLE_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY LAST_ENABLED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY LAST_DISABLED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY LAST_STARTED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY LAST_SUSPENDED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY COMPLETED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY OCCURRED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY TERMINATED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY EXIT_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY ENDED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY LAST_UPDATED_TIME_ datetime(3); + +CREATE UNIQUE INDEX ACT_IDX_CASE_DEF_UNIQ ON ACT_CMMN_CASEDEF(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST CHANGE START_TIME_ CREATE_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST CHANGE CREATED_TIME_ CREATE_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_AVAILABLE_TIME_ datetime(3) NULL, ADD LAST_ENABLED_TIME_ datetime(3) NULL, ADD LAST_DISABLED_TIME_ datetime(3) NULL, ADD LAST_STARTED_TIME_ datetime(3) NULL, ADD LAST_SUSPENDED_TIME_ datetime(3) NULL, ADD COMPLETED_TIME_ datetime(3) NULL, ADD OCCURRED_TIME_ datetime(3) NULL, ADD TERMINATED_TIME_ datetime(3) NULL, ADD EXIT_TIME_ datetime(3) NULL, ADD ENDED_TIME_ datetime(3) NULL, ADD ENTRY_CRITERION_ID_ VARCHAR(255) NULL, ADD EXIT_CRITERION_ID_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255) NULL, ADD EXIT_CRITERION_ID_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD SHOW_IN_OVERVIEW_ TINYINT NULL; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_ID_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255) NULL; + +CREATE INDEX ACT_IDX_CASE_INST_REF_ID_ ON ACT_CMMN_RU_CASE_INST(REFERENCE_ID_); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_ID_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_OWNER_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ datetime(3) NULL; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ datetime(3) NULL; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_TIME_ datetime(3) NULL, ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_TIME_ datetime(3) NULL, ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255) NULL; + +CREATE INDEX ACT_IDX_HI_CASE_INST_END ON ACT_CMMN_HI_CASE_INST(END_TIME_); + +CREATE INDEX ACT_IDX_HI_PLAN_ITEM_INST_CASE ON ACT_CMMN_HI_PLAN_ITEM_INST(CASE_INST_ID_); + +insert into ACT_GE_PROPERTY +values ('cmmn.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.oracle.cmmn.create.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.oracle.cmmn.create.sql deleted file mode 100644 index 5869471358d..00000000000 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.oracle.cmmn.create.sql +++ /dev/null @@ -1,67 +0,0 @@ - -SET DEFINE OFF; - -CREATE TABLE DATABASECHANGELOG (ID VARCHAR2(255) NOT NULL, AUTHOR VARCHAR2(255) NOT NULL, FILENAME VARCHAR2(255) NOT NULL, DATEEXECUTED TIMESTAMP NOT NULL, ORDEREXECUTED INTEGER NOT NULL, EXECTYPE VARCHAR2(10) NOT NULL, MD5SUM VARCHAR2(35), DESCRIPTION VARCHAR2(255), COMMENTS VARCHAR2(255), TAG VARCHAR2(255), LIQUIBASE VARCHAR2(20), CONTEXTS VARCHAR2(255), LABELS VARCHAR2(255), DEPLOYMENT_ID VARCHAR2(10)); - -CREATE TABLE ACT_CMMN_RE_DEPLOYMENT (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255), CATEGORY_ VARCHAR2(255), DEPLOY_TIME_ TIMESTAMP, PARENT_DEPLOYMENT_ID_ VARCHAR2(255), TENANT_ID_ VARCHAR2(255), CONSTRAINT PK_ACT_CMMN_RE_DEPLOYMENT PRIMARY KEY (ID_)); - -CREATE TABLE ACT_CMMN_RE_DEPLOYMENT_RESOURCE (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255), DEPLOYMENT_ID_ VARCHAR2(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_ACT_CMMN_RE_DEPLOYMENT_RESO PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RE_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_RE_DEPLOYMENT (ID_); - -CREATE INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_RE_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); - -CREATE TABLE ACT_CMMN_RE_CASEDEF (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR2(255), KEY_ VARCHAR2(255) NOT NULL, VERSION_ VARCHAR2(255) NOT NULL, CATEGORY_ VARCHAR2(255), DEPLOYMENT_ID_ VARCHAR2(255), RESOURCE_NAME_ VARCHAR2(4000), DESCRIPTION_ VARCHAR2(4000), HAS_GRAPHICAL_NOTATION_ NUMBER(1), TENANT_ID_ VARCHAR2(255) DEFAULT '' NOT NULL, CONSTRAINT PK_ACT_CMMN_RE_CASEDEF PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RE_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_RE_DEPLOYMENT (ID_); - -CREATE INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_RE_CASEDEF(DEPLOYMENT_ID_); - -CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, BUSINESS_KEY_ VARCHAR2(255), NAME_ VARCHAR2(255), PARENT_ID_ VARCHAR2(255), CASE_DEF_ID_ VARCHAR2(255), STATE_ VARCHAR2(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR2(255), CALLBACK_ID_ VARCHAR2(255), CALLBACK_TYPE_ VARCHAR2(255), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_CASE_INST PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); - -CREATE INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); - -CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, CASE_DEF_ID_ VARCHAR2(255), CASE_INST_ID_ VARCHAR2(255), STAGE_INST_ID_ VARCHAR2(255), IS_STAGE_ NUMBER(1), ELEMENT_ID_ VARCHAR2(255), NAME_ VARCHAR2(255), STATE_ VARCHAR2(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR2(255), REFERENCE_ID_ VARCHAR2(255), REFERENCE_TYPE_ VARCHAR2(255), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_PLAN_ITEM_INST PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); - -ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); - -CREATE TABLE ACT_CMMN_RU_SENTRY_ON_PART_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, CASE_DEF_ID_ VARCHAR2(255), CASE_INST_ID_ VARCHAR2(255), PLAN_ITEM_INST_ID_ VARCHAR2(255), ON_PART_ID_ VARCHAR2(255), TIME_STAMP_ TIMESTAMP, CONSTRAINT PK_ACT_CMMN_RU_SENTRY_ON_PART_ PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_ON_PART_INST(CASE_DEF_ID_); - -ALTER TABLE ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_ON_PART_INST(CASE_INST_ID_); - -ALTER TABLE ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); - -CREATE INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_ON_PART_INST(PLAN_ITEM_INST_ID_); - -CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR2(255) NOT NULL, CASE_DEF_ID_ VARCHAR2(255) NOT NULL, ELEMENT_ID_ VARCHAR2(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MIL_INST PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); - -ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); - -CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, BUSINESS_KEY_ VARCHAR2(255), NAME_ VARCHAR2(255), PARENT_ID_ VARCHAR2(255), CASE_DEF_ID_ VARCHAR2(255), STATE_ VARCHAR2(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR2(255), CALLBACK_ID_ VARCHAR2(255), CALLBACK_TYPE_ VARCHAR2(255), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_CASE_INST PRIMARY KEY (ID_)); - -CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR2(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR2(255) NOT NULL, CASE_DEF_ID_ VARCHAR2(255) NOT NULL, ELEMENT_ID_ VARCHAR2(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MIL_INST PRIMARY KEY (ID_)); - -INSERT INTO DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1', 'flowable', 'org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog.xml', SYSTIMESTAMP, 1, '7:28e5931d36abab0185c189c584a7c2d0', 'createTable tableName=ACT_CMMN_RE_DEPLOYMENT; createTable tableName=ACT_CMMN_RE_DEPLOYMENT_RESOURCE; addForeignKeyConstraint baseTableName=ACT_CMMN_RE_DEPLOYMENT_RESOURCE, constraintName=ACT_FK_CMMN_RSRC_DPL, referencedTableName=ACT_CMMN_RE_DEPLOY...', '', 'EXECUTED', NULL, NULL, '3.5.3', '4471204819'); - diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.oracle.create.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.oracle.create.cmmn.sql new file mode 100644 index 00000000000..a9bfedb5f70 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.oracle.create.cmmn.sql @@ -0,0 +1,168 @@ +CREATE TABLE ACT_CMMN_DEPLOYMENT (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255), CATEGORY_ VARCHAR2(255), KEY_ VARCHAR2(255), DEPLOY_TIME_ TIMESTAMP, PARENT_DEPLOYMENT_ID_ VARCHAR2(255), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255), DEPLOYMENT_ID_ VARCHAR2(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_CMMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_CASEDEF (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR2(255), KEY_ VARCHAR2(255) NOT NULL, VERSION_ INTEGER NOT NULL, CATEGORY_ VARCHAR2(255), DEPLOYMENT_ID_ VARCHAR2(255), RESOURCE_NAME_ VARCHAR2(4000), DESCRIPTION_ VARCHAR2(4000), HAS_GRAPHICAL_NOTATION_ NUMBER(1), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_CASEDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_CASEDEF(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, BUSINESS_KEY_ VARCHAR2(255), NAME_ VARCHAR2(255), PARENT_ID_ VARCHAR2(255), CASE_DEF_ID_ VARCHAR2(255), STATE_ VARCHAR2(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR2(255), CALLBACK_ID_ VARCHAR2(255), CALLBACK_TYPE_ VARCHAR2(255), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_CASE_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); + +CREATE INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); + +CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, CASE_DEF_ID_ VARCHAR2(255), CASE_INST_ID_ VARCHAR2(255), STAGE_INST_ID_ VARCHAR2(255), IS_STAGE_ NUMBER(1), ELEMENT_ID_ VARCHAR2(255), NAME_ VARCHAR2(255), STATE_ VARCHAR2(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR2(255), REFERENCE_ID_ VARCHAR2(255), REFERENCE_TYPE_ VARCHAR2(255), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_CMMN_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_SENTRY_PART_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, CASE_DEF_ID_ VARCHAR2(255), CASE_INST_ID_ VARCHAR2(255), PLAN_ITEM_INST_ID_ VARCHAR2(255), ON_PART_ID_ VARCHAR2(255), IF_PART_ID_ VARCHAR2(255), TIME_STAMP_ TIMESTAMP, CONSTRAINT PK_CMMN_SENTRY_PART_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_PART_INST(PLAN_ITEM_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR2(255) NOT NULL, CASE_DEF_ID_ VARCHAR2(255) NOT NULL, ELEMENT_ID_ VARCHAR2(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MIL_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, BUSINESS_KEY_ VARCHAR2(255), NAME_ VARCHAR2(255), PARENT_ID_ VARCHAR2(255), CASE_DEF_ID_ VARCHAR2(255), STATE_ VARCHAR2(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR2(255), CALLBACK_ID_ VARCHAR2(255), CALLBACK_TYPE_ VARCHAR2(255), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_CASE_INST PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR2(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR2(255) NOT NULL, CASE_DEF_ID_ VARCHAR2(255) NOT NULL, ELEMENT_ID_ VARCHAR2(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MIL_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD DGRM_RESOURCE_NAME_ VARCHAR2(4000); + +ALTER TABLE ACT_CMMN_CASEDEF ADD HAS_START_FORM_KEY_ NUMBER(1); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD GENERATED_ NUMBER(1); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_TYPE_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COMPLETEABLE_ NUMBER(1); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD IS_COMPLETEABLE_ NUMBER(1); + +CREATE INDEX ACT_IDX_PLAN_ITEM_STAGE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(STAGE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COUNT_ENABLED_ NUMBER(1); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD VAR_COUNT_ INTEGER; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD SENTRY_PART_INST_COUNT_ INTEGER; + +CREATE TABLE ACT_CMMN_HI_PLAN_ITEM_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR2(255), STATE_ VARCHAR2(255), CASE_DEF_ID_ VARCHAR2(255), CASE_INST_ID_ VARCHAR2(255), STAGE_INST_ID_ VARCHAR2(255), IS_STAGE_ NUMBER(1), ELEMENT_ID_ VARCHAR2(255), ITEM_DEFINITION_ID_ VARCHAR2(255), ITEM_DEFINITION_TYPE_ VARCHAR2(255), CREATED_TIME_ TIMESTAMP, LAST_AVAILABLE_TIME_ TIMESTAMP, LAST_ENABLED_TIME_ TIMESTAMP, LAST_DISABLED_TIME_ TIMESTAMP, LAST_STARTED_TIME_ TIMESTAMP, LAST_SUSPENDED_TIME_ TIMESTAMP, COMPLETED_TIME_ TIMESTAMP, OCCURRED_TIME_ TIMESTAMP, TERMINATED_TIME_ TIMESTAMP, EXIT_TIME_ TIMESTAMP, ENDED_TIME_ TIMESTAMP, LAST_UPDATED_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR2(255), REFERENCE_ID_ VARCHAR2(255), REFERENCE_TYPE_ VARCHAR2(255), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD TENANT_ID_ VARCHAR2(255) DEFAULT ''; + +ALTER TABLE ACT_CMMN_HI_MIL_INST ADD TENANT_ID_ VARCHAR2(255) DEFAULT ''; + +CREATE UNIQUE INDEX ACT_IDX_CASE_DEF_UNIQ ON ACT_CMMN_CASEDEF(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST RENAME COLUMN START_TIME_ TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST RENAME COLUMN CREATED_TIME_ TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_AVAILABLE_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_ENABLED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_DISABLED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_STARTED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_SUSPENDED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD COMPLETED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD OCCURRED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD TERMINATED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENDED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD SHOW_IN_OVERVIEW_ NUMBER(1); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_TYPE_ VARCHAR2(255); + +CREATE INDEX ACT_IDX_CASE_INST_REF_ID_ ON ACT_CMMN_RU_CASE_INST(REFERENCE_ID_); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_TYPE_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_OWNER_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD BUSINESS_STATUS_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD BUSINESS_STATUS_ VARCHAR2(255); + +CREATE INDEX ACT_IDX_HI_CASE_INST_END ON ACT_CMMN_HI_CASE_INST(END_TIME_); + +CREATE INDEX ACT_IDX_HI_PLAN_ITEM_INST_CASE ON ACT_CMMN_HI_PLAN_ITEM_INST(CASE_INST_ID_); + +insert into ACT_GE_PROPERTY +values ('cmmn.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.postgres.cmmn.create.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.postgres.cmmn.create.sql deleted file mode 100644 index 92a21b2e091..00000000000 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.postgres.cmmn.create.sql +++ /dev/null @@ -1,65 +0,0 @@ - -CREATE TABLE databasechangelog (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP WITHOUT TIME ZONE NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10)); - -CREATE TABLE ACT_CMMN_RE_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP WITHOUT TIME ZONE, PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255), CONSTRAINT PK_ACT_CMMN_RE_DEPLOYMENT PRIMARY KEY (ID_)); - -CREATE TABLE ACT_CMMN_RE_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BYTEA, CONSTRAINT PK_ACT_CMMN_RE_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RE_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_RE_DEPLOYMENT (ID_); - -CREATE INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_RE_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); - -CREATE TABLE ACT_CMMN_RE_CASEDEF (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ VARCHAR(255) NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), HAS_GRAPHICAL_NOTATION_ BOOLEAN, TENANT_ID_ VARCHAR(255) DEFAULT '' NOT NULL, CONSTRAINT PK_ACT_CMMN_RE_CASEDEF PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RE_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_RE_DEPLOYMENT (ID_); - -CREATE INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_RE_CASEDEF(DEPLOYMENT_ID_); - -CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP WITHOUT TIME ZONE, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_CASE_INST PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); - -CREATE INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); - -CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), NAME_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP WITHOUT TIME ZONE, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_PLAN_ITEM_INST PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); - -ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); - -CREATE TABLE ACT_CMMN_RU_SENTRY_ON_PART_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), PLAN_ITEM_INST_ID_ VARCHAR(255), ON_PART_ID_ VARCHAR(255), TIME_STAMP_ TIMESTAMP WITHOUT TIME ZONE, CONSTRAINT PK_ACT_CMMN_RU_SENTRY_ON_PART_INST PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_ON_PART_INST(CASE_DEF_ID_); - -ALTER TABLE ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_ON_PART_INST(CASE_INST_ID_); - -ALTER TABLE ACT_CMMN_RU_SENTRY_ON_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); - -CREATE INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_ON_PART_INST(PLAN_ITEM_INST_ID_); - -CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP WITHOUT TIME ZONE NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MIL_INST PRIMARY KEY (ID_)); - -ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_RE_CASEDEF (ID_); - -CREATE INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); - -ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); - -CREATE INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); - -CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP WITHOUT TIME ZONE, END_TIME_ TIMESTAMP WITHOUT TIME ZONE, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_CASE_INST PRIMARY KEY (ID_)); - -CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP WITHOUT TIME ZONE NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MIL_INST PRIMARY KEY (ID_)); - -INSERT INTO databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1', 'flowable', 'org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog.xml', NOW(), 1, '7:28e5931d36abab0185c189c584a7c2d0', 'createTable tableName=ACT_CMMN_RE_DEPLOYMENT; createTable tableName=ACT_CMMN_RE_DEPLOYMENT_RESOURCE; addForeignKeyConstraint baseTableName=ACT_CMMN_RE_DEPLOYMENT_RESOURCE, constraintName=ACT_FK_CMMN_RSRC_DPL, referencedTableName=ACT_CMMN_RE_DEPLOY...', '', 'EXECUTED', NULL, NULL, '3.5.3', '4471205537'); - diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.postgres.create.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.postgres.create.cmmn.sql new file mode 100644 index 00000000000..2b94aacc93f --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/create/flowable.postgres.create.cmmn.sql @@ -0,0 +1,168 @@ +CREATE TABLE ACT_CMMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), KEY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP WITHOUT TIME ZONE, PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT "ACT_CMMN_DEPLOYMENT_pkey" PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BYTEA, CONSTRAINT PK_CMMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_CASEDEF (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ INTEGER NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), HAS_GRAPHICAL_NOTATION_ BOOLEAN, TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT "ACT_CMMN_CASEDEF_pkey" PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_CASEDEF(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP WITHOUT TIME ZONE, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT "ACT_CMMN_RU_CASE_INST_pkey" PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); + +CREATE INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); + +CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), NAME_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP WITHOUT TIME ZONE, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_CMMN_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_SENTRY_PART_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), PLAN_ITEM_INST_ID_ VARCHAR(255), ON_PART_ID_ VARCHAR(255), IF_PART_ID_ VARCHAR(255), TIME_STAMP_ TIMESTAMP WITHOUT TIME ZONE, CONSTRAINT PK_CMMN_SENTRY_PART_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_PART_INST(PLAN_ITEM_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP WITHOUT TIME ZONE NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT "ACT_CMMN_RU_MIL_INST_pkey" PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP WITHOUT TIME ZONE, END_TIME_ TIMESTAMP WITHOUT TIME ZONE, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT "ACT_CMMN_HI_CASE_INST_pkey" PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP WITHOUT TIME ZONE NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT "ACT_CMMN_HI_MIL_INST_pkey" PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD DGRM_RESOURCE_NAME_ VARCHAR(4000); + +ALTER TABLE ACT_CMMN_CASEDEF ADD HAS_START_FORM_KEY_ BOOLEAN; + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD GENERATED_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_TIME_ TIMESTAMP WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_TYPE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COMPLETEABLE_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD IS_COMPLETEABLE_ BOOLEAN; + +CREATE INDEX ACT_IDX_PLAN_ITEM_STAGE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(STAGE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COUNT_ENABLED_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD VAR_COUNT_ INTEGER; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD SENTRY_PART_INST_COUNT_ INTEGER; + +CREATE TABLE ACT_CMMN_HI_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR(255), STATE_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), ITEM_DEFINITION_ID_ VARCHAR(255), ITEM_DEFINITION_TYPE_ VARCHAR(255), CREATED_TIME_ TIMESTAMP WITHOUT TIME ZONE, LAST_AVAILABLE_TIME_ TIMESTAMP WITHOUT TIME ZONE, LAST_ENABLED_TIME_ TIMESTAMP WITHOUT TIME ZONE, LAST_DISABLED_TIME_ TIMESTAMP WITHOUT TIME ZONE, LAST_STARTED_TIME_ TIMESTAMP WITHOUT TIME ZONE, LAST_SUSPENDED_TIME_ TIMESTAMP WITHOUT TIME ZONE, COMPLETED_TIME_ TIMESTAMP WITHOUT TIME ZONE, OCCURRED_TIME_ TIMESTAMP WITHOUT TIME ZONE, TERMINATED_TIME_ TIMESTAMP WITHOUT TIME ZONE, EXIT_TIME_ TIMESTAMP WITHOUT TIME ZONE, ENDED_TIME_ TIMESTAMP WITHOUT TIME ZONE, LAST_UPDATED_TIME_ TIMESTAMP WITHOUT TIME ZONE, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT "ACT_CMMN_HI_PLAN_ITEM_INST_pkey" PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT ''; + +ALTER TABLE ACT_CMMN_HI_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT ''; + +CREATE UNIQUE INDEX ACT_IDX_CASE_DEF_UNIQ ON ACT_CMMN_CASEDEF(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST RENAME COLUMN START_TIME_ TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST RENAME COLUMN CREATED_TIME_ TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_AVAILABLE_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_ENABLED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_DISABLED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_STARTED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_SUSPENDED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD COMPLETED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD OCCURRED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD TERMINATED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENDED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD SHOW_IN_OVERVIEW_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255); + +CREATE INDEX ACT_IDX_CASE_INST_REF_ID_ ON ACT_CMMN_RU_CASE_INST(REFERENCE_ID_); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_OWNER_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255); + +CREATE INDEX ACT_IDX_HI_CASE_INST_END ON ACT_CMMN_HI_CASE_INST(END_TIME_); + +CREATE INDEX ACT_IDX_HI_PLAN_ITEM_INST_CASE ON ACT_CMMN_HI_PLAN_ITEM_INST(CASE_INST_ID_); + +insert into ACT_GE_PROPERTY +values ('cmmn.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog-crdb.xml b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog-crdb.xml deleted file mode 100644 index 8be6ebbb9fe..00000000000 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog-crdb.xml +++ /dev/null @@ -1,579 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog.xml b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog.xml deleted file mode 100644 index aefd19d300f..00000000000 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog.xml +++ /dev/null @@ -1,616 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/mappings.xml b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/mappings.xml index 44767de5b23..8563d1edf21 100644 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/mappings.xml +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/mappings.xml @@ -27,6 +27,7 @@ + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.all.upgradestep.7100.to.7101.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.all.upgradestep.7100.to.7101.cmmn.sql new file mode 100644 index 00000000000..04f88fb1aa8 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.all.upgradestep.7100.to.7101.cmmn.sql @@ -0,0 +1,5 @@ +insert into ACT_GE_PROPERTY +values ('cmmn.schema.version', '7.1.0.1', 1); + +drop table ACT_CMMN_DATABASECHANGELOG; +drop table ACT_CMMN_DATABASECHANGELOGLOCK; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6120.to.6200.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6120.to.6200.cmmn.sql new file mode 100644 index 00000000000..2a9f418fc19 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6120.to.6200.cmmn.sql @@ -0,0 +1,61 @@ +CREATE TABLE ACT_CMMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), KEY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_DEPLO PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_CMMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_CASEDEF (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ INTEGER NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), HAS_GRAPHICAL_NOTATION_ BOOLEAN, TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_CASED PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_CASEDEF(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_CA PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); + +CREATE INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); + +CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), NAME_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_CMMN_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_SENTRY_PART_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), PLAN_ITEM_INST_ID_ VARCHAR(255), ON_PART_ID_ VARCHAR(255), IF_PART_ID_ VARCHAR(255), TIME_STAMP_ TIMESTAMP, CONSTRAINT PK_CMMN_SENTRY_PART_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_PART_INST(PLAN_ITEM_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MI PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_CA PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MI PRIMARY KEY (ID_)); + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6200.to.6210.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6200.to.6210.cmmn.sql new file mode 100644 index 00000000000..6bac3251e33 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6200.to.6210.cmmn.sql @@ -0,0 +1,21 @@ +ALTER TABLE ACT_CMMN_CASEDEF ADD DGRM_RESOURCE_NAME_ VARCHAR(4000); + +ALTER TABLE ACT_CMMN_CASEDEF ADD HAS_START_FORM_KEY_ BOOLEAN; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_CASEDEF'); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD GENERATED_ BOOLEAN; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_DEPLOYMENT_RESOURCE'); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_TIME_ TIMESTAMP; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_CASE_INST'); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_TYPE_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6210.to.6300.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6210.to.6300.cmmn.sql new file mode 100644 index 00000000000..f99166e0367 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6210.to.6300.cmmn.sql @@ -0,0 +1,23 @@ +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COMPLETEABLE_ BOOLEAN; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD IS_COMPLETEABLE_ BOOLEAN; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_CASE_INST'); + +CREATE INDEX ACT_IDX_PLAN_ITEM_STAGE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(STAGE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COUNT_ENABLED_ BOOLEAN; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD VAR_COUNT_ INTEGER; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD SENTRY_PART_INST_COUNT_ INTEGER; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6300.to.6301.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6300.to.6301.cmmn.sql new file mode 100644 index 00000000000..4900419a462 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6300.to.6301.cmmn.sql @@ -0,0 +1,11 @@ +CREATE TABLE ACT_CMMN_HI_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR(255), STATE_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), ITEM_DEFINITION_ID_ VARCHAR(255), ITEM_DEFINITION_TYPE_ VARCHAR(255), CREATED_TIME_ TIMESTAMP, LAST_AVAILABLE_TIME_ TIMESTAMP, LAST_ENABLED_TIME_ TIMESTAMP, LAST_DISABLED_TIME_ TIMESTAMP, LAST_STARTED_TIME_ TIMESTAMP, LAST_SUSPENDED_TIME_ TIMESTAMP, COMPLETED_TIME_ TIMESTAMP, OCCURRED_TIME_ TIMESTAMP, TERMINATED_TIME_ TIMESTAMP, EXIT_TIME_ TIMESTAMP, ENDED_TIME_ TIMESTAMP, LAST_UPDATED_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_PL PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT ''; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_MIL_INST'); + +ALTER TABLE ACT_CMMN_HI_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT ''; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_MIL_INST'); + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6400.to.6410.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6400.to.6410.cmmn.sql new file mode 100644 index 00000000000..6be842d6c07 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6400.to.6410.cmmn.sql @@ -0,0 +1,37 @@ +CREATE UNIQUE INDEX ACT_IDX_CASE_DEF_UNIQ ON ACT_CMMN_CASEDEF(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST RENAME COLUMN START_TIME_ TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST RENAME COLUMN CREATED_TIME_ TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_AVAILABLE_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_ENABLED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_DISABLED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_STARTED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_SUSPENDED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD COMPLETED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD OCCURRED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD TERMINATED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENDED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_PLAN_ITEM_INST'); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6501.to.6502.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6501.to.6502.cmmn.sql new file mode 100644 index 00000000000..98bf75198bb --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6501.to.6502.cmmn.sql @@ -0,0 +1,39 @@ +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD SHOW_IN_OVERVIEW_ BOOLEAN; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_ID_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_CASE_INST'); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_CASE_INST'); + +CREATE INDEX ACT_IDX_CASE_INST_REF_ID_ ON ACT_CMMN_RU_CASE_INST(REFERENCE_ID_); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_ID_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_CASE_INST'); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_CASE_INST'); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_PLAN_ITEM_INST'); + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6511.to.6512.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6511.to.6512.cmmn.sql new file mode 100644 index 00000000000..7aec452acb7 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6511.to.6512.cmmn.sql @@ -0,0 +1,13 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_OWNER_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_CASE_INST'); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP(3); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_PLAN_ITEM_INST'); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP(3); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_PLAN_ITEM_INST'); + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6601.to.6610.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6601.to.6610.cmmn.sql new file mode 100644 index 00000000000..27791c9cab3 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6601.to.6610.cmmn.sql @@ -0,0 +1,13 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_CASE_INST'); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_CASE_INST'); + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6701.to.6710.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6701.to.6710.cmmn.sql new file mode 100644 index 00000000000..3f2d3d4242b --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6701.to.6710.cmmn.sql @@ -0,0 +1,9 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_RU_CASE_INST'); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_CMMN_HI_CASE_INST'); + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6723.to.6800.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6723.to.6800.cmmn.sql new file mode 100644 index 00000000000..4aac6aebcdd --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.6723.to.6800.cmmn.sql @@ -0,0 +1,3 @@ +CREATE INDEX ACT_IDX_HI_CASE_INST_END ON ACT_CMMN_HI_CASE_INST(END_TIME_); + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.7000.to.7010.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.7000.to.7010.cmmn.sql new file mode 100644 index 00000000000..caa1f35eae5 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.db2.upgradestep.7000.to.7010.cmmn.sql @@ -0,0 +1,3 @@ +CREATE INDEX ACT_IDX_HI_PLAN_ITEM_INST_CASE ON ACT_CMMN_HI_PLAN_ITEM_INST(CASE_INST_ID_); + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6120.to.6200.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6120.to.6200.cmmn.sql new file mode 100644 index 00000000000..b2a4b129af1 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6120.to.6200.cmmn.sql @@ -0,0 +1,59 @@ +CREATE TABLE ACT_CMMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), KEY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_CMMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_CASEDEF (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ INT NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), HAS_GRAPHICAL_NOTATION_ BOOLEAN, TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_CASEDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_CASEDEF(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_CASE_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); + +CREATE INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); + +CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), NAME_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_CMMN_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_SENTRY_PART_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), PLAN_ITEM_INST_ID_ VARCHAR(255), ON_PART_ID_ VARCHAR(255), IF_PART_ID_ VARCHAR(255), TIME_STAMP_ TIMESTAMP, CONSTRAINT PK_CMMN_SENTRY_PART_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_PART_INST(PLAN_ITEM_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MIL_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_CASE_INST PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MIL_INST PRIMARY KEY (ID_)); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6200.to.6210.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6200.to.6210.cmmn.sql new file mode 100644 index 00000000000..b517bacb76d --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6200.to.6210.cmmn.sql @@ -0,0 +1,11 @@ +ALTER TABLE ACT_CMMN_CASEDEF ADD DGRM_RESOURCE_NAME_ VARCHAR(4000); + +ALTER TABLE ACT_CMMN_CASEDEF ADD HAS_START_FORM_KEY_ BOOLEAN; + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD GENERATED_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_TYPE_ VARCHAR(255); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6210.to.6300.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6210.to.6300.cmmn.sql new file mode 100644 index 00000000000..4402d66f34c --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6210.to.6300.cmmn.sql @@ -0,0 +1,11 @@ +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COMPLETEABLE_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD IS_COMPLETEABLE_ BOOLEAN; + +CREATE INDEX ACT_IDX_PLAN_ITEM_STAGE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(STAGE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COUNT_ENABLED_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD VAR_COUNT_ INT; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD SENTRY_PART_INST_COUNT_ INT; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6300.to.6301.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6300.to.6301.cmmn.sql new file mode 100644 index 00000000000..82af67c2997 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6300.to.6301.cmmn.sql @@ -0,0 +1,5 @@ +CREATE TABLE ACT_CMMN_HI_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255), STATE_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), ITEM_DEFINITION_ID_ VARCHAR(255), ITEM_DEFINITION_TYPE_ VARCHAR(255), CREATED_TIME_ TIMESTAMP, LAST_AVAILABLE_TIME_ TIMESTAMP, LAST_ENABLED_TIME_ TIMESTAMP, LAST_DISABLED_TIME_ TIMESTAMP, LAST_STARTED_TIME_ TIMESTAMP, LAST_SUSPENDED_TIME_ TIMESTAMP, COMPLETED_TIME_ TIMESTAMP, OCCURRED_TIME_ TIMESTAMP, TERMINATED_TIME_ TIMESTAMP, EXIT_TIME_ TIMESTAMP, ENDED_TIME_ TIMESTAMP, LAST_UPDATED_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT ''; + +ALTER TABLE ACT_CMMN_HI_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT ''; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6400.to.6410.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6400.to.6410.cmmn.sql new file mode 100644 index 00000000000..f6b7bd45267 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6400.to.6410.cmmn.sql @@ -0,0 +1,33 @@ +CREATE UNIQUE INDEX ACT_IDX_CASE_DEF_UNIQ ON ACT_CMMN_CASEDEF(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ALTER COLUMN START_TIME_ RENAME TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ALTER COLUMN CREATED_TIME_ RENAME TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_AVAILABLE_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_ENABLED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_DISABLED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_STARTED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_SUSPENDED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD COMPLETED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD OCCURRED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD TERMINATED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENDED_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR(255); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6501.to.6502.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6501.to.6502.cmmn.sql new file mode 100644 index 00000000000..2fc19f4c58b --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6501.to.6502.cmmn.sql @@ -0,0 +1,19 @@ +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD SHOW_IN_OVERVIEW_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255); + +CREATE INDEX ACT_IDX_CASE_INST_REF_ID_ ON ACT_CMMN_RU_CASE_INST(REFERENCE_ID_); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6511.to.6512.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6511.to.6512.cmmn.sql new file mode 100644 index 00000000000..cfd8003f8a9 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6511.to.6512.cmmn.sql @@ -0,0 +1,5 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_OWNER_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6601.to.6610.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6601.to.6610.cmmn.sql new file mode 100644 index 00000000000..70d8c8ec871 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6601.to.6610.cmmn.sql @@ -0,0 +1,7 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6701.to.6710.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6701.to.6710.cmmn.sql new file mode 100644 index 00000000000..548bb70cc5c --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6701.to.6710.cmmn.sql @@ -0,0 +1,3 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6723.to.6800.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6723.to.6800.cmmn.sql new file mode 100644 index 00000000000..31273e933a5 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.6723.to.6800.cmmn.sql @@ -0,0 +1 @@ +CREATE INDEX ACT_IDX_HI_CASE_INST_END ON ACT_CMMN_HI_CASE_INST(END_TIME_); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.7000.to.7010.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.7000.to.7010.cmmn.sql new file mode 100644 index 00000000000..7854c48581d --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.h2.upgradestep.7000.to.7010.cmmn.sql @@ -0,0 +1 @@ +CREATE INDEX ACT_IDX_HI_PLAN_ITEM_INST_CASE ON ACT_CMMN_HI_PLAN_ITEM_INST(CASE_INST_ID_); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6120.to.6200.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6120.to.6200.cmmn.sql new file mode 100644 index 00000000000..31a07bdc992 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6120.to.6200.cmmn.sql @@ -0,0 +1,59 @@ +CREATE TABLE ACT_CMMN_DEPLOYMENT (ID_ varchar(255) NOT NULL, NAME_ varchar(255), CATEGORY_ varchar(255), KEY_ varchar(255), DEPLOY_TIME_ datetime, PARENT_DEPLOYMENT_ID_ varchar(255), TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_CMMN_DEPLOYMENT_TENANT_ID_ DEFAULT '', CONSTRAINT PK_ACT_CMMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_DEPLOYMENT_RESOURCE (ID_ varchar(255) NOT NULL, NAME_ varchar(255), DEPLOYMENT_ID_ varchar(255), RESOURCE_BYTES_ varbinary(MAX), CONSTRAINT PK_CMMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_CASEDEF (ID_ varchar(255) NOT NULL, REV_ int NOT NULL, NAME_ varchar(255), KEY_ varchar(255) NOT NULL, VERSION_ int NOT NULL, CATEGORY_ varchar(255), DEPLOYMENT_ID_ varchar(255), RESOURCE_NAME_ varchar(4000), DESCRIPTION_ varchar(4000), HAS_GRAPHICAL_NOTATION_ bit, TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_CMMN_CASEDEF_TENANT_ID_ DEFAULT '', CONSTRAINT PK_ACT_CMMN_CASEDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_CASEDEF(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ varchar(255) NOT NULL, REV_ int NOT NULL, BUSINESS_KEY_ varchar(255), NAME_ varchar(255), PARENT_ID_ varchar(255), CASE_DEF_ID_ varchar(255), STATE_ varchar(255), START_TIME_ datetime, START_USER_ID_ varchar(255), CALLBACK_ID_ varchar(255), CALLBACK_TYPE_ varchar(255), TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_CMMN_RU_CASE_INST_TENANT_ID_ DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_CASE_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); + +CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ varchar(255) NOT NULL, REV_ int NOT NULL, CASE_DEF_ID_ varchar(255), CASE_INST_ID_ varchar(255), STAGE_INST_ID_ varchar(255), IS_STAGE_ bit, ELEMENT_ID_ varchar(255), NAME_ varchar(255), STATE_ varchar(255), START_TIME_ datetime, START_USER_ID_ varchar(255), REFERENCE_ID_ varchar(255), REFERENCE_TYPE_ varchar(255), TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_CMMN_RU_PLAN_ITEM_INST_TENANT_ID_ DEFAULT '', CONSTRAINT PK_CMMN_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_SENTRY_PART_INST (ID_ varchar(255) NOT NULL, REV_ int NOT NULL, CASE_DEF_ID_ varchar(255), CASE_INST_ID_ varchar(255), PLAN_ITEM_INST_ID_ varchar(255), ON_PART_ID_ varchar(255), IF_PART_ID_ varchar(255), TIME_STAMP_ datetime, CONSTRAINT PK_CMMN_SENTRY_PART_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_PART_INST(PLAN_ITEM_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ varchar(255) NOT NULL, NAME_ varchar(255) NOT NULL, TIME_STAMP_ datetime NOT NULL, CASE_INST_ID_ varchar(255) NOT NULL, CASE_DEF_ID_ varchar(255) NOT NULL, ELEMENT_ID_ varchar(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MIL_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE NONCLUSTERED INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ varchar(255) NOT NULL, REV_ int NOT NULL, BUSINESS_KEY_ varchar(255), NAME_ varchar(255), PARENT_ID_ varchar(255), CASE_DEF_ID_ varchar(255), STATE_ varchar(255), START_TIME_ datetime, END_TIME_ datetime, START_USER_ID_ varchar(255), CALLBACK_ID_ varchar(255), CALLBACK_TYPE_ varchar(255), TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_CMMN_HI_CASE_INST_TENANT_ID_ DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_CASE_INST PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ varchar(255) NOT NULL, REV_ int NOT NULL, NAME_ varchar(255) NOT NULL, TIME_STAMP_ datetime NOT NULL, CASE_INST_ID_ varchar(255) NOT NULL, CASE_DEF_ID_ varchar(255) NOT NULL, ELEMENT_ID_ varchar(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MIL_INST PRIMARY KEY (ID_)); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6200.to.6210.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6200.to.6210.cmmn.sql new file mode 100644 index 00000000000..7d71b6fbace --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6200.to.6210.cmmn.sql @@ -0,0 +1,11 @@ +ALTER TABLE ACT_CMMN_CASEDEF ADD DGRM_RESOURCE_NAME_ varchar(4000); + +ALTER TABLE ACT_CMMN_CASEDEF ADD HAS_START_FORM_KEY_ bit; + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD GENERATED_ bit; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_TYPE_ varchar(255); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6210.to.6300.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6210.to.6300.cmmn.sql new file mode 100644 index 00000000000..2ac6942d9b3 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6210.to.6300.cmmn.sql @@ -0,0 +1,11 @@ +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COMPLETEABLE_ bit; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD IS_COMPLETEABLE_ bit; + +CREATE NONCLUSTERED INDEX ACT_IDX_PLAN_ITEM_STAGE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(STAGE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COUNT_ENABLED_ bit; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD VAR_COUNT_ int; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD SENTRY_PART_INST_COUNT_ int; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6300.to.6301.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6300.to.6301.cmmn.sql new file mode 100644 index 00000000000..8bf973e42af --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6300.to.6301.cmmn.sql @@ -0,0 +1,5 @@ +CREATE TABLE ACT_CMMN_HI_PLAN_ITEM_INST (ID_ varchar(255) NOT NULL, REV_ int NOT NULL, NAME_ varchar(255), STATE_ varchar(255), CASE_DEF_ID_ varchar(255), CASE_INST_ID_ varchar(255), STAGE_INST_ID_ varchar(255), IS_STAGE_ bit, ELEMENT_ID_ varchar(255), ITEM_DEFINITION_ID_ varchar(255), ITEM_DEFINITION_TYPE_ varchar(255), CREATED_TIME_ datetime, LAST_AVAILABLE_TIME_ datetime, LAST_ENABLED_TIME_ datetime, LAST_DISABLED_TIME_ datetime, LAST_STARTED_TIME_ datetime, LAST_SUSPENDED_TIME_ datetime, COMPLETED_TIME_ datetime, OCCURRED_TIME_ datetime, TERMINATED_TIME_ datetime, EXIT_TIME_ datetime, ENDED_TIME_ datetime, LAST_UPDATED_TIME_ datetime, START_USER_ID_ varchar(255), REFERENCE_ID_ varchar(255), REFERENCE_TYPE_ varchar(255), TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_CMMN_HI_PLAN_ITEM_INST_TENANT_ID_ DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_CMMN_RU_MIL_INST_TENANT_ID_ DEFAULT ''; + +ALTER TABLE ACT_CMMN_HI_MIL_INST ADD TENANT_ID_ varchar(255) CONSTRAINT DF_ACT_CMMN_HI_MIL_INST_TENANT_ID_ DEFAULT ''; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6400.to.6410.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6400.to.6410.cmmn.sql new file mode 100644 index 00000000000..99f151b9344 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6400.to.6410.cmmn.sql @@ -0,0 +1,33 @@ +CREATE UNIQUE NONCLUSTERED INDEX ACT_IDX_CASE_DEF_UNIQ ON ACT_CMMN_CASEDEF(KEY_, VERSION_, TENANT_ID_); + +exec sp_rename 'ACT_CMMN_RU_PLAN_ITEM_INST.START_TIME_', 'CREATE_TIME_', 'COLUMN'; + +exec sp_rename 'ACT_CMMN_HI_PLAN_ITEM_INST.CREATED_TIME_', 'CREATE_TIME_', 'COLUMN'; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_AVAILABLE_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_ENABLED_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_DISABLED_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_STARTED_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_SUSPENDED_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD COMPLETED_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD OCCURRED_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD TERMINATED_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENDED_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ varchar(255); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6501.to.6502.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6501.to.6502.cmmn.sql new file mode 100644 index 00000000000..0d288ba0cc8 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6501.to.6502.cmmn.sql @@ -0,0 +1,19 @@ +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD SHOW_IN_OVERVIEW_ bit; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXTRA_VALUE_ varchar(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXTRA_VALUE_ varchar(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_TYPE_ varchar(255); + +CREATE NONCLUSTERED INDEX ACT_IDX_CASE_INST_REF_ID_ ON ACT_CMMN_RU_CASE_INST(REFERENCE_ID_); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_TYPE_ varchar(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ varchar(255); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6511.to.6512.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6511.to.6512.cmmn.sql new file mode 100644 index 00000000000..19ab1660c8b --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6511.to.6512.cmmn.sql @@ -0,0 +1,5 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_OWNER_ varchar(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ datetime; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ datetime; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6601.to.6610.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6601.to.6610.cmmn.sql new file mode 100644 index 00000000000..f3df9ee3019 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6601.to.6610.cmmn.sql @@ -0,0 +1,7 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_TIME_ datetime; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_USER_ID_ varchar(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_TIME_ datetime; + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_USER_ID_ varchar(255); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6701.to.6710.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6701.to.6710.cmmn.sql new file mode 100644 index 00000000000..68338a4ee89 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6701.to.6710.cmmn.sql @@ -0,0 +1,3 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD BUSINESS_STATUS_ varchar(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD BUSINESS_STATUS_ varchar(255); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6723.to.6800.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6723.to.6800.cmmn.sql new file mode 100644 index 00000000000..c20047638ba --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.6723.to.6800.cmmn.sql @@ -0,0 +1 @@ +CREATE NONCLUSTERED INDEX ACT_IDX_HI_CASE_INST_END ON ACT_CMMN_HI_CASE_INST(END_TIME_); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.7000.to.7010.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.7000.to.7010.cmmn.sql new file mode 100644 index 00000000000..93543dc7614 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.7000.to.7010.cmmn.sql @@ -0,0 +1 @@ +CREATE NONCLUSTERED INDEX ACT_IDX_HI_PLAN_ITEM_INST_CASE ON ACT_CMMN_HI_PLAN_ITEM_INST(CASE_INST_ID_); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.7010.to.7100.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.7010.to.7100.cmmn.sql new file mode 100644 index 00000000000..fe452f42156 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mssql.upgradestep.7010.to.7100.cmmn.sql @@ -0,0 +1,31 @@ +ALTER TABLE ACT_CMMN_DEPLOYMENT ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_CASEDEF ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_CASEDEF ALTER COLUMN RESOURCE_NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_CASEDEF ALTER COLUMN DGRM_RESOURCE_NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ALTER COLUMN BUSINESS_KEY_ nvarchar(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ALTER COLUMN BUSINESS_STATUS_ nvarchar(255); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_HI_MIL_INST ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ALTER COLUMN BUSINESS_KEY_ nvarchar(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ALTER COLUMN BUSINESS_STATUS_ nvarchar(255); + +ALTER TABLE ACT_CMMN_CASEDEF ALTER COLUMN DESCRIPTION_ nvarchar(4000); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6120.to.6200.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6120.to.6200.cmmn.sql new file mode 100644 index 00000000000..32cb6bc4f91 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6120.to.6200.cmmn.sql @@ -0,0 +1,60 @@ +CREATE TABLE ACT_CMMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NULL, CATEGORY_ VARCHAR(255) NULL, KEY_ VARCHAR(255) NULL, DEPLOY_TIME_ datetime NULL, PARENT_DEPLOYMENT_ID_ VARCHAR(255) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_CMMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NULL, DEPLOYMENT_ID_ VARCHAR(255) NULL, RESOURCE_BYTES_ LONGBLOB NULL, CONSTRAINT PK_CMMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_CASEDEF (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NULL, KEY_ VARCHAR(255) NOT NULL, VERSION_ INT NOT NULL, CATEGORY_ VARCHAR(255) NULL, DEPLOYMENT_ID_ VARCHAR(255) NULL, RESOURCE_NAME_ VARCHAR(4000) NULL, DESCRIPTION_ VARCHAR(4000) NULL, HAS_GRAPHICAL_NOTATION_ BIT(1) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_CMMN_CASEDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_CASEDEF(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255) NULL, NAME_ VARCHAR(255) NULL, PARENT_ID_ VARCHAR(255) NULL, CASE_DEF_ID_ VARCHAR(255) NULL, STATE_ VARCHAR(255) NULL, START_TIME_ datetime NULL, START_USER_ID_ VARCHAR(255) NULL, CALLBACK_ID_ VARCHAR(255) NULL, CALLBACK_TYPE_ VARCHAR(255) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_CMMN_RU_CASE_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); + +CREATE INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); + +CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255) NULL, CASE_INST_ID_ VARCHAR(255) NULL, STAGE_INST_ID_ VARCHAR(255) NULL, IS_STAGE_ BIT(1) NULL, ELEMENT_ID_ VARCHAR(255) NULL, NAME_ VARCHAR(255) NULL, STATE_ VARCHAR(255) NULL, START_TIME_ datetime NULL, START_USER_ID_ VARCHAR(255) NULL, REFERENCE_ID_ VARCHAR(255) NULL, REFERENCE_TYPE_ VARCHAR(255) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_CMMN_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_SENTRY_PART_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255) NULL, CASE_INST_ID_ VARCHAR(255) NULL, PLAN_ITEM_INST_ID_ VARCHAR(255) NULL, ON_PART_ID_ VARCHAR(255) NULL, IF_PART_ID_ VARCHAR(255) NULL, TIME_STAMP_ datetime NULL, CONSTRAINT PK_CMMN_SENTRY_PART_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_PART_INST(PLAN_ITEM_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ datetime NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MIL_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255) NULL, NAME_ VARCHAR(255) NULL, PARENT_ID_ VARCHAR(255) NULL, CASE_DEF_ID_ VARCHAR(255) NULL, STATE_ VARCHAR(255) NULL, START_TIME_ datetime NULL, END_TIME_ datetime NULL, START_USER_ID_ VARCHAR(255) NULL, CALLBACK_ID_ VARCHAR(255) NULL, CALLBACK_TYPE_ VARCHAR(255) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_CMMN_HI_CASE_INST PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ datetime NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MIL_INST PRIMARY KEY (ID_)); + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6200.to.6210.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6200.to.6210.cmmn.sql new file mode 100644 index 00000000000..0003a559dc5 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6200.to.6210.cmmn.sql @@ -0,0 +1,7 @@ +ALTER TABLE ACT_CMMN_CASEDEF ADD DGRM_RESOURCE_NAME_ VARCHAR(4000) NULL, ADD HAS_START_FORM_KEY_ BIT(1) NULL; + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD GENERATED_ BIT(1) NULL; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_TIME_ datetime NULL; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_ID_ VARCHAR(255) NULL, ADD ITEM_DEFINITION_TYPE_ VARCHAR(255) NULL; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6210.to.6300.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6210.to.6300.cmmn.sql new file mode 100644 index 00000000000..4d101c17974 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6210.to.6300.cmmn.sql @@ -0,0 +1,11 @@ +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COMPLETEABLE_ BIT(1) NULL; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD IS_COMPLETEABLE_ BIT(1) NULL; + +CREATE INDEX ACT_IDX_PLAN_ITEM_STAGE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(STAGE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COUNT_ENABLED_ BIT(1) NULL; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD VAR_COUNT_ INT NULL; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD SENTRY_PART_INST_COUNT_ INT NULL; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6300.to.6301.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6300.to.6301.cmmn.sql new file mode 100644 index 00000000000..f4c1851c9f2 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6300.to.6301.cmmn.sql @@ -0,0 +1,5 @@ +CREATE TABLE ACT_CMMN_HI_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NULL, STATE_ VARCHAR(255) NULL, CASE_DEF_ID_ VARCHAR(255) NULL, CASE_INST_ID_ VARCHAR(255) NULL, STAGE_INST_ID_ VARCHAR(255) NULL, IS_STAGE_ BIT(1) NULL, ELEMENT_ID_ VARCHAR(255) NULL, ITEM_DEFINITION_ID_ VARCHAR(255) NULL, ITEM_DEFINITION_TYPE_ VARCHAR(255) NULL, CREATED_TIME_ datetime NULL, LAST_AVAILABLE_TIME_ datetime NULL, LAST_ENABLED_TIME_ datetime NULL, LAST_DISABLED_TIME_ datetime NULL, LAST_STARTED_TIME_ datetime NULL, LAST_SUSPENDED_TIME_ datetime NULL, COMPLETED_TIME_ datetime NULL, OCCURRED_TIME_ datetime NULL, TERMINATED_TIME_ datetime NULL, EXIT_TIME_ datetime NULL, ENDED_TIME_ datetime NULL, LAST_UPDATED_TIME_ datetime NULL, START_USER_ID_ VARCHAR(255) NULL, REFERENCE_ID_ VARCHAR(255) NULL, REFERENCE_TYPE_ VARCHAR(255) NULL, TENANT_ID_ VARCHAR(255) DEFAULT '' NULL, CONSTRAINT PK_ACT_CMMN_HI_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT '' NULL; + +ALTER TABLE ACT_CMMN_HI_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT '' NULL; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6310.to.6320.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6310.to.6320.cmmn.sql new file mode 100644 index 00000000000..d8768a69e50 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6310.to.6320.cmmn.sql @@ -0,0 +1,41 @@ +ALTER TABLE ACT_CMMN_DEPLOYMENT MODIFY DEPLOY_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_RU_CASE_INST MODIFY START_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST MODIFY START_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST MODIFY TIME_STAMP_ datetime(3); + +ALTER TABLE ACT_CMMN_RU_MIL_INST MODIFY TIME_STAMP_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_CASE_INST MODIFY START_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_CASE_INST MODIFY END_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_MIL_INST MODIFY TIME_STAMP_ datetime(3); + +ALTER TABLE ACT_CMMN_RU_CASE_INST MODIFY LOCK_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY CREATED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY LAST_AVAILABLE_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY LAST_ENABLED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY LAST_DISABLED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY LAST_STARTED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY LAST_SUSPENDED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY COMPLETED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY OCCURRED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY TERMINATED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY EXIT_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY ENDED_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST MODIFY LAST_UPDATED_TIME_ datetime(3); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6400.to.6410.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6400.to.6410.cmmn.sql new file mode 100644 index 00000000000..52ec43ec43f --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6400.to.6410.cmmn.sql @@ -0,0 +1,9 @@ +CREATE UNIQUE INDEX ACT_IDX_CASE_DEF_UNIQ ON ACT_CMMN_CASEDEF(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST CHANGE START_TIME_ CREATE_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST CHANGE CREATED_TIME_ CREATE_TIME_ datetime(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_AVAILABLE_TIME_ datetime(3) NULL, ADD LAST_ENABLED_TIME_ datetime(3) NULL, ADD LAST_DISABLED_TIME_ datetime(3) NULL, ADD LAST_STARTED_TIME_ datetime(3) NULL, ADD LAST_SUSPENDED_TIME_ datetime(3) NULL, ADD COMPLETED_TIME_ datetime(3) NULL, ADD OCCURRED_TIME_ datetime(3) NULL, ADD TERMINATED_TIME_ datetime(3) NULL, ADD EXIT_TIME_ datetime(3) NULL, ADD ENDED_TIME_ datetime(3) NULL, ADD ENTRY_CRITERION_ID_ VARCHAR(255) NULL, ADD EXIT_CRITERION_ID_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255) NULL, ADD EXIT_CRITERION_ID_ VARCHAR(255) NULL; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6501.to.6502.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6501.to.6502.cmmn.sql new file mode 100644 index 00000000000..c4954e0c95c --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6501.to.6502.cmmn.sql @@ -0,0 +1,19 @@ +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD SHOW_IN_OVERVIEW_ BIT(1) NULL; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_ID_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255) NULL; + +CREATE INDEX ACT_IDX_CASE_INST_REF_ID_ ON ACT_CMMN_RU_CASE_INST(REFERENCE_ID_); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_ID_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255) NULL; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6511.to.6512.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6511.to.6512.cmmn.sql new file mode 100644 index 00000000000..67475f98cb1 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6511.to.6512.cmmn.sql @@ -0,0 +1,5 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_OWNER_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ datetime(3) NULL; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ datetime(3) NULL; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6601.to.6610.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6601.to.6610.cmmn.sql new file mode 100644 index 00000000000..98f8134185b --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6601.to.6610.cmmn.sql @@ -0,0 +1,3 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_TIME_ datetime(3) NULL, ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_TIME_ datetime(3) NULL, ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255) NULL; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6701.to.6710.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6701.to.6710.cmmn.sql new file mode 100644 index 00000000000..ed09718e4b7 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6701.to.6710.cmmn.sql @@ -0,0 +1,3 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255) NULL; + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255) NULL; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6723.to.6800.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6723.to.6800.cmmn.sql new file mode 100644 index 00000000000..31273e933a5 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.6723.to.6800.cmmn.sql @@ -0,0 +1 @@ +CREATE INDEX ACT_IDX_HI_CASE_INST_END ON ACT_CMMN_HI_CASE_INST(END_TIME_); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.7000.to.7010.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.7000.to.7010.cmmn.sql new file mode 100644 index 00000000000..7854c48581d --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.mysql.upgradestep.7000.to.7010.cmmn.sql @@ -0,0 +1 @@ +CREATE INDEX ACT_IDX_HI_PLAN_ITEM_INST_CASE ON ACT_CMMN_HI_PLAN_ITEM_INST(CASE_INST_ID_); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6120.to.6200.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6120.to.6200.cmmn.sql new file mode 100644 index 00000000000..24414939064 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6120.to.6200.cmmn.sql @@ -0,0 +1,61 @@ +CREATE TABLE ACT_CMMN_DEPLOYMENT (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255), CATEGORY_ VARCHAR2(255), KEY_ VARCHAR2(255), DEPLOY_TIME_ TIMESTAMP, PARENT_DEPLOYMENT_ID_ VARCHAR2(255), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255), DEPLOYMENT_ID_ VARCHAR2(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_CMMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_CASEDEF (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR2(255), KEY_ VARCHAR2(255) NOT NULL, VERSION_ INTEGER NOT NULL, CATEGORY_ VARCHAR2(255), DEPLOYMENT_ID_ VARCHAR2(255), RESOURCE_NAME_ VARCHAR2(4000), DESCRIPTION_ VARCHAR2(4000), HAS_GRAPHICAL_NOTATION_ NUMBER(1), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_CASEDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_CASEDEF(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, BUSINESS_KEY_ VARCHAR2(255), NAME_ VARCHAR2(255), PARENT_ID_ VARCHAR2(255), CASE_DEF_ID_ VARCHAR2(255), STATE_ VARCHAR2(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR2(255), CALLBACK_ID_ VARCHAR2(255), CALLBACK_TYPE_ VARCHAR2(255), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_CASE_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); + +CREATE INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); + +CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, CASE_DEF_ID_ VARCHAR2(255), CASE_INST_ID_ VARCHAR2(255), STAGE_INST_ID_ VARCHAR2(255), IS_STAGE_ NUMBER(1), ELEMENT_ID_ VARCHAR2(255), NAME_ VARCHAR2(255), STATE_ VARCHAR2(255), START_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR2(255), REFERENCE_ID_ VARCHAR2(255), REFERENCE_TYPE_ VARCHAR2(255), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_CMMN_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_SENTRY_PART_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, CASE_DEF_ID_ VARCHAR2(255), CASE_INST_ID_ VARCHAR2(255), PLAN_ITEM_INST_ID_ VARCHAR2(255), ON_PART_ID_ VARCHAR2(255), IF_PART_ID_ VARCHAR2(255), TIME_STAMP_ TIMESTAMP, CONSTRAINT PK_CMMN_SENTRY_PART_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_PART_INST(PLAN_ITEM_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR2(255) NOT NULL, CASE_DEF_ID_ VARCHAR2(255) NOT NULL, ELEMENT_ID_ VARCHAR2(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MIL_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, BUSINESS_KEY_ VARCHAR2(255), NAME_ VARCHAR2(255), PARENT_ID_ VARCHAR2(255), CASE_DEF_ID_ VARCHAR2(255), STATE_ VARCHAR2(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR2(255), CALLBACK_ID_ VARCHAR2(255), CALLBACK_TYPE_ VARCHAR2(255), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_CASE_INST PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR2(255) NOT NULL, TIME_STAMP_ TIMESTAMP NOT NULL, CASE_INST_ID_ VARCHAR2(255) NOT NULL, CASE_DEF_ID_ VARCHAR2(255) NOT NULL, ELEMENT_ID_ VARCHAR2(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MIL_INST PRIMARY KEY (ID_)); + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6200.to.6210.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6200.to.6210.cmmn.sql new file mode 100644 index 00000000000..903f40696b2 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6200.to.6210.cmmn.sql @@ -0,0 +1,13 @@ +ALTER TABLE ACT_CMMN_CASEDEF ADD DGRM_RESOURCE_NAME_ VARCHAR2(4000); + +ALTER TABLE ACT_CMMN_CASEDEF ADD HAS_START_FORM_KEY_ NUMBER(1); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD GENERATED_ NUMBER(1); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_TIME_ TIMESTAMP; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_TYPE_ VARCHAR2(255); + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6210.to.6300.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6210.to.6300.cmmn.sql new file mode 100644 index 00000000000..b7921d64eff --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6210.to.6300.cmmn.sql @@ -0,0 +1,13 @@ +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COMPLETEABLE_ NUMBER(1); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD IS_COMPLETEABLE_ NUMBER(1); + +CREATE INDEX ACT_IDX_PLAN_ITEM_STAGE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(STAGE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COUNT_ENABLED_ NUMBER(1); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD VAR_COUNT_ INTEGER; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD SENTRY_PART_INST_COUNT_ INTEGER; + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6300.to.6301.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6300.to.6301.cmmn.sql new file mode 100644 index 00000000000..ded49342f99 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6300.to.6301.cmmn.sql @@ -0,0 +1,7 @@ +CREATE TABLE ACT_CMMN_HI_PLAN_ITEM_INST (ID_ VARCHAR2(255) NOT NULL, REV_ INTEGER NOT NULL, NAME_ VARCHAR2(255), STATE_ VARCHAR2(255), CASE_DEF_ID_ VARCHAR2(255), CASE_INST_ID_ VARCHAR2(255), STAGE_INST_ID_ VARCHAR2(255), IS_STAGE_ NUMBER(1), ELEMENT_ID_ VARCHAR2(255), ITEM_DEFINITION_ID_ VARCHAR2(255), ITEM_DEFINITION_TYPE_ VARCHAR2(255), CREATED_TIME_ TIMESTAMP, LAST_AVAILABLE_TIME_ TIMESTAMP, LAST_ENABLED_TIME_ TIMESTAMP, LAST_DISABLED_TIME_ TIMESTAMP, LAST_STARTED_TIME_ TIMESTAMP, LAST_SUSPENDED_TIME_ TIMESTAMP, COMPLETED_TIME_ TIMESTAMP, OCCURRED_TIME_ TIMESTAMP, TERMINATED_TIME_ TIMESTAMP, EXIT_TIME_ TIMESTAMP, ENDED_TIME_ TIMESTAMP, LAST_UPDATED_TIME_ TIMESTAMP, START_USER_ID_ VARCHAR2(255), REFERENCE_ID_ VARCHAR2(255), REFERENCE_TYPE_ VARCHAR2(255), TENANT_ID_ VARCHAR2(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD TENANT_ID_ VARCHAR2(255) DEFAULT ''; + +ALTER TABLE ACT_CMMN_HI_MIL_INST ADD TENANT_ID_ VARCHAR2(255) DEFAULT ''; + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6400.to.6410.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6400.to.6410.cmmn.sql new file mode 100644 index 00000000000..bffe5037c2a --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6400.to.6410.cmmn.sql @@ -0,0 +1,35 @@ +CREATE UNIQUE INDEX ACT_IDX_CASE_DEF_UNIQ ON ACT_CMMN_CASEDEF(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST RENAME COLUMN START_TIME_ TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST RENAME COLUMN CREATED_TIME_ TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_AVAILABLE_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_ENABLED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_DISABLED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_STARTED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_SUSPENDED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD COMPLETED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD OCCURRED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD TERMINATED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENDED_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR2(255); + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6501.to.6502.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6501.to.6502.cmmn.sql new file mode 100644 index 00000000000..a939172f88a --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6501.to.6502.cmmn.sql @@ -0,0 +1,21 @@ +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD SHOW_IN_OVERVIEW_ NUMBER(1); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_TYPE_ VARCHAR2(255); + +CREATE INDEX ACT_IDX_CASE_INST_REF_ID_ ON ACT_CMMN_RU_CASE_INST(REFERENCE_ID_); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_TYPE_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR2(255); + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6511.to.6512.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6511.to.6512.cmmn.sql new file mode 100644 index 00000000000..c2138469246 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6511.to.6512.cmmn.sql @@ -0,0 +1,7 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_OWNER_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP(3); + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6601.to.6610.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6601.to.6610.cmmn.sql new file mode 100644 index 00000000000..1c160f67f7d --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6601.to.6610.cmmn.sql @@ -0,0 +1,9 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP(3); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR2(255); + + diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6701.to.6710.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6701.to.6710.cmmn.sql new file mode 100644 index 00000000000..8265519e822 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6701.to.6710.cmmn.sql @@ -0,0 +1,3 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD BUSINESS_STATUS_ VARCHAR2(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD BUSINESS_STATUS_ VARCHAR2(255); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6723.to.6800.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6723.to.6800.cmmn.sql new file mode 100644 index 00000000000..31273e933a5 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.6723.to.6800.cmmn.sql @@ -0,0 +1 @@ +CREATE INDEX ACT_IDX_HI_CASE_INST_END ON ACT_CMMN_HI_CASE_INST(END_TIME_); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.7000.to.7010.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.7000.to.7010.cmmn.sql new file mode 100644 index 00000000000..7854c48581d --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.oracle.upgradestep.7000.to.7010.cmmn.sql @@ -0,0 +1 @@ +CREATE INDEX ACT_IDX_HI_PLAN_ITEM_INST_CASE ON ACT_CMMN_HI_PLAN_ITEM_INST(CASE_INST_ID_); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6120.to.6200.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6120.to.6200.cmmn.sql new file mode 100644 index 00000000000..4c0f4039419 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6120.to.6200.cmmn.sql @@ -0,0 +1,59 @@ +CREATE TABLE ACT_CMMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), KEY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP WITHOUT TIME ZONE, PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BYTEA, CONSTRAINT PK_CMMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD CONSTRAINT ACT_FK_CMMN_RSRC_DPL FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CMMN_RSRC_DPL ON ACT_CMMN_DEPLOYMENT_RESOURCE(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_CASEDEF (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255) NOT NULL, VERSION_ INT NOT NULL, CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(4000), DESCRIPTION_ VARCHAR(4000), HAS_GRAPHICAL_NOTATION_ BOOLEAN, TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_CASEDEF PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_CASEDEF ADD CONSTRAINT ACT_FK_CASE_DEF_DPLY FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES ACT_CMMN_DEPLOYMENT (ID_); + +CREATE INDEX ACT_IDX_CASE_DEF_DPLY ON ACT_CMMN_CASEDEF(DEPLOYMENT_ID_); + +CREATE TABLE ACT_CMMN_RU_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP WITHOUT TIME ZONE, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_RU_CASE_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD CONSTRAINT ACT_FK_CASE_INST_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_CASE_INST_CASE_DEF ON ACT_CMMN_RU_CASE_INST(CASE_DEF_ID_); + +CREATE INDEX ACT_IDX_CASE_INST_PARENT ON ACT_CMMN_RU_CASE_INST(PARENT_ID_); + +CREATE TABLE ACT_CMMN_RU_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), NAME_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP WITHOUT TIME ZONE, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_CMMN_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_DEF ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD CONSTRAINT ACT_FK_PLAN_ITEM_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_PLAN_ITEM_CASE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_SENTRY_PART_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), PLAN_ITEM_INST_ID_ VARCHAR(255), ON_PART_ID_ VARCHAR(255), IF_PART_ID_ VARCHAR(255), TIME_STAMP_ TIMESTAMP WITHOUT TIME ZONE, CONSTRAINT PK_CMMN_SENTRY_PART_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_DEF ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_CASE_INST ON ACT_CMMN_RU_SENTRY_PART_INST(CASE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_SENTRY_PART_INST ADD CONSTRAINT ACT_FK_SENTRY_PLAN_ITEM FOREIGN KEY (PLAN_ITEM_INST_ID_) REFERENCES ACT_CMMN_RU_PLAN_ITEM_INST (ID_); + +CREATE INDEX ACT_IDX_SENTRY_PLAN_ITEM ON ACT_CMMN_RU_SENTRY_PART_INST(PLAN_ITEM_INST_ID_); + +CREATE TABLE ACT_CMMN_RU_MIL_INST (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP WITHOUT TIME ZONE NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_RU_MIL_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_DEF FOREIGN KEY (CASE_DEF_ID_) REFERENCES ACT_CMMN_CASEDEF (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_DEF ON ACT_CMMN_RU_MIL_INST(CASE_DEF_ID_); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD CONSTRAINT ACT_FK_MIL_CASE_INST FOREIGN KEY (CASE_INST_ID_) REFERENCES ACT_CMMN_RU_CASE_INST (ID_); + +CREATE INDEX ACT_IDX_MIL_CASE_INST ON ACT_CMMN_RU_MIL_INST(CASE_INST_ID_); + +CREATE TABLE ACT_CMMN_HI_CASE_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, BUSINESS_KEY_ VARCHAR(255), NAME_ VARCHAR(255), PARENT_ID_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), STATE_ VARCHAR(255), START_TIME_ TIMESTAMP WITHOUT TIME ZONE, END_TIME_ TIMESTAMP WITHOUT TIME ZONE, START_USER_ID_ VARCHAR(255), CALLBACK_ID_ VARCHAR(255), CALLBACK_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_CASE_INST PRIMARY KEY (ID_)); + +CREATE TABLE ACT_CMMN_HI_MIL_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255) NOT NULL, TIME_STAMP_ TIMESTAMP WITHOUT TIME ZONE NOT NULL, CASE_INST_ID_ VARCHAR(255) NOT NULL, CASE_DEF_ID_ VARCHAR(255) NOT NULL, ELEMENT_ID_ VARCHAR(255) NOT NULL, CONSTRAINT PK_ACT_CMMN_HI_MIL_INST PRIMARY KEY (ID_)); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6200.to.6210.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6200.to.6210.cmmn.sql new file mode 100644 index 00000000000..2e70b47d00c --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6200.to.6210.cmmn.sql @@ -0,0 +1,11 @@ +ALTER TABLE ACT_CMMN_CASEDEF ADD DGRM_RESOURCE_NAME_ VARCHAR(4000); + +ALTER TABLE ACT_CMMN_CASEDEF ADD HAS_START_FORM_KEY_ BOOLEAN; + +ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD GENERATED_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_TIME_ TIMESTAMP WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ITEM_DEFINITION_TYPE_ VARCHAR(255); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6210.to.6300.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6210.to.6300.cmmn.sql new file mode 100644 index 00000000000..18e93f1e8d5 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6210.to.6300.cmmn.sql @@ -0,0 +1,11 @@ +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COMPLETEABLE_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD IS_COMPLETEABLE_ BOOLEAN; + +CREATE INDEX ACT_IDX_PLAN_ITEM_STAGE_INST ON ACT_CMMN_RU_PLAN_ITEM_INST(STAGE_INST_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD IS_COUNT_ENABLED_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD VAR_COUNT_ INTEGER; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD SENTRY_PART_INST_COUNT_ INTEGER; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6300.to.6301.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6300.to.6301.cmmn.sql new file mode 100644 index 00000000000..34b16cbca11 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6300.to.6301.cmmn.sql @@ -0,0 +1,5 @@ +CREATE TABLE ACT_CMMN_HI_PLAN_ITEM_INST (ID_ VARCHAR(255) NOT NULL, REV_ INT NOT NULL, NAME_ VARCHAR(255), STATE_ VARCHAR(255), CASE_DEF_ID_ VARCHAR(255), CASE_INST_ID_ VARCHAR(255), STAGE_INST_ID_ VARCHAR(255), IS_STAGE_ BOOLEAN, ELEMENT_ID_ VARCHAR(255), ITEM_DEFINITION_ID_ VARCHAR(255), ITEM_DEFINITION_TYPE_ VARCHAR(255), CREATED_TIME_ TIMESTAMP WITHOUT TIME ZONE, LAST_AVAILABLE_TIME_ TIMESTAMP WITHOUT TIME ZONE, LAST_ENABLED_TIME_ TIMESTAMP WITHOUT TIME ZONE, LAST_DISABLED_TIME_ TIMESTAMP WITHOUT TIME ZONE, LAST_STARTED_TIME_ TIMESTAMP WITHOUT TIME ZONE, LAST_SUSPENDED_TIME_ TIMESTAMP WITHOUT TIME ZONE, COMPLETED_TIME_ TIMESTAMP WITHOUT TIME ZONE, OCCURRED_TIME_ TIMESTAMP WITHOUT TIME ZONE, TERMINATED_TIME_ TIMESTAMP WITHOUT TIME ZONE, EXIT_TIME_ TIMESTAMP WITHOUT TIME ZONE, ENDED_TIME_ TIMESTAMP WITHOUT TIME ZONE, LAST_UPDATED_TIME_ TIMESTAMP WITHOUT TIME ZONE, START_USER_ID_ VARCHAR(255), REFERENCE_ID_ VARCHAR(255), REFERENCE_TYPE_ VARCHAR(255), TENANT_ID_ VARCHAR(255) DEFAULT '', CONSTRAINT PK_ACT_CMMN_HI_PLAN_ITEM_INST PRIMARY KEY (ID_)); + +ALTER TABLE ACT_CMMN_RU_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT ''; + +ALTER TABLE ACT_CMMN_HI_MIL_INST ADD TENANT_ID_ VARCHAR(255) DEFAULT ''; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6400.to.6410.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6400.to.6410.cmmn.sql new file mode 100644 index 00000000000..5c17d76da85 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6400.to.6410.cmmn.sql @@ -0,0 +1,33 @@ +CREATE UNIQUE INDEX ACT_IDX_CASE_DEF_UNIQ ON ACT_CMMN_CASEDEF(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST RENAME COLUMN START_TIME_ TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST RENAME COLUMN CREATED_TIME_ TO CREATE_TIME_; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_AVAILABLE_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_ENABLED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_DISABLED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_STARTED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_SUSPENDED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD COMPLETED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD OCCURRED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD TERMINATED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENDED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR(255); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6501.to.6502.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6501.to.6502.cmmn.sql new file mode 100644 index 00000000000..2fc19f4c58b --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6501.to.6502.cmmn.sql @@ -0,0 +1,19 @@ +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD SHOW_IN_OVERVIEW_ BOOLEAN; + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXTRA_VALUE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255); + +CREATE INDEX ACT_IDX_CASE_INST_REF_ID_ ON ACT_CMMN_RU_CASE_INST(REFERENCE_ID_); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD REFERENCE_TYPE_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD DERIVED_CASE_DEF_ID_ VARCHAR(255); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6511.to.6512.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6511.to.6512.cmmn.sql new file mode 100644 index 00000000000..6675b30c851 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6511.to.6512.cmmn.sql @@ -0,0 +1,5 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LOCK_OWNER_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD LAST_UNAVAILABLE_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6601.to.6610.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6601.to.6610.cmmn.sql new file mode 100644 index 00000000000..8e41cec91ca --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6601.to.6610.cmmn.sql @@ -0,0 +1,7 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE; + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD LAST_REACTIVATION_USER_ID_ VARCHAR(255); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6701.to.6710.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6701.to.6710.cmmn.sql new file mode 100644 index 00000000000..548bb70cc5c --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6701.to.6710.cmmn.sql @@ -0,0 +1,3 @@ +ALTER TABLE ACT_CMMN_RU_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255); + +ALTER TABLE ACT_CMMN_HI_CASE_INST ADD BUSINESS_STATUS_ VARCHAR(255); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6723.to.6800.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6723.to.6800.cmmn.sql new file mode 100644 index 00000000000..31273e933a5 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.6723.to.6800.cmmn.sql @@ -0,0 +1 @@ +CREATE INDEX ACT_IDX_HI_CASE_INST_END ON ACT_CMMN_HI_CASE_INST(END_TIME_); diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.7000.to.7010.cmmn.sql b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.7000.to.7010.cmmn.sql new file mode 100644 index 00000000000..7854c48581d --- /dev/null +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/upgrade/flowable.postgres.upgradestep.7000.to.7010.cmmn.sql @@ -0,0 +1 @@ +CREATE INDEX ACT_IDX_HI_PLAN_ITEM_INST_CASE ON ACT_CMMN_HI_PLAN_ITEM_INST(CASE_INST_ID_); diff --git a/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/initialization/CmmnEngineInitializationTest.java b/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/initialization/CmmnEngineInitializationTest.java new file mode 100644 index 00000000000..f5f704ca056 --- /dev/null +++ b/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/initialization/CmmnEngineInitializationTest.java @@ -0,0 +1,105 @@ +/* Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flowable.cmmn.test.initialization; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Consumer; + +import org.apache.ibatis.session.SqlSession; +import org.apache.ibatis.session.SqlSessionFactory; +import org.flowable.cmmn.engine.CmmnEngine; +import org.flowable.cmmn.engine.CmmnEngineConfiguration; +import org.flowable.common.engine.api.FlowableException; +import org.flowable.common.engine.api.FlowableWrongDbException; +import org.flowable.common.engine.impl.AbstractEngineConfiguration; +import org.flowable.common.engine.impl.db.DbSqlSession; +import org.flowable.common.engine.impl.db.DbSqlSessionFactory; +import org.flowable.common.engine.impl.db.SchemaOperationsEngineDropDbCmd; +import org.junit.jupiter.api.Test; + +/** + * @author Filip Hrisafov + */ +class CmmnEngineInitializationTest { + + @Test + void noTables() { + CmmnEngineConfiguration engineConfiguration = CmmnEngineConfiguration.createCmmnEngineConfigurationFromResource( + "org/flowable/cmmn/test/initialization/notables.flowable.cmmn.cfg.xml"); + + assertThatThrownBy(engineConfiguration::buildEngine) + .isInstanceOf(FlowableException.class) + .hasMessageContaining("No flowable tables in DB"); + } + + @Test + void versionMismatch() { + // first create the schema + CmmnEngineConfiguration engineConfiguration = CmmnEngineConfiguration.createCmmnEngineConfigurationFromResource( + "org/flowable/cmmn/test/initialization/notables.flowable.cmmn.cfg.xml"); + engineConfiguration.setDatabaseSchemaUpdate(AbstractEngineConfiguration.DB_SCHEMA_UPDATE_CREATE); + + try { + CmmnEngine cmmnEngine = engineConfiguration.buildEngine(); + + // then update the version to something that is different to the library version + DbSqlSessionFactory dbSqlSessionFactory = (DbSqlSessionFactory) cmmnEngine.getCmmnEngineConfiguration() + .getSessionFactories() + .get(DbSqlSession.class); + SqlSessionFactory sqlSessionFactory = dbSqlSessionFactory.getSqlSessionFactory(); + SqlSession sqlSession = sqlSessionFactory.openSession(); + boolean success = false; + try { + Map parameters = new HashMap<>(); + parameters.put("name", "cmmn.schema.version"); + parameters.put("value", "25.7"); + parameters.put("revision", 1); + parameters.put("newRevision", 2); + sqlSession.update("updateProperty", parameters); + success = true; + } catch (Exception e) { + throw new FlowableException("couldn't update db schema version", e); + } finally { + if (success) { + sqlSession.commit(); + } else { + sqlSession.rollback(); + } + sqlSession.close(); + } + + // now we can see what happens if when a cmmn engine is being + // build with a version mismatch between library and db tables + Consumer flowableWrongDbExceptionRequirements = flowableWrongDbException -> { + assertThat(flowableWrongDbException.getDbVersion()).isEqualTo("25.7"); + assertThat(flowableWrongDbException.getLibraryVersion()).isEqualTo(CmmnEngine.VERSION); + }; + assertThatThrownBy(() -> CmmnEngineConfiguration + .createCmmnEngineConfigurationFromResource("org/flowable/cmmn/test/initialization/notables.flowable.cmmn.cfg.xml") + .buildCmmnEngine()) + .isInstanceOfSatisfying(FlowableWrongDbException.class, flowableWrongDbExceptionRequirements) + .hasMessageContaining("version mismatch"); + + // closing the original process engine to drop the db tables + cmmnEngine.close(); + } finally { + engineConfiguration.getCommandExecutor().execute(new SchemaOperationsEngineDropDbCmd(engineConfiguration.getEngineScopeType())); + } + + } + +} diff --git a/modules/flowable-cmmn-engine/src/test/resources/log4j.properties b/modules/flowable-cmmn-engine/src/test/resources/log4j.properties index af13413e8dc..e7d24815f3a 100644 --- a/modules/flowable-cmmn-engine/src/test/resources/log4j.properties +++ b/modules/flowable-cmmn-engine/src/test/resources/log4j.properties @@ -9,7 +9,6 @@ log4j.appender.CA.layout.ConversionPattern= %d{hh:mm:ss,SSS} [%t] %-5p %c %x - % log4j.logger.org.apache.ibatis=DEBUG log4j.logger.jakarta.activation=INFO log4j.logger.org.springframework=INFO -log4j.logger.liquibase=INFO log4j.logger.org.flowable.task.service.impl.persistence=DEBUG log4j.logger.org.flowable.cmmn.engine.impl.agenda=DEBUG diff --git a/modules/flowable-cmmn-engine/src/test/resources/org/flowable/cmmn/test/initialization/notables.flowable.cmmn.cfg.xml b/modules/flowable-cmmn-engine/src/test/resources/org/flowable/cmmn/test/initialization/notables.flowable.cmmn.cfg.xml new file mode 100644 index 00000000000..7ebea60175d --- /dev/null +++ b/modules/flowable-cmmn-engine/src/test/resources/org/flowable/cmmn/test/initialization/notables.flowable.cmmn.cfg.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/modules/flowable-cmmn-rest/src/test/java/org/flowable/cmmn/rest/service/BaseSpringRestTestCase.java b/modules/flowable-cmmn-rest/src/test/java/org/flowable/cmmn/rest/service/BaseSpringRestTestCase.java index 12313f9a806..0e1cdd0066a 100644 --- a/modules/flowable-cmmn-rest/src/test/java/org/flowable/cmmn/rest/service/BaseSpringRestTestCase.java +++ b/modules/flowable-cmmn-rest/src/test/java/org/flowable/cmmn/rest/service/BaseSpringRestTestCase.java @@ -312,12 +312,7 @@ protected void assertAndEnsureCleanDb() throws Throwable { cmmnEngineConfiguration, TABLENAMES_EXCLUDED_FROM_DB_CLEAN_CHECK, exception == null, - commandContext -> { - SchemaManager schemaManager = CommandContextUtil.getCmmnEngineConfiguration(commandContext).getSchemaManager(); - schemaManager.schemaDrop(); - schemaManager.schemaCreate(); - return null; - } + cmmnEngineConfiguration.getSchemaManagementCmd() ); } diff --git a/modules/flowable-cmmn-spring-configurator/src/main/java/org/flowable/cmmn/spring/configurator/SpringCmmnEngineConfigurator.java b/modules/flowable-cmmn-spring-configurator/src/main/java/org/flowable/cmmn/spring/configurator/SpringCmmnEngineConfigurator.java index 65c59f6c850..9d766e48a66 100644 --- a/modules/flowable-cmmn-spring-configurator/src/main/java/org/flowable/cmmn/spring/configurator/SpringCmmnEngineConfigurator.java +++ b/modules/flowable-cmmn-spring-configurator/src/main/java/org/flowable/cmmn/spring/configurator/SpringCmmnEngineConfigurator.java @@ -12,7 +12,6 @@ */ package org.flowable.cmmn.spring.configurator; -import org.flowable.cmmn.engine.CmmnEngine; import org.flowable.cmmn.engine.configurator.CmmnEngineConfigurator; import org.flowable.cmmn.spring.SpringCmmnEngineConfiguration; import org.flowable.common.engine.api.FlowableException; @@ -62,7 +61,7 @@ public void configure(AbstractEngineConfiguration engineConfiguration) { cmmnEngineConfiguration.setBeans(springEngineConfiguration.getBeans()); } - initCmmnEngine(); + initEngine(); if (springProcessEngineConfiguration != null) { cmmnEngineConfiguration.getJobServiceConfiguration().getInternalJobManager() @@ -81,15 +80,6 @@ public void configure(AbstractEngineConfiguration engineConfiguration) { initServiceConfigurations(engineConfiguration, cmmnEngineConfiguration); } - @Override - protected synchronized CmmnEngine initCmmnEngine() { - if (cmmnEngineConfiguration == null) { - throw new FlowableException("CmmnEngineConfiguration is required"); - } - - return cmmnEngineConfiguration.buildCmmnEngine(); - } - @Override public SpringCmmnEngineConfiguration getCmmnEngineConfiguration() { return (SpringCmmnEngineConfiguration) cmmnEngineConfiguration; diff --git a/modules/flowable-cmmn-spring/src/main/java/org/flowable/cmmn/spring/SpringCmmnEngineConfiguration.java b/modules/flowable-cmmn-spring/src/main/java/org/flowable/cmmn/spring/SpringCmmnEngineConfiguration.java index f16ce92a526..82b961680ef 100644 --- a/modules/flowable-cmmn-spring/src/main/java/org/flowable/cmmn/spring/SpringCmmnEngineConfiguration.java +++ b/modules/flowable-cmmn-spring/src/main/java/org/flowable/cmmn/spring/SpringCmmnEngineConfiguration.java @@ -68,8 +68,8 @@ public SpringCmmnEngineConfiguration() { } @Override - public CmmnEngine buildCmmnEngine() { - CmmnEngine cmmnEngine = super.buildCmmnEngine(); + public CmmnEngine buildEngine() { + CmmnEngine cmmnEngine = super.buildEngine(); CmmnEngines.setInitialized(true); enginesBuild.add(cmmnEngine.getName()); return cmmnEngine; diff --git a/modules/flowable-cmmn-spring/src/main/java/org/flowable/cmmn/spring/autodeployment/AbstractCmmnAutoDeploymentStrategy.java b/modules/flowable-cmmn-spring/src/main/java/org/flowable/cmmn/spring/autodeployment/AbstractCmmnAutoDeploymentStrategy.java index d1ad10149b8..11308ac3e7a 100644 --- a/modules/flowable-cmmn-spring/src/main/java/org/flowable/cmmn/spring/autodeployment/AbstractCmmnAutoDeploymentStrategy.java +++ b/modules/flowable-cmmn-spring/src/main/java/org/flowable/cmmn/spring/autodeployment/AbstractCmmnAutoDeploymentStrategy.java @@ -19,7 +19,7 @@ import org.flowable.cmmn.api.repository.CmmnDeploymentBuilder; import org.flowable.cmmn.engine.CmmnEngine; -import org.flowable.common.engine.impl.lock.LockManager; +import org.flowable.common.engine.api.lock.LockManager; import org.flowable.common.spring.CommonAutoDeploymentProperties; import org.flowable.common.spring.CommonAutoDeploymentStrategy; import org.springframework.core.io.Resource; diff --git a/modules/flowable-dmn-api/src/main/java/org/flowable/dmn/api/DmnManagementService.java b/modules/flowable-dmn-api/src/main/java/org/flowable/dmn/api/DmnManagementService.java index dacd7afac7e..da9679acfaf 100644 --- a/modules/flowable-dmn-api/src/main/java/org/flowable/dmn/api/DmnManagementService.java +++ b/modules/flowable-dmn-api/src/main/java/org/flowable/dmn/api/DmnManagementService.java @@ -14,6 +14,7 @@ import java.util.Map; +import org.flowable.common.engine.api.lock.LockManager; import org.flowable.common.engine.api.management.TableMetaData; import org.flowable.common.engine.api.management.TablePageQuery; import org.flowable.common.engine.api.tenant.ChangeTenantIdBuilder; @@ -54,4 +55,15 @@ public interface DmnManagementService { */ ChangeTenantIdBuilder createChangeTenantIdBuilder(String fromTenantId, String toTenantId); + /** + * Acquire a lock manager for the requested lock. + * This is a stateless call, this means that every time a lock manager + * is requested a new one would be created. Make sure that you release the lock + * once you are done. + * + * @param lockName the name of the lock that is being requested + * + * @return the lock manager for the given lock + */ + LockManager getLockManager(String lockName); } diff --git a/modules/flowable-dmn-engine-configurator/src/main/java/org/flowable/dmn/engine/configurator/DmnEngineConfigurator.java b/modules/flowable-dmn-engine-configurator/src/main/java/org/flowable/dmn/engine/configurator/DmnEngineConfigurator.java index 0fa940796e0..39ff7cd0384 100644 --- a/modules/flowable-dmn-engine-configurator/src/main/java/org/flowable/dmn/engine/configurator/DmnEngineConfigurator.java +++ b/modules/flowable-dmn-engine-configurator/src/main/java/org/flowable/dmn/engine/configurator/DmnEngineConfigurator.java @@ -31,7 +31,7 @@ * @author Tijs Rademakers * @author Joram Barrez */ -public class DmnEngineConfigurator extends AbstractEngineConfigurator { +public class DmnEngineConfigurator extends AbstractEngineConfigurator { protected DmnEngineConfiguration dmnEngineConfiguration; @@ -60,7 +60,7 @@ public void configure(AbstractEngineConfiguration engineConfiguration) { initialiseCommonProperties(engineConfiguration, dmnEngineConfiguration); - initDmnEngine(); + initEngine(); initServiceConfigurations(engineConfiguration, dmnEngineConfiguration); } @@ -75,7 +75,8 @@ protected List> getEntityDeletionOrder() { return EntityDependencyOrder.DELETE_ORDER; } - protected synchronized DmnEngine initDmnEngine() { + @Override + protected DmnEngine buildEngine() { if (dmnEngineConfiguration == null) { throw new FlowableException("DmnEngineConfiguration is required"); } diff --git a/modules/flowable-dmn-engine/pom.xml b/modules/flowable-dmn-engine/pom.xml index 55b63b32a1a..a41d11a5938 100755 --- a/modules/flowable-dmn-engine/pom.xml +++ b/modules/flowable-dmn-engine/pom.xml @@ -17,6 +17,12 @@ org.flowable.dmn.engine + + org.flowable.dmn.db.create, + org.flowable.dmn.db.upgrade, + org.flowable.dmn.db.mapping, + org.flowable.dmn.db.mapping.entity, + org.springframework*;resolution:=optional, @@ -82,11 +88,6 @@ - - org.liquibase - liquibase-core - - com.h2database h2 diff --git a/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/DmnEngineConfiguration.java b/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/DmnEngineConfiguration.java index 7af73cec92f..10a350b0b63 100755 --- a/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/DmnEngineConfiguration.java +++ b/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/DmnEngineConfiguration.java @@ -28,10 +28,12 @@ import org.apache.ibatis.transaction.TransactionFactory; import org.flowable.common.engine.api.delegate.FlowableFunctionDelegate; import org.flowable.common.engine.api.scope.ScopeTypes; +import org.flowable.common.engine.impl.AbstractBuildableEngineConfiguration; import org.flowable.common.engine.impl.AbstractEngineConfiguration; import org.flowable.common.engine.impl.HasExpressionManagerEngineConfiguration; import org.flowable.common.engine.impl.cfg.BeansConfigurationHelper; import org.flowable.common.engine.impl.db.DbSqlSessionFactory; +import org.flowable.common.engine.impl.db.SchemaManager; import org.flowable.common.engine.impl.el.DefaultExpressionManager; import org.flowable.common.engine.impl.el.ExpressionManager; import org.flowable.common.engine.impl.interceptor.CommandInterceptor; @@ -52,6 +54,7 @@ import org.flowable.dmn.api.DmnRepositoryService; import org.flowable.dmn.engine.impl.DmnDecisionServiceImpl; import org.flowable.dmn.engine.impl.DmnEngineImpl; +import org.flowable.dmn.engine.impl.DmnEnginePostEngineBuildConsumer; import org.flowable.dmn.engine.impl.DmnHistoryServiceImpl; import org.flowable.dmn.engine.impl.DmnManagementServiceImpl; import org.flowable.dmn.engine.impl.DmnRepositoryServiceImpl; @@ -61,7 +64,6 @@ import org.flowable.dmn.engine.impl.agenda.DmnEngineAgendaSessionFactory; import org.flowable.dmn.engine.impl.cfg.StandaloneDmnEngineConfiguration; import org.flowable.dmn.engine.impl.cfg.StandaloneInMemDmnEngineConfiguration; -import org.flowable.dmn.engine.impl.cmd.SchemaOperationsDmnEngineBuild; import org.flowable.dmn.engine.impl.db.DmnDbSchemaManager; import org.flowable.dmn.engine.impl.db.EntityDependencyOrder; import org.flowable.dmn.engine.impl.deployer.CachingAndArtifactsManager; @@ -113,13 +115,11 @@ import org.flowable.dmn.image.DecisionRequirementsDiagramGenerator; import org.flowable.dmn.image.impl.DefaultDecisionRequirementsDiagramGenerator; -public class DmnEngineConfiguration extends AbstractEngineConfiguration +public class DmnEngineConfiguration extends AbstractBuildableEngineConfiguration implements DmnEngineConfigurationApi, HasExpressionManagerEngineConfiguration { public static final String DEFAULT_MYBATIS_MAPPING_FILE = "org/flowable/dmn/db/mapping/mappings.xml"; - public static final String LIQUIBASE_CHANGELOG_PREFIX = "ACT_DMN_"; - protected String dmnEngineName = DmnEngines.NAME_DEFAULT; protected DmnEngineAgendaFactory dmnEngineAgendaFactory; @@ -239,14 +239,24 @@ public static DmnEngineConfiguration createStandaloneInMemDmnEngineConfiguration // buildDmnEngine // /////////////////////////////////////////////////////// - public DmnEngine buildDmnEngine() { - init(); + @Override + protected DmnEngine createEngine() { return new DmnEngineImpl(this); } + @Override + protected Consumer createPostEngineBuildConsumer() { + return new DmnEnginePostEngineBuildConsumer(); + } + + public DmnEngine buildDmnEngine() { + return buildEngine(); + } + // init // ///////////////////////////////////////////////////////////////////// + @Override protected void init() { initEngineConfigurations(); initClock(); @@ -337,19 +347,8 @@ public void initEntityManagers() { // /////////////////////////////////////////////////////////////// @Override - public void initSchemaManager() { - super.initSchemaManager(); - if (this.schemaManager == null) { - this.schemaManager = new DmnDbSchemaManager(); - } - } - - public void initSchemaManagementCommand() { - if (schemaManagementCmd == null) { - if (usingRelationalDatabase && databaseSchemaUpdate != null) { - this.schemaManagementCmd = new SchemaOperationsDmnEngineBuild(); - } - } + protected SchemaManager createEngineSchemaManager() { + return new DmnDbSchemaManager(); } // session factories //////////////////////////////////////////////////////// diff --git a/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/DmnEnginePostEngineBuildConsumer.java b/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/DmnEnginePostEngineBuildConsumer.java new file mode 100644 index 00000000000..41c9d6953ba --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/DmnEnginePostEngineBuildConsumer.java @@ -0,0 +1,35 @@ +/* Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flowable.dmn.engine.impl; + +import java.util.function.Consumer; + +import org.flowable.common.engine.api.engine.EngineLifecycleListener; +import org.flowable.dmn.engine.DmnEngine; +import org.flowable.dmn.engine.DmnEngineConfiguration; + +/** + * @author Filip Hrisafov + */ +public class DmnEnginePostEngineBuildConsumer implements Consumer { + + @Override + public void accept(DmnEngine dmnEngine) { + DmnEngineConfiguration engineConfiguration = dmnEngine.getDmnEngineConfiguration(); + if (engineConfiguration.getEngineLifecycleListeners() != null) { + for (EngineLifecycleListener engineLifecycleListener : engineConfiguration.getEngineLifecycleListeners()) { + engineLifecycleListener.onEngineBuilt(dmnEngine); + } + } + } +} diff --git a/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/DmnManagementServiceImpl.java b/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/DmnManagementServiceImpl.java index f2daa39c027..e5fbbb0a5d7 100755 --- a/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/DmnManagementServiceImpl.java +++ b/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/DmnManagementServiceImpl.java @@ -14,12 +14,14 @@ import java.util.Map; +import org.flowable.common.engine.api.lock.LockManager; import org.flowable.common.engine.api.management.TableMetaData; import org.flowable.common.engine.api.management.TablePageQuery; import org.flowable.common.engine.api.tenant.ChangeTenantIdBuilder; import org.flowable.common.engine.impl.cmd.CustomSqlExecution; import org.flowable.common.engine.impl.cmd.GetTableCountCmd; import org.flowable.common.engine.impl.cmd.GetTableMetaDataCmd; +import org.flowable.common.engine.impl.lock.LockManagerImpl; import org.flowable.common.engine.impl.persistence.entity.TablePageQueryImpl; import org.flowable.common.engine.impl.service.CommonEngineServiceImpl; import org.flowable.common.engine.impl.tenant.ChangeTenantIdBuilderImpl; @@ -66,5 +68,10 @@ public ResultType executeCustomSql(CustomSqlExecution { - - @Override - public Void execute(CommandContext commandContext) { - ((DmnDbSchemaManager) CommandContextUtil.getDmnEngineConfiguration(commandContext).getSchemaManager()).initSchema(); - return null; - } - -} diff --git a/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/db/DbSchemaDrop.java b/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/db/DbSchemaDrop.java index d89b446d3b0..016382c1c14 100644 --- a/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/db/DbSchemaDrop.java +++ b/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/db/DbSchemaDrop.java @@ -13,19 +13,11 @@ package org.flowable.dmn.engine.impl.db; -import javax.sql.DataSource; - -import org.apache.commons.lang3.StringUtils; -import org.flowable.dmn.engine.DmnEngine; -import org.flowable.dmn.engine.DmnEngineConfiguration; +import org.flowable.common.engine.impl.db.SchemaOperationsEngineDropDbCmd; +import org.flowable.common.engine.impl.interceptor.CommandConfig; +import org.flowable.common.engine.impl.interceptor.CommandExecutor; import org.flowable.dmn.engine.DmnEngines; - -import liquibase.Liquibase; -import liquibase.database.Database; -import liquibase.database.DatabaseConnection; -import liquibase.database.DatabaseFactory; -import liquibase.database.jvm.JdbcConnection; -import liquibase.resource.ClassLoaderResourceAccessor; +import org.flowable.dmn.engine.impl.DmnEngineImpl; /** * @author Tijs Rademakers @@ -33,31 +25,9 @@ public class DbSchemaDrop { public static void main(String[] args) { - try { - DmnEngine dmnEngine = DmnEngines.getDefaultDmnEngine(); - DataSource dataSource = dmnEngine.getDmnEngineConfiguration().getDataSource(); - - DatabaseConnection connection = new JdbcConnection(dataSource.getConnection()); - Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(connection); - database.setDatabaseChangeLogTableName(DmnEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogTableName()); - database.setDatabaseChangeLogLockTableName(DmnEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogLockTableName()); - - if (StringUtils.isNotEmpty(dmnEngine.getDmnEngineConfiguration().getDatabaseSchema())) { - database.setDefaultSchemaName(dmnEngine.getDmnEngineConfiguration().getDatabaseSchema()); - database.setLiquibaseSchemaName(dmnEngine.getDmnEngineConfiguration().getDatabaseSchema()); - } - - if (StringUtils.isNotEmpty(dmnEngine.getDmnEngineConfiguration().getDatabaseCatalog())) { - database.setDefaultCatalogName(dmnEngine.getDmnEngineConfiguration().getDatabaseCatalog()); - database.setLiquibaseCatalogName(dmnEngine.getDmnEngineConfiguration().getDatabaseCatalog()); - } - - Liquibase liquibase = new Liquibase("org/flowable/dmn/db/liquibase/flowable-dmn-db-changelog.xml", new ClassLoaderResourceAccessor(), database); - liquibase.dropAll(); - liquibase.getDatabase().close(); - - } catch (Exception e) { - e.printStackTrace(); - } + DmnEngineImpl dmnEngine = (DmnEngineImpl) DmnEngines.getDefaultDmnEngine(); + CommandExecutor commandExecutor = dmnEngine.getDmnEngineConfiguration().getCommandExecutor(); + CommandConfig config = new CommandConfig().transactionNotSupported(); + commandExecutor.execute(config, new SchemaOperationsEngineDropDbCmd(dmnEngine.getDmnEngineConfiguration().getEngineScopeType())); } } diff --git a/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/db/DmnDbSchemaManager.java b/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/db/DmnDbSchemaManager.java index 961c861cae6..832039cc4ce 100644 --- a/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/db/DmnDbSchemaManager.java +++ b/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/db/DmnDbSchemaManager.java @@ -13,58 +13,80 @@ package org.flowable.dmn.engine.impl.db; -import org.flowable.common.engine.impl.db.EngineDatabaseConfiguration; -import org.flowable.common.engine.impl.db.LiquibaseBasedSchemaManager; -import org.flowable.common.engine.impl.db.LiquibaseDatabaseConfiguration; -import org.flowable.common.engine.impl.db.SchemaManager; -import org.flowable.dmn.engine.DmnEngineConfiguration; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.flowable.common.engine.impl.AbstractEngineConfiguration; +import org.flowable.common.engine.impl.db.EngineSqlScriptBasedDbSchemaManager; +import org.flowable.dmn.engine.DmnEngine; import org.flowable.dmn.engine.impl.util.CommandContextUtil; -public class DmnDbSchemaManager extends LiquibaseBasedSchemaManager { - - public static final String LIQUIBASE_CHANGELOG = "org/flowable/dmn/db/liquibase/flowable-dmn-db-changelog.xml"; +public class DmnDbSchemaManager extends EngineSqlScriptBasedDbSchemaManager { + + protected static final String DMN_DB_SCHEMA_LOCK_NAME = "dmnDbSchemaLock"; + + protected static final Map changeLogVersionMap = Map.ofEntries( + Map.entry("1", "6.0.0.5"), + Map.entry("2", "6.1.1.0"), + Map.entry("3", "6.3.0.0"), + Map.entry("4", "6.3.1.0"), + Map.entry("5", "6.4.0.0"), + Map.entry("6", "6.4.1.3"), + Map.entry("7", "6.6.0.0"), + Map.entry("8", "6.6.0.0"), + Map.entry("9", "6.8.0.0"), + Map.entry("10", "7.1.0.0") + ); public DmnDbSchemaManager() { - super("dmn", LIQUIBASE_CHANGELOG, DmnEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX); + super("dmn"); } @Override - protected LiquibaseDatabaseConfiguration getDatabaseConfiguration() { - return new EngineDatabaseConfiguration(CommandContextUtil.getDmnEngineConfiguration()); + protected String getEngineVersion() { + return DmnEngine.VERSION; } - public void initSchema() { - initSchema(CommandContextUtil.getDmnEngineConfiguration().getDatabaseSchemaUpdate()); + @Override + protected String getSchemaVersionPropertyName() { + return "dmn.schema.version"; } @Override - public void schemaCreate() { - getCommonSchemaManager().schemaCreate(); - super.schemaCreate(); + protected String getDbSchemaLockName() { + return DMN_DB_SCHEMA_LOCK_NAME; } @Override - public void schemaDrop() { - try { - super.schemaDrop(); - } catch (Exception e) { - logger.info("Error dropping dmn engine tables", e); - } + protected String getEngineTableName() { + return "ACT_DMN_DECISION"; + } - try { - getCommonSchemaManager().schemaDrop(); - } catch (Exception e) { - logger.info("Error dropping common tables", e); + @Override + protected String getChangeLogTableName() { + return "ACT_DMN_DATABASECHANGELOG"; + } + + @Override + protected String getChangeLogTablePrefixName() { + return "ACT_DMN"; + } + + @Override + protected String getDbVersionForChangelogVersion(String changeLogVersion) { + if (StringUtils.isNotEmpty(changeLogVersion) && changeLogVersionMap.containsKey(changeLogVersion)) { + return changeLogVersionMap.get(changeLogVersion); } + return "5.99.0.0"; } @Override - public String schemaUpdate() { - getCommonSchemaManager().schemaUpdate(); - return super.schemaUpdate(); + protected AbstractEngineConfiguration getEngineConfiguration() { + return CommandContextUtil.getDmnEngineConfiguration(); } - protected SchemaManager getCommonSchemaManager() { - return CommandContextUtil.getDmnEngineConfiguration().getCommonSchemaManager(); + @Override + protected String getResourcesRootDirectory() { + return "org/flowable/dmn/db/"; } } diff --git a/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/test/DmnTestHelper.java b/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/test/DmnTestHelper.java index cfa676e75c2..b73a0622fc0 100644 --- a/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/test/DmnTestHelper.java +++ b/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/test/DmnTestHelper.java @@ -172,15 +172,7 @@ public static void assertAndEnsureCleanDb(final DmnEngine dmnEngine) { dmnEngine.getDmnEngineConfiguration(), TABLENAMES_EXCLUDED_FROM_DB_CLEAN_CHECK, true, - new Command<>() { - @Override - public Void execute(CommandContext commandContext) { - SchemaManager schemaManager = CommandContextUtil.getDmnEngineConfiguration().getSchemaManager(); - schemaManager.schemaDrop(); - schemaManager.schemaCreate(); - return null; - } - } + dmnEngine.getDmnEngineConfiguration().getSchemaManagementCmd() ); } diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.db2.create.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.db2.create.dmn.sql new file mode 100644 index 00000000000..71407443be8 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.db2.create.dmn.sql @@ -0,0 +1,34 @@ +CREATE TABLE ACT_DMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), CONSTRAINT PK_ACT_DMN_DEPLOY PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_ACT_DMN_DEPLOY PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DECISION_TABLE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), VERSION_ INTEGER, KEY_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(255), DESCRIPTION_ VARCHAR(255), CONSTRAINT PK_ACT_DMN_DECISI PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_HI_DECISION_EXECUTION (ID_ VARCHAR(255) NOT NULL, DECISION_DEFINITION_ID_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, INSTANCE_ID_ VARCHAR(255), EXECUTION_ID_ VARCHAR(255), ACTIVITY_ID_ VARCHAR(255), FAILED_ SMALLINT DEFAULT 0, TENANT_ID_ VARCHAR(255), EXECUTION_JSON_ CLOB, CONSTRAINT PK_ACT_DMN_HI_DEC PRIMARY KEY (ID_)); + +ALTER TABLE ACT_DMN_HI_DECISION_EXECUTION ADD SCOPE_TYPE_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_DMN_HI_DECISION_EXECUTION'); + +ALTER TABLE ACT_DMN_DECISION_TABLE DROP COLUMN PARENT_DEPLOYMENT_ID_; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_DMN_DECISION_TABLE'); + +CREATE UNIQUE INDEX ACT_IDX_DEC_TBL_UNIQ ON ACT_DMN_DECISION_TABLE(KEY_, VERSION_, TENANT_ID_); + +DROP INDEX ACT_IDX_DEC_TBL_UNIQ; + +RENAME ACT_DMN_DECISION_TABLE TO ACT_DMN_DECISION; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_DMN_DECISION'); + +CREATE UNIQUE INDEX ACT_IDX_DMN_DEC_UNIQ ON ACT_DMN_DECISION(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_DMN_DECISION ADD DECISION_TYPE_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_DMN_DECISION'); + +CREATE INDEX ACT_IDX_DMN_INSTANCE_ID ON ACT_DMN_HI_DECISION_EXECUTION(INSTANCE_ID_); + +insert into ACT_GE_PROPERTY +values ('dmn.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.h2.create.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.h2.create.dmn.sql new file mode 100644 index 00000000000..9d90304335a --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.h2.create.dmn.sql @@ -0,0 +1,18 @@ +CREATE TABLE ACT_DMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), CONSTRAINT PK_ACT_DMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_ACT_DMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DECISION (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), VERSION_ INT, KEY_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(255), DESCRIPTION_ VARCHAR(255), CONSTRAINT PK_ACT_DMN_DECISION_TABLE PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_HI_DECISION_EXECUTION (ID_ VARCHAR(255) NOT NULL, DECISION_DEFINITION_ID_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, INSTANCE_ID_ VARCHAR(255), EXECUTION_ID_ VARCHAR(255), ACTIVITY_ID_ VARCHAR(255), FAILED_ BOOLEAN DEFAULT FALSE, TENANT_ID_ VARCHAR(255), EXECUTION_JSON_ CLOB, CONSTRAINT PK_ACT_DMN_HI_DECISION_EXECUTION PRIMARY KEY (ID_)); + +ALTER TABLE ACT_DMN_HI_DECISION_EXECUTION ADD SCOPE_TYPE_ VARCHAR(255); + +CREATE UNIQUE INDEX ACT_IDX_DMN_DEC_UNIQ ON ACT_DMN_DECISION(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_DMN_DECISION ADD DECISION_TYPE_ VARCHAR(255); + +CREATE INDEX ACT_IDX_DMN_INSTANCE_ID ON ACT_DMN_HI_DECISION_EXECUTION(INSTANCE_ID_); + +insert into ACT_GE_PROPERTY +values ('dmn.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.mssql.create.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.mssql.create.dmn.sql new file mode 100644 index 00000000000..48361a900f1 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.mssql.create.dmn.sql @@ -0,0 +1,42 @@ +CREATE TABLE ACT_DMN_DEPLOYMENT (ID_ varchar(255) NOT NULL, NAME_ varchar(255), CATEGORY_ varchar(255), DEPLOY_TIME_ datetime, TENANT_ID_ varchar(255), PARENT_DEPLOYMENT_ID_ varchar(255), CONSTRAINT PK_ACT_DMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DEPLOYMENT_RESOURCE (ID_ varchar(255) NOT NULL, NAME_ varchar(255), DEPLOYMENT_ID_ varchar(255), RESOURCE_BYTES_ varbinary(MAX), CONSTRAINT PK_ACT_DMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DECISION_TABLE (ID_ varchar(255) NOT NULL, NAME_ varchar(255), VERSION_ int, KEY_ varchar(255), CATEGORY_ varchar(255), DEPLOYMENT_ID_ varchar(255), PARENT_DEPLOYMENT_ID_ varchar(255), TENANT_ID_ varchar(255), RESOURCE_NAME_ varchar(255), DESCRIPTION_ varchar(255), CONSTRAINT PK_ACT_DMN_DECISION_TABLE PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_HI_DECISION_EXECUTION (ID_ varchar(255) NOT NULL, DECISION_DEFINITION_ID_ varchar(255), DEPLOYMENT_ID_ varchar(255), START_TIME_ datetime, END_TIME_ datetime, INSTANCE_ID_ varchar(255), EXECUTION_ID_ varchar(255), ACTIVITY_ID_ varchar(255), FAILED_ bit CONSTRAINT DF_ACT_DMN_HI_DECISION_EXECUTION_FAILED_ DEFAULT 0, TENANT_ID_ varchar(255), EXECUTION_JSON_ varchar(MAX), CONSTRAINT PK_ACT_DMN_HI_DECISION_EXECUTION PRIMARY KEY (ID_)); + +ALTER TABLE ACT_DMN_HI_DECISION_EXECUTION ADD SCOPE_TYPE_ varchar(255); + +DECLARE @sql [nvarchar](MAX) +SELECT @sql = N'ALTER TABLE ACT_DMN_DECISION_TABLE DROP CONSTRAINT ' + QUOTENAME([df].[name]) FROM [sys].[columns] AS [c] INNER JOIN [sys].[default_constraints] AS [df] ON [df].[object_id] = [c].[default_object_id] WHERE [c].[object_id] = OBJECT_ID(N'ACT_DMN_DECISION_TABLE') AND [c].[name] = N'PARENT_DEPLOYMENT_ID_' +EXEC sp_executesql @sql; + +ALTER TABLE ACT_DMN_DECISION_TABLE DROP COLUMN PARENT_DEPLOYMENT_ID_; + +CREATE UNIQUE NONCLUSTERED INDEX ACT_IDX_DEC_TBL_UNIQ ON ACT_DMN_DECISION_TABLE(KEY_, VERSION_, TENANT_ID_); + +DROP INDEX ACT_IDX_DEC_TBL_UNIQ ON ACT_DMN_DECISION_TABLE; + +exec sp_rename 'ACT_DMN_DECISION_TABLE', 'ACT_DMN_DECISION'; + +CREATE UNIQUE NONCLUSTERED INDEX ACT_IDX_DMN_DEC_UNIQ ON ACT_DMN_DECISION(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_DMN_DECISION ADD DECISION_TYPE_ varchar(255); + +CREATE NONCLUSTERED INDEX ACT_IDX_DMN_INSTANCE_ID ON ACT_DMN_HI_DECISION_EXECUTION(INSTANCE_ID_); + +ALTER TABLE ACT_DMN_DEPLOYMENT ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_DMN_DEPLOYMENT_RESOURCE ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_DMN_DECISION ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_DMN_DECISION ALTER COLUMN CATEGORY_ nvarchar(255); + +ALTER TABLE ACT_DMN_DECISION ALTER COLUMN RESOURCE_NAME_ nvarchar(255); + +ALTER TABLE ACT_DMN_DECISION ALTER COLUMN DESCRIPTION_ nvarchar(255); + +insert into ACT_GE_PROPERTY +values ('dmn.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.mysql.create.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.mysql.create.dmn.sql new file mode 100644 index 00000000000..dcac1a9a74d --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.mysql.create.dmn.sql @@ -0,0 +1,18 @@ +CREATE TABLE ACT_DMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NULL, CATEGORY_ VARCHAR(255) NULL, DEPLOY_TIME_ datetime(3) NULL, TENANT_ID_ VARCHAR(255) NULL, PARENT_DEPLOYMENT_ID_ VARCHAR(255) NULL, CONSTRAINT PK_ACT_DMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NULL, DEPLOYMENT_ID_ VARCHAR(255) NULL, RESOURCE_BYTES_ LONGBLOB NULL, CONSTRAINT PK_ACT_DMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DECISION (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NULL, VERSION_ INT NULL, KEY_ VARCHAR(255) NULL, CATEGORY_ VARCHAR(255) NULL, DEPLOYMENT_ID_ VARCHAR(255) NULL, TENANT_ID_ VARCHAR(255) NULL, RESOURCE_NAME_ VARCHAR(255) NULL, DESCRIPTION_ VARCHAR(255) NULL, CONSTRAINT PK_ACT_DMN_DECISION_TABLE PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_HI_DECISION_EXECUTION (ID_ VARCHAR(255) NOT NULL, DECISION_DEFINITION_ID_ VARCHAR(255) NULL, DEPLOYMENT_ID_ VARCHAR(255) NULL, START_TIME_ datetime(3) NULL, END_TIME_ datetime(3) NULL, INSTANCE_ID_ VARCHAR(255) NULL, EXECUTION_ID_ VARCHAR(255) NULL, ACTIVITY_ID_ VARCHAR(255) NULL, FAILED_ TINYINT DEFAULT 0 NULL, TENANT_ID_ VARCHAR(255) NULL, EXECUTION_JSON_ LONGTEXT NULL, CONSTRAINT PK_ACT_DMN_HI_DECISION_EXECUTION PRIMARY KEY (ID_)); + +ALTER TABLE ACT_DMN_HI_DECISION_EXECUTION ADD SCOPE_TYPE_ VARCHAR(255) NULL; + +CREATE UNIQUE INDEX ACT_IDX_DMN_DEC_UNIQ ON ACT_DMN_DECISION(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_DMN_DECISION ADD DECISION_TYPE_ VARCHAR(255) NULL; + +CREATE INDEX ACT_IDX_DMN_INSTANCE_ID ON ACT_DMN_HI_DECISION_EXECUTION(INSTANCE_ID_); + +insert into ACT_GE_PROPERTY +values ('dmn.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.oracle.create.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.oracle.create.dmn.sql new file mode 100644 index 00000000000..4a11fe146d7 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.oracle.create.dmn.sql @@ -0,0 +1,26 @@ +CREATE TABLE ACT_DMN_DEPLOYMENT (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255), CATEGORY_ VARCHAR2(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR2(255), PARENT_DEPLOYMENT_ID_ VARCHAR2(255), CONSTRAINT PK_ACT_DMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255), DEPLOYMENT_ID_ VARCHAR2(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_ACT_DMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DECISION_TABLE (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255), VERSION_ INTEGER, KEY_ VARCHAR2(255), CATEGORY_ VARCHAR2(255), DEPLOYMENT_ID_ VARCHAR2(255), PARENT_DEPLOYMENT_ID_ VARCHAR2(255), TENANT_ID_ VARCHAR2(255), RESOURCE_NAME_ VARCHAR2(255), DESCRIPTION_ VARCHAR2(255), CONSTRAINT PK_ACT_DMN_DECISION_TABLE PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_HI_DECISION_EXECUTION (ID_ VARCHAR2(255) NOT NULL, DECISION_DEFINITION_ID_ VARCHAR2(255), DEPLOYMENT_ID_ VARCHAR2(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, INSTANCE_ID_ VARCHAR2(255), EXECUTION_ID_ VARCHAR2(255), ACTIVITY_ID_ VARCHAR2(255), FAILED_ NUMBER(1) DEFAULT 0, TENANT_ID_ VARCHAR2(255), EXECUTION_JSON_ CLOB, CONSTRAINT PK_ACT_DMN_HI_DECISION_EXECUTI PRIMARY KEY (ID_)); + +ALTER TABLE ACT_DMN_HI_DECISION_EXECUTION ADD SCOPE_TYPE_ VARCHAR2(255); + +ALTER TABLE ACT_DMN_DECISION_TABLE DROP COLUMN PARENT_DEPLOYMENT_ID_; + +CREATE UNIQUE INDEX ACT_IDX_DEC_TBL_UNIQ ON ACT_DMN_DECISION_TABLE(KEY_, VERSION_, TENANT_ID_); + +DROP INDEX ACT_IDX_DEC_TBL_UNIQ; + +ALTER TABLE ACT_DMN_DECISION_TABLE RENAME TO ACT_DMN_DECISION; + +CREATE UNIQUE INDEX ACT_IDX_DMN_DEC_UNIQ ON ACT_DMN_DECISION(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_DMN_DECISION ADD DECISION_TYPE_ VARCHAR2(255); + +CREATE INDEX ACT_IDX_DMN_INSTANCE_ID ON ACT_DMN_HI_DECISION_EXECUTION(INSTANCE_ID_); + +insert into ACT_GE_PROPERTY +values ('dmn.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.postgres.create.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.postgres.create.dmn.sql new file mode 100644 index 00000000000..7c78cb6a9b6 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/create/flowable.postgres.create.dmn.sql @@ -0,0 +1,18 @@ +CREATE TABLE ACT_DMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP WITHOUT TIME ZONE, TENANT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), CONSTRAINT "ACT_DMN_DEPLOYMENT_pkey" PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BYTEA, CONSTRAINT "ACT_DMN_DEPLOYMENT_RESOURCE_pkey" PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DECISION (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), VERSION_ INTEGER, KEY_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(255), DESCRIPTION_ VARCHAR(255), CONSTRAINT "ACT_DMN_DECISION_TABLE_pkey" PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_HI_DECISION_EXECUTION (ID_ VARCHAR(255) NOT NULL, DECISION_DEFINITION_ID_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), START_TIME_ TIMESTAMP WITHOUT TIME ZONE, END_TIME_ TIMESTAMP WITHOUT TIME ZONE, INSTANCE_ID_ VARCHAR(255), EXECUTION_ID_ VARCHAR(255), ACTIVITY_ID_ VARCHAR(255), FAILED_ BOOLEAN DEFAULT FALSE, TENANT_ID_ VARCHAR(255), EXECUTION_JSON_ TEXT, CONSTRAINT "ACT_DMN_HI_DECISION_EXECUTION_pkey" PRIMARY KEY (ID_)); + +ALTER TABLE ACT_DMN_HI_DECISION_EXECUTION ADD SCOPE_TYPE_ VARCHAR(255); + +CREATE UNIQUE INDEX ACT_IDX_DMN_DEC_UNIQ ON ACT_DMN_DECISION(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_DMN_DECISION ADD DECISION_TYPE_ VARCHAR(255); + +CREATE INDEX ACT_IDX_DMN_INSTANCE_ID ON ACT_DMN_HI_DECISION_EXECUTION(INSTANCE_ID_); + +insert into ACT_GE_PROPERTY +values ('dmn.schema.version', '7.1.0.1', 1); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/drop/flowable.h2.drop.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/drop/flowable.h2.drop.dmn.sql new file mode 100644 index 00000000000..06cfff2ec5c --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/drop/flowable.h2.drop.dmn.sql @@ -0,0 +1,7 @@ +drop index if exists ACT_IDX_DMN_INSTANCE_ID; +drop index if exists ACT_IDX_DMN_DEC_UNIQ; + +drop table if exists ACT_DMN_HI_DECISION_EXECUTION cascade constraints; +drop table if exists ACT_DMN_DECISION cascade constraints; +drop table if exists ACT_DMN_DEPLOYMENT_RESOURCE cascade constraints; +drop table if exists ACT_DMN_DEPLOYMENT cascade constraints; diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/drop/flowable.mysql.drop.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/drop/flowable.mysql.drop.dmn.sql new file mode 100644 index 00000000000..4a90aaa2caa --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/drop/flowable.mysql.drop.dmn.sql @@ -0,0 +1,7 @@ +drop index ACT_IDX_DMN_INSTANCE_ID on ACT_DMN_HI_DECISION_EXECUTION; +drop index ACT_IDX_DMN_DEC_UNIQ on ACT_DMN_DECISION; + +drop table if exists ACT_DMN_HI_DECISION_EXECUTION; +drop table if exists ACT_DMN_DECISION; +drop table if exists ACT_DMN_DEPLOYMENT_RESOURCE; +drop table if exists ACT_DMN_DEPLOYMENT; diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/drop/flowable.postgres.drop.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/drop/flowable.postgres.drop.dmn.sql new file mode 100644 index 00000000000..e3706e9a1d6 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/drop/flowable.postgres.drop.dmn.sql @@ -0,0 +1,4 @@ +drop table if exists ACT_DMN_HI_DECISION_EXECUTION cascade; +drop table if exists ACT_DMN_DECISION cascade; +drop table if exists ACT_DMN_DEPLOYMENT_RESOURCE cascade; +drop table if exists ACT_DMN_DEPLOYMENT cascade; diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/liquibase/flowable-dmn-db-changelog.xml b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/liquibase/flowable-dmn-db-changelog.xml deleted file mode 100644 index e2a9aa61178..00000000000 --- a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/liquibase/flowable-dmn-db-changelog.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/mapping/mappings.xml b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/mapping/mappings.xml index a742e75b3fa..293de0f36f3 100644 --- a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/mapping/mappings.xml +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/mapping/mappings.xml @@ -9,6 +9,7 @@ + diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.all.upgradestep.7100.to.7101.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.all.upgradestep.7100.to.7101.dmn.sql new file mode 100644 index 00000000000..9cff2606af4 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.all.upgradestep.7100.to.7101.dmn.sql @@ -0,0 +1,5 @@ +insert into ACT_GE_PROPERTY +values ('dmn.schema.version', '7.1.0.1', 1); + +drop table ACT_DMN_DATABASECHANGELOG; +drop table ACT_DMN_DATABASECHANGELOGLOCK; diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.59900.to.6000.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.59900.to.6000.dmn.sql new file mode 100644 index 00000000000..479e8f20934 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.59900.to.6000.dmn.sql @@ -0,0 +1,7 @@ +CREATE TABLE ACT_DMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), CONSTRAINT PK_ACT_DMN_DEPLOY PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_ACT_DMN_DEPLOY PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DECISION_TABLE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), VERSION_ INTEGER, KEY_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(255), DESCRIPTION_ VARCHAR(255), CONSTRAINT PK_ACT_DMN_DECISI PRIMARY KEY (ID_)); + + diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6100.to.6110.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6100.to.6110.dmn.sql new file mode 100644 index 00000000000..227bbcaacd4 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6100.to.6110.dmn.sql @@ -0,0 +1,3 @@ +CREATE TABLE ACT_DMN_HI_DECISION_EXECUTION (ID_ VARCHAR(255) NOT NULL, DECISION_DEFINITION_ID_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, INSTANCE_ID_ VARCHAR(255), EXECUTION_ID_ VARCHAR(255), ACTIVITY_ID_ VARCHAR(255), FAILED_ SMALLINT DEFAULT 0, TENANT_ID_ VARCHAR(255), EXECUTION_JSON_ CLOB, CONSTRAINT PK_ACT_DMN_HI_DEC PRIMARY KEY (ID_)); + + diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6210.to.6300.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6210.to.6300.dmn.sql new file mode 100644 index 00000000000..39817d0e966 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6210.to.6300.dmn.sql @@ -0,0 +1,5 @@ +ALTER TABLE ACT_DMN_HI_DECISION_EXECUTION ADD SCOPE_TYPE_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_DMN_HI_DECISION_EXECUTION'); + + diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6300.to.6301.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6300.to.6301.dmn.sql new file mode 100644 index 00000000000..75fa33bee2a --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6300.to.6301.dmn.sql @@ -0,0 +1,5 @@ +ALTER TABLE ACT_DMN_DECISION_TABLE DROP COLUMN PARENT_DEPLOYMENT_ID_; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_DMN_DECISION_TABLE'); + + diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6400.to.6410.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6400.to.6410.dmn.sql new file mode 100644 index 00000000000..e835250d9a4 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6400.to.6410.dmn.sql @@ -0,0 +1,3 @@ +CREATE UNIQUE INDEX ACT_IDX_DEC_TBL_UNIQ ON ACT_DMN_DECISION_TABLE(KEY_, VERSION_, TENANT_ID_); + + diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6511.to.6512.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6511.to.6512.dmn.sql new file mode 100644 index 00000000000..30f3a030913 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6511.to.6512.dmn.sql @@ -0,0 +1,13 @@ +DROP INDEX ACT_IDX_DEC_TBL_UNIQ; + +RENAME ACT_DMN_DECISION_TABLE TO ACT_DMN_DECISION; + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_DMN_DECISION'); + +CREATE UNIQUE INDEX ACT_IDX_DMN_DEC_UNIQ ON ACT_DMN_DECISION(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_DMN_DECISION ADD DECISION_TYPE_ VARCHAR(255); + +CALL SYSPROC.ADMIN_CMD ('REORG TABLE ACT_DMN_DECISION'); + + diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6723.to.6800.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6723.to.6800.dmn.sql new file mode 100644 index 00000000000..adb9d4c0557 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.db2.upgradestep.6723.to.6800.dmn.sql @@ -0,0 +1 @@ +CREATE INDEX ACT_IDX_DMN_INSTANCE_ID ON ACT_DMN_HI_DECISION_EXECUTION(INSTANCE_ID_); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.59900.to.6000.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.59900.to.6000.dmn.sql new file mode 100644 index 00000000000..bbe9a82963f --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.59900.to.6000.dmn.sql @@ -0,0 +1,5 @@ +CREATE TABLE ACT_DMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), CONSTRAINT PK_ACT_DMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_ACT_DMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DECISION_TABLE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), VERSION_ INT, KEY_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(255), DESCRIPTION_ VARCHAR(255), CONSTRAINT PK_ACT_DMN_DECISION_TABLE PRIMARY KEY (ID_)); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6100.to.6110.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6100.to.6110.dmn.sql new file mode 100644 index 00000000000..b4126421298 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6100.to.6110.dmn.sql @@ -0,0 +1 @@ +CREATE TABLE ACT_DMN_HI_DECISION_EXECUTION (ID_ VARCHAR(255) NOT NULL, DECISION_DEFINITION_ID_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, INSTANCE_ID_ VARCHAR(255), EXECUTION_ID_ VARCHAR(255), ACTIVITY_ID_ VARCHAR(255), FAILED_ BOOLEAN DEFAULT FALSE, TENANT_ID_ VARCHAR(255), EXECUTION_JSON_ CLOB, CONSTRAINT PK_ACT_DMN_HI_DECISION_EXECUTION PRIMARY KEY (ID_)); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6210.to.6300.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6210.to.6300.dmn.sql new file mode 100644 index 00000000000..52e54a804ba --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6210.to.6300.dmn.sql @@ -0,0 +1 @@ +ALTER TABLE ACT_DMN_HI_DECISION_EXECUTION ADD SCOPE_TYPE_ VARCHAR(255); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6300.to.6301.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6300.to.6301.dmn.sql new file mode 100644 index 00000000000..d45b19fc7fa --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6300.to.6301.dmn.sql @@ -0,0 +1 @@ +ALTER TABLE ACT_DMN_DECISION_TABLE DROP COLUMN PARENT_DEPLOYMENT_ID_; diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6400.to.6410.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6400.to.6410.dmn.sql new file mode 100644 index 00000000000..d4e92a24219 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6400.to.6410.dmn.sql @@ -0,0 +1 @@ +CREATE UNIQUE INDEX ACT_IDX_DEC_TBL_UNIQ ON ACT_DMN_DECISION_TABLE(KEY_, VERSION_, TENANT_ID_); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6511.to.6512.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6511.to.6512.dmn.sql new file mode 100644 index 00000000000..fab3f27a64d --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6511.to.6512.dmn.sql @@ -0,0 +1,7 @@ +DROP INDEX ACT_IDX_DEC_TBL_UNIQ; + +ALTER TABLE ACT_DMN_DECISION_TABLE RENAME TO ACT_DMN_DECISION; + +CREATE UNIQUE INDEX ACT_IDX_DMN_DEC_UNIQ ON ACT_DMN_DECISION(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_DMN_DECISION ADD DECISION_TYPE_ VARCHAR(255); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6723.to.6800.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6723.to.6800.dmn.sql new file mode 100644 index 00000000000..adb9d4c0557 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.h2.upgradestep.6723.to.6800.dmn.sql @@ -0,0 +1 @@ +CREATE INDEX ACT_IDX_DMN_INSTANCE_ID ON ACT_DMN_HI_DECISION_EXECUTION(INSTANCE_ID_); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.59900.to.6000.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.59900.to.6000.dmn.sql new file mode 100644 index 00000000000..0b7d6a25cba --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.59900.to.6000.dmn.sql @@ -0,0 +1,7 @@ +CREATE TABLE [ACT_DMN_DATABASECHANGELOG] ([ID] [nvarchar](255) NOT NULL, [AUTHOR] [nvarchar](255) NOT NULL, [FILENAME] [nvarchar](255) NOT NULL, [DATEEXECUTED] [datetime2](3) NOT NULL, [ORDEREXECUTED] [int] NOT NULL, [EXECTYPE] [nvarchar](10) NOT NULL, [MD5SUM] [nvarchar](35), [DESCRIPTION] [nvarchar](255), [COMMENTS] [nvarchar](255), [TAG] [nvarchar](255), [LIQUIBASE] [nvarchar](20), [CONTEXTS] [nvarchar](255), [LABELS] [nvarchar](255), [DEPLOYMENT_ID] [nvarchar](10)) + +CREATE TABLE [ACT_DMN_DEPLOYMENT] ([ID_] [varchar](255) NOT NULL, [NAME_] [varchar](255), [CATEGORY_] [varchar](255), [DEPLOY_TIME_] [datetime], [TENANT_ID_] [varchar](255), [PARENT_DEPLOYMENT_ID_] [varchar](255), CONSTRAINT [PK_ACT_DMN_DEPLOYMENT] PRIMARY KEY ([ID_])) + +CREATE TABLE [ACT_DMN_DEPLOYMENT_RESOURCE] ([ID_] [varchar](255) NOT NULL, [NAME_] [varchar](255), [DEPLOYMENT_ID_] [varchar](255), [RESOURCE_BYTES_] [varbinary](MAX), CONSTRAINT [PK_ACT_DMN_DEPLOYMENT_RESOURCE] PRIMARY KEY ([ID_])) + +CREATE TABLE [ACT_DMN_DECISION_TABLE] ([ID_] [varchar](255) NOT NULL, [NAME_] [varchar](255), [VERSION_] [int], [KEY_] [varchar](255), [CATEGORY_] [varchar](255), [DEPLOYMENT_ID_] [varchar](255), [PARENT_DEPLOYMENT_ID_] [varchar](255), [TENANT_ID_] [varchar](255), [RESOURCE_NAME_] [varchar](255), [DESCRIPTION_] [varchar](255), CONSTRAINT [PK_ACT_DMN_DECISION_TABLE] PRIMARY KEY ([ID_])) diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6100.to.6110.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6100.to.6110.dmn.sql new file mode 100644 index 00000000000..05961e57a55 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6100.to.6110.dmn.sql @@ -0,0 +1 @@ +CREATE TABLE [ACT_DMN_HI_DECISION_EXECUTION] ([ID_] [varchar](255) NOT NULL, [DECISION_DEFINITION_ID_] [varchar](255), [DEPLOYMENT_ID_] [varchar](255), [START_TIME_] [datetime], [END_TIME_] [datetime], [INSTANCE_ID_] [varchar](255), [EXECUTION_ID_] [varchar](255), [ACTIVITY_ID_] [varchar](255), [FAILED_] [bit] CONSTRAINT [DF_ACT_DMN_HI_DECISION_EXECUTION_FAILED_] DEFAULT 0, [TENANT_ID_] [varchar](255), [EXECUTION_JSON_] [varchar](MAX), CONSTRAINT [PK_ACT_DMN_HI_DECISION_EXECUTION] PRIMARY KEY ([ID_])) diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6210.to.6300.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6210.to.6300.dmn.sql new file mode 100644 index 00000000000..c06ee5c7659 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6210.to.6300.dmn.sql @@ -0,0 +1 @@ +ALTER TABLE ACT_DMN_HI_DECISION_EXECUTION ADD SCOPE_TYPE_ varchar(255); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6300.to.6301.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6300.to.6301.dmn.sql new file mode 100644 index 00000000000..c88ac49a27e --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6300.to.6301.dmn.sql @@ -0,0 +1,5 @@ +DECLARE @sql [nvarchar](MAX) +SELECT @sql = N'ALTER TABLE ACT_DMN_DECISION_TABLE DROP CONSTRAINT ' + QUOTENAME([df].[name]) FROM [sys].[columns] AS [c] INNER JOIN [sys].[default_constraints] AS [df] ON [df].[object_id] = [c].[default_object_id] WHERE [c].[object_id] = OBJECT_ID(N'ACT_DMN_DECISION_TABLE') AND [c].[name] = N'PARENT_DEPLOYMENT_ID_' +EXEC sp_executesql @sql; + +ALTER TABLE ACT_DMN_DECISION_TABLE DROP COLUMN PARENT_DEPLOYMENT_ID_; diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6400.to.6410.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6400.to.6410.dmn.sql new file mode 100644 index 00000000000..d8bee94dbfe --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6400.to.6410.dmn.sql @@ -0,0 +1 @@ +CREATE UNIQUE NONCLUSTERED INDEX ACT_IDX_DEC_TBL_UNIQ ON ACT_DMN_DECISION_TABLE(KEY_, VERSION_, TENANT_ID_); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6511.to.6512.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6511.to.6512.dmn.sql new file mode 100644 index 00000000000..d39e7647f99 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6511.to.6512.dmn.sql @@ -0,0 +1,7 @@ +DROP INDEX ACT_IDX_DEC_TBL_UNIQ ON ACT_DMN_DECISION_TABLE; + +exec sp_rename 'ACT_DMN_DECISION_TABLE', 'ACT_DMN_DECISION'; + +CREATE UNIQUE NONCLUSTERED INDEX ACT_IDX_DMN_DEC_UNIQ ON ACT_DMN_DECISION(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_DMN_DECISION ADD DECISION_TYPE_ varchar(255); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6723.to.6800.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6723.to.6800.dmn.sql new file mode 100644 index 00000000000..239dcd9fa07 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.6723.to.6800.dmn.sql @@ -0,0 +1 @@ +CREATE NONCLUSTERED INDEX ACT_IDX_DMN_INSTANCE_ID ON ACT_DMN_HI_DECISION_EXECUTION(INSTANCE_ID_); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.7010.to.7100.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.7010.to.7100.dmn.sql new file mode 100644 index 00000000000..4f1fd1675a4 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mssql.upgradestep.7010.to.7100.dmn.sql @@ -0,0 +1,11 @@ +ALTER TABLE ACT_DMN_DEPLOYMENT ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_DMN_DEPLOYMENT_RESOURCE ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_DMN_DECISION ALTER COLUMN NAME_ nvarchar(255); + +ALTER TABLE ACT_DMN_DECISION ALTER COLUMN CATEGORY_ nvarchar(255); + +ALTER TABLE ACT_DMN_DECISION ALTER COLUMN RESOURCE_NAME_ nvarchar(255); + +ALTER TABLE ACT_DMN_DECISION ALTER COLUMN DESCRIPTION_ nvarchar(255); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.59900.to.6000.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.59900.to.6000.dmn.sql new file mode 100644 index 00000000000..73f0b5fc560 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.59900.to.6000.dmn.sql @@ -0,0 +1,5 @@ +CREATE TABLE ACT_DMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NULL, CATEGORY_ VARCHAR(255) NULL, DEPLOY_TIME_ datetime NULL, TENANT_ID_ VARCHAR(255) NULL, PARENT_DEPLOYMENT_ID_ VARCHAR(255) NULL, CONSTRAINT PK_ACT_DMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NULL, DEPLOYMENT_ID_ VARCHAR(255) NULL, RESOURCE_BYTES_ LONGBLOB NULL, CONSTRAINT PK_ACT_DMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DECISION_TABLE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255) NULL, VERSION_ INT NULL, KEY_ VARCHAR(255) NULL, CATEGORY_ VARCHAR(255) NULL, DEPLOYMENT_ID_ VARCHAR(255) NULL, PARENT_DEPLOYMENT_ID_ VARCHAR(255) NULL, TENANT_ID_ VARCHAR(255) NULL, RESOURCE_NAME_ VARCHAR(255) NULL, DESCRIPTION_ VARCHAR(255) NULL, CONSTRAINT PK_ACT_DMN_DECISION_TABLE PRIMARY KEY (ID_)); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6100.to.6110.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6100.to.6110.dmn.sql new file mode 100644 index 00000000000..d64f0b58799 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6100.to.6110.dmn.sql @@ -0,0 +1 @@ +CREATE TABLE ACT_DMN_HI_DECISION_EXECUTION (ID_ VARCHAR(255) NOT NULL, DECISION_DEFINITION_ID_ VARCHAR(255) NULL, DEPLOYMENT_ID_ VARCHAR(255) NULL, START_TIME_ datetime NULL, END_TIME_ datetime NULL, INSTANCE_ID_ VARCHAR(255) NULL, EXECUTION_ID_ VARCHAR(255) NULL, ACTIVITY_ID_ VARCHAR(255) NULL, FAILED_ BIT(1) DEFAULT 0 NULL, TENANT_ID_ VARCHAR(255) NULL, EXECUTION_JSON_ LONGTEXT NULL, CONSTRAINT PK_ACT_DMN_HI_DECISION_EXECUTION PRIMARY KEY (ID_)); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6210.to.6300.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6210.to.6300.dmn.sql new file mode 100644 index 00000000000..fbde7455443 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6210.to.6300.dmn.sql @@ -0,0 +1 @@ +ALTER TABLE ACT_DMN_HI_DECISION_EXECUTION ADD SCOPE_TYPE_ VARCHAR(255) NULL; diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6300.to.6301.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6300.to.6301.dmn.sql new file mode 100644 index 00000000000..d45b19fc7fa --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6300.to.6301.dmn.sql @@ -0,0 +1 @@ +ALTER TABLE ACT_DMN_DECISION_TABLE DROP COLUMN PARENT_DEPLOYMENT_ID_; diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6320.to.6400.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6320.to.6400.dmn.sql new file mode 100644 index 00000000000..ccd44e14089 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6320.to.6400.dmn.sql @@ -0,0 +1,5 @@ +ALTER TABLE ACT_DMN_DEPLOYMENT MODIFY DEPLOY_TIME_ datetime(3); + +ALTER TABLE ACT_DMN_HI_DECISION_EXECUTION MODIFY START_TIME_ datetime(3); + +ALTER TABLE ACT_DMN_HI_DECISION_EXECUTION MODIFY END_TIME_ datetime(3); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6400.to.6410.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6400.to.6410.dmn.sql new file mode 100644 index 00000000000..d4e92a24219 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6400.to.6410.dmn.sql @@ -0,0 +1 @@ +CREATE UNIQUE INDEX ACT_IDX_DEC_TBL_UNIQ ON ACT_DMN_DECISION_TABLE(KEY_, VERSION_, TENANT_ID_); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6511.to.6512.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6511.to.6512.dmn.sql new file mode 100644 index 00000000000..61ab45d0236 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6511.to.6512.dmn.sql @@ -0,0 +1,7 @@ +DROP INDEX ACT_IDX_DEC_TBL_UNIQ ON ACT_DMN_DECISION_TABLE; + +ALTER TABLE ACT_DMN_DECISION_TABLE RENAME ACT_DMN_DECISION; + +CREATE UNIQUE INDEX ACT_IDX_DMN_DEC_UNIQ ON ACT_DMN_DECISION(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_DMN_DECISION ADD DECISION_TYPE_ VARCHAR(255) NULL; diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6723.to.6800.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6723.to.6800.dmn.sql new file mode 100644 index 00000000000..adb9d4c0557 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.mysql.upgradestep.6723.to.6800.dmn.sql @@ -0,0 +1 @@ +CREATE INDEX ACT_IDX_DMN_INSTANCE_ID ON ACT_DMN_HI_DECISION_EXECUTION(INSTANCE_ID_); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.59900.to.6000.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.59900.to.6000.dmn.sql new file mode 100644 index 00000000000..833aaed4738 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.59900.to.6000.dmn.sql @@ -0,0 +1,5 @@ +CREATE TABLE ACT_DMN_DEPLOYMENT (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255), CATEGORY_ VARCHAR2(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR2(255), PARENT_DEPLOYMENT_ID_ VARCHAR2(255), CONSTRAINT PK_ACT_DMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255), DEPLOYMENT_ID_ VARCHAR2(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_ACT_DMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DECISION_TABLE (ID_ VARCHAR2(255) NOT NULL, NAME_ VARCHAR2(255), VERSION_ INTEGER, KEY_ VARCHAR2(255), CATEGORY_ VARCHAR2(255), DEPLOYMENT_ID_ VARCHAR2(255), PARENT_DEPLOYMENT_ID_ VARCHAR2(255), TENANT_ID_ VARCHAR2(255), RESOURCE_NAME_ VARCHAR2(255), DESCRIPTION_ VARCHAR2(255), CONSTRAINT PK_ACT_DMN_DECISION_TABLE PRIMARY KEY (ID_)); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6100.to.6110.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6100.to.6110.dmn.sql new file mode 100644 index 00000000000..7389bdf9906 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6100.to.6110.dmn.sql @@ -0,0 +1 @@ +CREATE TABLE ACT_DMN_HI_DECISION_EXECUTION (ID_ VARCHAR2(255) NOT NULL, DECISION_DEFINITION_ID_ VARCHAR2(255), DEPLOYMENT_ID_ VARCHAR2(255), START_TIME_ TIMESTAMP, END_TIME_ TIMESTAMP, INSTANCE_ID_ VARCHAR2(255), EXECUTION_ID_ VARCHAR2(255), ACTIVITY_ID_ VARCHAR2(255), FAILED_ NUMBER(1) DEFAULT 0, TENANT_ID_ VARCHAR2(255), EXECUTION_JSON_ CLOB, CONSTRAINT PK_ACT_DMN_HI_DECISION_EXECUTI PRIMARY KEY (ID_)); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6210.to.6300.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6210.to.6300.dmn.sql new file mode 100644 index 00000000000..cc5138a2dd8 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6210.to.6300.dmn.sql @@ -0,0 +1 @@ +ALTER TABLE ACT_DMN_HI_DECISION_EXECUTION ADD SCOPE_TYPE_ VARCHAR2(255); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6300.to.6301.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6300.to.6301.dmn.sql new file mode 100644 index 00000000000..d45b19fc7fa --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6300.to.6301.dmn.sql @@ -0,0 +1 @@ +ALTER TABLE ACT_DMN_DECISION_TABLE DROP COLUMN PARENT_DEPLOYMENT_ID_; diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6400.to.6410.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6400.to.6410.dmn.sql new file mode 100644 index 00000000000..d4e92a24219 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6400.to.6410.dmn.sql @@ -0,0 +1 @@ +CREATE UNIQUE INDEX ACT_IDX_DEC_TBL_UNIQ ON ACT_DMN_DECISION_TABLE(KEY_, VERSION_, TENANT_ID_); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6511.to.6512.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6511.to.6512.dmn.sql new file mode 100644 index 00000000000..e80d3c9dbeb --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6511.to.6512.dmn.sql @@ -0,0 +1,7 @@ +DROP INDEX ACT_IDX_DEC_TBL_UNIQ; + +ALTER TABLE ACT_DMN_DECISION_TABLE RENAME TO ACT_DMN_DECISION; + +CREATE UNIQUE INDEX ACT_IDX_DMN_DEC_UNIQ ON ACT_DMN_DECISION(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_DMN_DECISION ADD DECISION_TYPE_ VARCHAR2(255); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6723.to.6800.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6723.to.6800.dmn.sql new file mode 100644 index 00000000000..adb9d4c0557 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.oracle.upgradestep.6723.to.6800.dmn.sql @@ -0,0 +1 @@ +CREATE INDEX ACT_IDX_DMN_INSTANCE_ID ON ACT_DMN_HI_DECISION_EXECUTION(INSTANCE_ID_); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.59900.to.6000.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.59900.to.6000.dmn.sql new file mode 100644 index 00000000000..5cc4e51e842 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.59900.to.6000.dmn.sql @@ -0,0 +1,5 @@ +CREATE TABLE ACT_DMN_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP WITHOUT TIME ZONE, TENANT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), CONSTRAINT PK_ACT_DMN_DEPLOYMENT PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BYTEA, CONSTRAINT PK_ACT_DMN_DEPLOYMENT_RESOURCE PRIMARY KEY (ID_)); + +CREATE TABLE ACT_DMN_DECISION_TABLE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), VERSION_ INT, KEY_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), TENANT_ID_ VARCHAR(255), RESOURCE_NAME_ VARCHAR(255), DESCRIPTION_ VARCHAR(255), CONSTRAINT PK_ACT_DMN_DECISION_TABLE PRIMARY KEY (ID_)); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6100.to.6110.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6100.to.6110.dmn.sql new file mode 100644 index 00000000000..485d76bc16e --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6100.to.6110.dmn.sql @@ -0,0 +1 @@ +CREATE TABLE ACT_DMN_HI_DECISION_EXECUTION (ID_ VARCHAR(255) NOT NULL, DECISION_DEFINITION_ID_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), START_TIME_ TIMESTAMP WITHOUT TIME ZONE, END_TIME_ TIMESTAMP WITHOUT TIME ZONE, INSTANCE_ID_ VARCHAR(255), EXECUTION_ID_ VARCHAR(255), ACTIVITY_ID_ VARCHAR(255), FAILED_ BOOLEAN DEFAULT FALSE, TENANT_ID_ VARCHAR(255), EXECUTION_JSON_ TEXT, CONSTRAINT PK_ACT_DMN_HI_DECISION_EXECUTION PRIMARY KEY (ID_)); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6210.to.6300.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6210.to.6300.dmn.sql new file mode 100644 index 00000000000..52e54a804ba --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6210.to.6300.dmn.sql @@ -0,0 +1 @@ +ALTER TABLE ACT_DMN_HI_DECISION_EXECUTION ADD SCOPE_TYPE_ VARCHAR(255); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6300.to.6301.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6300.to.6301.dmn.sql new file mode 100644 index 00000000000..d45b19fc7fa --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6300.to.6301.dmn.sql @@ -0,0 +1 @@ +ALTER TABLE ACT_DMN_DECISION_TABLE DROP COLUMN PARENT_DEPLOYMENT_ID_; diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6400.to.6410.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6400.to.6410.dmn.sql new file mode 100644 index 00000000000..d4e92a24219 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6400.to.6410.dmn.sql @@ -0,0 +1 @@ +CREATE UNIQUE INDEX ACT_IDX_DEC_TBL_UNIQ ON ACT_DMN_DECISION_TABLE(KEY_, VERSION_, TENANT_ID_); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6511.to.6512.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6511.to.6512.dmn.sql new file mode 100644 index 00000000000..fab3f27a64d --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6511.to.6512.dmn.sql @@ -0,0 +1,7 @@ +DROP INDEX ACT_IDX_DEC_TBL_UNIQ; + +ALTER TABLE ACT_DMN_DECISION_TABLE RENAME TO ACT_DMN_DECISION; + +CREATE UNIQUE INDEX ACT_IDX_DMN_DEC_UNIQ ON ACT_DMN_DECISION(KEY_, VERSION_, TENANT_ID_); + +ALTER TABLE ACT_DMN_DECISION ADD DECISION_TYPE_ VARCHAR(255); diff --git a/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6723.to.6800.dmn.sql b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6723.to.6800.dmn.sql new file mode 100644 index 00000000000..adb9d4c0557 --- /dev/null +++ b/modules/flowable-dmn-engine/src/main/resources/org/flowable/dmn/db/upgrade/flowable.postgres.upgradestep.6723.to.6800.dmn.sql @@ -0,0 +1 @@ +CREATE INDEX ACT_IDX_DMN_INSTANCE_ID ON ACT_DMN_HI_DECISION_EXECUTION(INSTANCE_ID_); diff --git a/modules/flowable-dmn-engine/src/test/java/org/flowable/dmn/engine/test/cfg/ForceCloseMybatisConnectionPoolTest.java b/modules/flowable-dmn-engine/src/test/java/org/flowable/dmn/engine/test/cfg/ForceCloseMybatisConnectionPoolTest.java index f732b62160f..eb442b3d903 100644 --- a/modules/flowable-dmn-engine/src/test/java/org/flowable/dmn/engine/test/cfg/ForceCloseMybatisConnectionPoolTest.java +++ b/modules/flowable-dmn-engine/src/test/java/org/flowable/dmn/engine/test/cfg/ForceCloseMybatisConnectionPoolTest.java @@ -34,6 +34,7 @@ public void testForceCloseMybatisConnectionPoolTrue() { StandaloneInMemDmnEngineConfiguration standaloneInMemDmnEngineConfiguration = new StandaloneInMemDmnEngineConfiguration(); standaloneInMemDmnEngineConfiguration.setJdbcUrl("jdbc:h2:mem:flowable-dmn-" + this.getClass().getName()); standaloneInMemDmnEngineConfiguration.setForceCloseMybatisConnectionPool(true); + standaloneInMemDmnEngineConfiguration.setDatabaseSchemaUpdate("true"); DmnEngine dmnEngine = standaloneInMemDmnEngineConfiguration.buildDmnEngine(); @@ -59,6 +60,7 @@ public void testForceCloseMybatisConnectionPoolFalse() { StandaloneInMemDmnEngineConfiguration standaloneInMemDmnEngineConfiguration = new StandaloneInMemDmnEngineConfiguration(); standaloneInMemDmnEngineConfiguration.setJdbcUrl("jdbc:h2:mem:flowable-dmn-" + this.getClass().getName()); standaloneInMemDmnEngineConfiguration.setForceCloseMybatisConnectionPool(false); + standaloneInMemDmnEngineConfiguration.setDatabaseSchemaUpdate("true"); DmnEngine dmnEngine = standaloneInMemDmnEngineConfiguration.buildDmnEngine(); diff --git a/modules/flowable-dmn-engine/src/test/java/org/flowable/dmn/engine/test/mgmt/DmnManagementServiceTest.java b/modules/flowable-dmn-engine/src/test/java/org/flowable/dmn/engine/test/mgmt/DmnManagementServiceTest.java index 41e404ce6cc..6d044267953 100644 --- a/modules/flowable-dmn-engine/src/test/java/org/flowable/dmn/engine/test/mgmt/DmnManagementServiceTest.java +++ b/modules/flowable-dmn-engine/src/test/java/org/flowable/dmn/engine/test/mgmt/DmnManagementServiceTest.java @@ -51,7 +51,7 @@ public void testTableCount() { String tablePrefix = dmnEngineConfiguration.getDatabaseTablePrefix(); - assertThat(tableCount).containsEntry(tablePrefix + "ACT_GE_PROPERTY", 2L); + assertThat(tableCount).containsEntry(tablePrefix + "ACT_GE_PROPERTY", 3L); assertThat(tableCount.get(tablePrefix + "ACT_DMN_DECISION")).isZero(); assertThat(tableCount.get(tablePrefix + "ACT_DMN_DEPLOYMENT")).isZero(); assertThat(tableCount.get(tablePrefix + "ACT_DMN_DEPLOYMENT_RESOURCE")).isZero(); diff --git a/modules/flowable-dmn-spring-configurator/src/main/java/org/flowable/dmn/spring/configurator/SpringDmnEngineConfigurator.java b/modules/flowable-dmn-spring-configurator/src/main/java/org/flowable/dmn/spring/configurator/SpringDmnEngineConfigurator.java index 646b566bd98..6864624f7d7 100644 --- a/modules/flowable-dmn-spring-configurator/src/main/java/org/flowable/dmn/spring/configurator/SpringDmnEngineConfigurator.java +++ b/modules/flowable-dmn-spring-configurator/src/main/java/org/flowable/dmn/spring/configurator/SpringDmnEngineConfigurator.java @@ -12,10 +12,8 @@ */ package org.flowable.dmn.spring.configurator; -import org.flowable.common.engine.api.FlowableException; import org.flowable.common.engine.impl.AbstractEngineConfiguration; import org.flowable.common.spring.SpringEngineConfiguration; -import org.flowable.dmn.engine.DmnEngine; import org.flowable.dmn.engine.configurator.DmnEngineConfigurator; import org.flowable.dmn.spring.SpringDmnEngineConfiguration; @@ -41,17 +39,8 @@ public void configure(AbstractEngineConfiguration engineConfiguration) { dmnEngineConfiguration.setBeans(springEngineConfiguration.getBeans()); } - initDmnEngine(); + initEngine(); initServiceConfigurations(engineConfiguration, dmnEngineConfiguration); } - - @Override - protected synchronized DmnEngine initDmnEngine() { - if (dmnEngineConfiguration == null) { - throw new FlowableException("DmnEngineConfiguration is required"); - } - - return dmnEngineConfiguration.buildDmnEngine(); - } } diff --git a/modules/flowable-dmn-spring/src/main/java/org/flowable/dmn/spring/SpringDmnEngineConfiguration.java b/modules/flowable-dmn-spring/src/main/java/org/flowable/dmn/spring/SpringDmnEngineConfiguration.java index 9d1a5bdfa97..da7547bf418 100644 --- a/modules/flowable-dmn-spring/src/main/java/org/flowable/dmn/spring/SpringDmnEngineConfiguration.java +++ b/modules/flowable-dmn-spring/src/main/java/org/flowable/dmn/spring/SpringDmnEngineConfiguration.java @@ -66,8 +66,8 @@ public SpringDmnEngineConfiguration() { } @Override - public DmnEngine buildDmnEngine() { - DmnEngine dmnEngine = super.buildDmnEngine(); + public DmnEngine buildEngine() { + DmnEngine dmnEngine = super.buildEngine(); DmnEngines.setInitialized(true); enginesBuild.add(dmnEngine.getName()); return dmnEngine; diff --git a/modules/flowable-dmn-spring/src/main/java/org/flowable/dmn/spring/autodeployment/AbstractDmnAutoDeploymentStrategy.java b/modules/flowable-dmn-spring/src/main/java/org/flowable/dmn/spring/autodeployment/AbstractDmnAutoDeploymentStrategy.java index f613f9856c8..1258aead69a 100644 --- a/modules/flowable-dmn-spring/src/main/java/org/flowable/dmn/spring/autodeployment/AbstractDmnAutoDeploymentStrategy.java +++ b/modules/flowable-dmn-spring/src/main/java/org/flowable/dmn/spring/autodeployment/AbstractDmnAutoDeploymentStrategy.java @@ -17,7 +17,7 @@ import java.io.InputStream; import java.io.UncheckedIOException; -import org.flowable.common.engine.impl.lock.LockManager; +import org.flowable.common.engine.api.lock.LockManager; import org.flowable.common.spring.CommonAutoDeploymentProperties; import org.flowable.common.spring.CommonAutoDeploymentStrategy; import org.flowable.dmn.api.DmnDeploymentBuilder; diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/lock/LockManager.java b/modules/flowable-engine-common-api/src/main/java/org/flowable/common/engine/api/lock/LockManager.java similarity index 97% rename from modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/lock/LockManager.java rename to modules/flowable-engine-common-api/src/main/java/org/flowable/common/engine/api/lock/LockManager.java index b22ca6fb9a1..aecd27f6b94 100644 --- a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/lock/LockManager.java +++ b/modules/flowable-engine-common-api/src/main/java/org/flowable/common/engine/api/lock/LockManager.java @@ -10,7 +10,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.flowable.common.engine.impl.lock; +package org.flowable.common.engine.api.lock; import java.time.Duration; import java.util.function.Supplier; diff --git a/modules/flowable-engine-common/pom.xml b/modules/flowable-engine-common/pom.xml index 3d30c94248b..f85c95daa3a 100644 --- a/modules/flowable-engine-common/pom.xml +++ b/modules/flowable-engine-common/pom.xml @@ -156,11 +156,6 @@ com.fasterxml.jackson.core jackson-databind - - org.liquibase - liquibase-core - true - com.fasterxml.uuid java-uuid-generator diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractBuildableEngineConfiguration.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractBuildableEngineConfiguration.java new file mode 100644 index 00000000000..28038c78ec3 --- /dev/null +++ b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractBuildableEngineConfiguration.java @@ -0,0 +1,64 @@ +/* Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flowable.common.engine.impl; + +import java.util.function.Consumer; + +import org.flowable.common.engine.api.Engine; + +/** + * @author Filip Hrisafov + */ +public abstract class AbstractBuildableEngineConfiguration extends AbstractEngineConfiguration { + + protected boolean runPostEngineBuildConsumer = true; + protected Consumer postEngineBuildConsumer; + + public E buildEngine() { + init(); + initPostEngineBuildConsumer(); + E engine = createEngine(); + if (runPostEngineBuildConsumer) { + postEngineBuildConsumer.accept(engine); + } + return engine; + } + + protected abstract E createEngine(); + + protected abstract void init(); + + protected void initPostEngineBuildConsumer() { + if (this.postEngineBuildConsumer == null) { + this.postEngineBuildConsumer = createPostEngineBuildConsumer(); + } + } + + protected abstract Consumer createPostEngineBuildConsumer(); + + public boolean isRunPostEngineBuildConsumer() { + return runPostEngineBuildConsumer; + } + + public void setRunPostEngineBuildConsumer(boolean runPostEngineBuildConsumer) { + this.runPostEngineBuildConsumer = runPostEngineBuildConsumer; + } + + public Consumer getPostEngineBuildConsumer() { + return postEngineBuildConsumer; + } + + public void setPostEngineBuildConsumer(Consumer postEngineBuildConsumer) { + this.postEngineBuildConsumer = postEngineBuildConsumer; + } +} diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java index 3fde91d9bda..ee0de1306c4 100755 --- a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java +++ b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java @@ -73,6 +73,7 @@ import org.flowable.common.engine.api.delegate.event.FlowableEventDispatcher; import org.flowable.common.engine.api.delegate.event.FlowableEventListener; import org.flowable.common.engine.api.engine.EngineLifecycleListener; +import org.flowable.common.engine.api.lock.LockManager; import org.flowable.common.engine.impl.agenda.AgendaOperationExecutionListener; import org.flowable.common.engine.impl.agenda.AgendaOperationRunner; import org.flowable.common.engine.impl.cfg.CommandExecutorImpl; @@ -86,6 +87,7 @@ import org.flowable.common.engine.impl.db.MybatisTypeAliasConfigurator; import org.flowable.common.engine.impl.db.MybatisTypeHandlerConfigurator; import org.flowable.common.engine.impl.db.SchemaManager; +import org.flowable.common.engine.impl.db.SchemaOperationsEngineBuild; import org.flowable.common.engine.impl.event.EventDispatchAction; import org.flowable.common.engine.impl.event.FlowableEventDispatcherImpl; import org.flowable.common.engine.impl.interceptor.Command; @@ -99,7 +101,6 @@ import org.flowable.common.engine.impl.interceptor.LogInterceptor; import org.flowable.common.engine.impl.interceptor.SessionFactory; import org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor; -import org.flowable.common.engine.impl.lock.LockManager; import org.flowable.common.engine.impl.lock.LockManagerImpl; import org.flowable.common.engine.impl.logging.LoggingListener; import org.flowable.common.engine.impl.logging.LoggingSession; @@ -172,6 +173,7 @@ public abstract class AbstractEngineConfiguration { protected int jdbcPingConnectionNotUsedFor; protected int jdbcDefaultTransactionIsolationLevel; protected DataSource dataSource; + protected Map additionalSchemaManagers; protected SchemaManager commonSchemaManager; protected SchemaManager schemaManager; protected Command schemaManagementCmd; @@ -431,7 +433,7 @@ public static Properties getDefaultDatabaseTypeMappings() { * Define a max length for storing String variable types in the database. Mainly used for the Oracle NVARCHAR2 limit of 2000 characters */ protected int maxLengthStringVariableType = -1; - + protected void initEngineConfigurations() { addEngineConfiguration(getEngineCfgKey(), getEngineScopeType(), this); } @@ -548,8 +550,22 @@ public void initSchemaManager() { if (this.commonSchemaManager == null) { this.commonSchemaManager = new CommonDbSchemaManager(); } + + if (this.schemaManager == null) { + this.schemaManager = createEngineSchemaManager(); + } + } + protected abstract SchemaManager createEngineSchemaManager(); + + public void initSchemaManagementCommand() { + if (schemaManagementCmd == null) { + if (usingRelationalDatabase && databaseSchemaUpdate != null) { + this.schemaManagementCmd = new SchemaOperationsEngineBuild(getEngineScopeType()); + } + } + } // session factories //////////////////////////////////////////////////////// public void addSessionFactory(SessionFactory sessionFactory) { @@ -1217,6 +1233,18 @@ public AbstractEngineConfiguration setSchemaManager(SchemaManager schemaManager) return this; } + public AbstractEngineConfiguration addAdditionalSchemaManager(SchemaManager schemaManager) { + if (this.additionalSchemaManagers == null) { + this.additionalSchemaManagers = new HashMap<>(); + } + this.additionalSchemaManagers.put(schemaManager.getContext(), schemaManager); + return this; + } + + public Map getAdditionalSchemaManagers() { + return additionalSchemaManagers; + } + public SchemaManager getCommonSchemaManager() { return commonSchemaManager; } diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfigurator.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfigurator.java index 769626b46ae..a0ec4df84a8 100644 --- a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfigurator.java +++ b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfigurator.java @@ -25,7 +25,9 @@ import org.apache.ibatis.type.TypeAliasRegistry; import org.apache.ibatis.type.TypeHandlerRegistry; +import org.flowable.common.engine.api.Engine; import org.flowable.common.engine.api.FlowableException; +import org.flowable.common.engine.api.engine.EngineLifecycleListener; import org.flowable.common.engine.impl.db.MybatisTypeAliasConfigurator; import org.flowable.common.engine.impl.db.MybatisTypeHandlerConfigurator; import org.flowable.common.engine.impl.persistence.entity.Entity; @@ -40,9 +42,10 @@ * * @author Joram Barrez */ -public abstract class AbstractEngineConfigurator implements EngineConfigurator { +public abstract class AbstractEngineConfigurator implements EngineConfigurator { protected boolean enableMybatisXmlMappingValidation; + protected E buildEngine; @Override public void beforeInit(AbstractEngineConfiguration engineConfiguration) { @@ -204,6 +207,30 @@ protected List getMybatisTypeHandlers() { return null; } + protected synchronized E initEngine() { + this.buildEngine = buildEngine(); + return buildEngine; + } + + protected abstract E buildEngine(); + + protected void initialiseCommonProperties(AbstractEngineConfiguration engineConfiguration, AbstractBuildableEngineConfiguration targetEngineConfiguration) { + initialiseCommonProperties(engineConfiguration, (AbstractEngineConfiguration) targetEngineConfiguration); + targetEngineConfiguration.setRunPostEngineBuildConsumer(false); + engineConfiguration.addEngineLifecycleListener(new EngineLifecycleListener() { + + @Override + public void onEngineBuilt(Engine engine) { + targetEngineConfiguration.getPostEngineBuildConsumer().accept(buildEngine); + } + + @Override + public void onEngineClosed(Engine engine) { + // nothing to do + } + }); + } + protected void initialiseCommonProperties(AbstractEngineConfiguration engineConfiguration, AbstractEngineConfiguration targetEngineConfiguration) { initEngineConfigurations(engineConfiguration, targetEngineConfiguration); initEventRegistryEventConsumers(engineConfiguration, targetEngineConfiguration); @@ -221,6 +248,7 @@ protected void initialiseCommonProperties(AbstractEngineConfiguration engineConf initClock(engineConfiguration, targetEngineConfiguration); initObjectMapper(engineConfiguration, targetEngineConfiguration); initVariableTypes(engineConfiguration, targetEngineConfiguration); + initSchemaManager(engineConfiguration, targetEngineConfiguration); } protected void initEngineConfigurations(AbstractEngineConfiguration engineConfiguration, AbstractEngineConfiguration targetEngineConfiguration) { @@ -305,6 +333,12 @@ protected void initVariableTypes(AbstractEngineConfiguration engineConfiguration } } + protected void initSchemaManager(AbstractEngineConfiguration engineConfiguration, AbstractEngineConfiguration targetEngineConfiguration) { + // We are going to disable the Schema management in the target engine as the lead engine is the one that is going to handle the schema generation + targetEngineConfiguration.setDatabaseSchemaUpdate(null); + engineConfiguration.addAdditionalSchemaManager(targetEngineConfiguration.createEngineSchemaManager()); + } + protected abstract List> getEntityInsertionOrder(); protected abstract List> getEntityDeletionOrder(); diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/FlowableVersions.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/FlowableVersions.java index 99e57d1463d..d09690de2d0 100644 --- a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/FlowableVersions.java +++ b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/FlowableVersions.java @@ -23,7 +23,7 @@ */ public class FlowableVersions { - public static final String CURRENT_VERSION = "7.1.0.0"; // Note the extra .x at the end. To cater for snapshot releases with different database changes + public static final String CURRENT_VERSION = "7.1.0.1"; // Note the extra .x at the end. To cater for snapshot releases with different database changes public static final List FLOWABLE_VERSIONS = new ArrayList<>(); @@ -143,6 +143,7 @@ public class FlowableVersions { FLOWABLE_VERSIONS.add(new FlowableVersion("7.0.0.0")); FLOWABLE_VERSIONS.add(new FlowableVersion("7.0.1.0")); FLOWABLE_VERSIONS.add(new FlowableVersion("7.0.1.1")); + FLOWABLE_VERSIONS.add(new FlowableVersion("7.1.0.0")); /* Current */ FLOWABLE_VERSIONS.add(new FlowableVersion(CURRENT_VERSION)); diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/CommonDbSchemaManager.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/CommonDbSchemaManager.java index 68953bd1a45..a1657990413 100644 --- a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/CommonDbSchemaManager.java +++ b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/CommonDbSchemaManager.java @@ -22,7 +22,7 @@ public class CommonDbSchemaManager extends ServiceSqlScriptBasedDbSchemaManager private static final String SCHEMA_COMPONENT = "common"; public CommonDbSchemaManager() { - super(PROPERTY_TABLE, SCHEMA_COMPONENT, null, COMMON_VERSION_PROPERTY); + super(PROPERTY_TABLE, SCHEMA_COMPONENT, COMMON_VERSION_PROPERTY); } @Override @@ -30,4 +30,14 @@ protected String getResourcesRootDirectory() { return "org/flowable/common/db/"; } + @Override + public void schemaCheckVersion() { + // Schema check is ignored for the common DB + } + + @Override + public String getContext() { + return SCHEMA_COMPONENT; + } + } diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/EngineDatabaseConfiguration.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/EngineDatabaseConfiguration.java deleted file mode 100644 index 32413101935..00000000000 --- a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/EngineDatabaseConfiguration.java +++ /dev/null @@ -1,44 +0,0 @@ -/* Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.flowable.common.engine.impl.db; - -import javax.sql.DataSource; - -import org.flowable.common.engine.impl.AbstractEngineConfiguration; - -/** - * @author Filip Hrisafov - */ -public class EngineDatabaseConfiguration implements LiquibaseDatabaseConfiguration { - - protected final AbstractEngineConfiguration engineConfiguration; - - public EngineDatabaseConfiguration(AbstractEngineConfiguration engineConfiguration) { - this.engineConfiguration = engineConfiguration; - } - - @Override - public DataSource getDataSource() { - return engineConfiguration.getDataSource(); - } - - @Override - public String getDatabaseSchema() { - return engineConfiguration.getDatabaseSchema(); - } - - @Override - public String getDatabaseCatalog() { - return engineConfiguration.getDatabaseCatalog(); - } -} diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/EngineSqlScriptBasedDbSchemaManager.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/EngineSqlScriptBasedDbSchemaManager.java new file mode 100644 index 00000000000..3e51d5a8d95 --- /dev/null +++ b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/EngineSqlScriptBasedDbSchemaManager.java @@ -0,0 +1,251 @@ +/* Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flowable.common.engine.impl.db; + +import java.util.List; + +import org.flowable.common.engine.api.FlowableException; +import org.flowable.common.engine.api.FlowableWrongDbException; +import org.flowable.common.engine.api.lock.LockManager; +import org.flowable.common.engine.impl.AbstractEngineConfiguration; +import org.flowable.common.engine.impl.FlowableVersions; +import org.flowable.common.engine.impl.persistence.entity.PropertyEntity; +import org.flowable.common.engine.impl.persistence.entity.PropertyEntityImpl; + +public abstract class EngineSqlScriptBasedDbSchemaManager extends AbstractSqlScriptBasedDbSchemaManager { + + protected final String context; + + protected EngineSqlScriptBasedDbSchemaManager(String context) { + this.context = context; + } + + protected abstract String getEngineVersion(); + + protected abstract String getSchemaVersionPropertyName(); + + protected abstract String getDbSchemaLockName(); + + protected abstract String getEngineTableName(); + + protected abstract String getChangeLogTableName(); + + protected abstract String getChangeLogTablePrefixName(); + + protected abstract String getDbVersionForChangelogVersion(String changeLogVersion); + + protected abstract AbstractEngineConfiguration getEngineConfiguration(); + + @Override + public void schemaCheckVersion() { + try { + String dbVersion = getDbVersion(); + String currentVersion = getEngineVersion(); + if (!currentVersion.equals(dbVersion)) { + throw new FlowableWrongDbException(currentVersion, dbVersion); + } + + String errorMessage = null; + if (!isEngineTablePresent()) { + errorMessage = addMissingComponent(errorMessage, context); + } + + if (errorMessage != null) { + throw new FlowableException("Flowable database problem: " + errorMessage); + } + + } catch (Exception e) { + if (isMissingTablesException(e)) { + throw new FlowableException( + "No flowable tables in DB. Set property \"databaseSchemaUpdate\" \"true\" or value=\"create-drop\" (use create-drop for testing only!) for automatic schema creation", + e); + } else { + if (e instanceof RuntimeException) { + throw (RuntimeException) e; + } else { + throw new FlowableException("couldn't get " + context + " db schema version", e); + } + } + } + + logger.debug("flowable {} db schema check successful", context); + } + + @Override + public void schemaCreate() { + + AbstractEngineConfiguration engineConfiguration = getEngineConfiguration(); + if (engineConfiguration.isUseLockForDatabaseSchemaUpdate()) { + LockManager lockManager = engineConfiguration.getLockManager(getDbSchemaLockName()); + lockManager.waitForLockRunAndRelease(engineConfiguration.getSchemaLockWaitTime(), () -> { + schemaCreateInLock(); + return null; + }); + } else { + schemaCreateInLock(); + } + } + + protected void schemaCreateInLock() { + if (isEngineTablePresent()) { + String dbVersion = getDbVersion(); + String engineVersion = getEngineVersion(); + if (!engineVersion.equals(dbVersion)) { + throw new FlowableWrongDbException(engineVersion, dbVersion); + } + } else { + dbSchemaCreateEngine(); + } + } + + protected void dbSchemaCreateEngine() { + executeMandatorySchemaResource("create", context); + } + + @Override + public void schemaDrop() { + + try { + executeMandatorySchemaResource("drop", context); + + } catch (Exception e) { + logger.info("Error dropping {} tables", context, e); + } + + } + + @Override + public String schemaUpdate() { + + PropertyEntity dbVersionProperty = null; + String feedback = null; + boolean isUpgradeNeeded = false; + int matchingVersionIndex = -1; + + DbSqlSession dbSqlSession = getDbSqlSession(); + boolean isEngineTablePresent = isEngineTablePresent(); + + ChangeLogVersion changeLogVersion = null; + String dbVersion = null; + if (isEngineTablePresent) { + dbVersionProperty = dbSqlSession.selectById(PropertyEntityImpl.class, getSchemaVersionPropertyName()); + if (dbVersionProperty != null) { + dbVersion = dbVersionProperty.getValue(); + } else { + changeLogVersion = getChangeLogVersion(); + dbVersion = changeLogVersion.dbVersion(); + } + } + + AbstractEngineConfiguration engineConfiguration = getEngineConfiguration(); + LockManager lockManager; + if (engineConfiguration.isUseLockForDatabaseSchemaUpdate()) { + lockManager = engineConfiguration.getLockManager(getDbSchemaLockName()); + lockManager.waitForLock(engineConfiguration.getSchemaLockWaitTime()); + } else { + lockManager = null; + } + + try { + if (isEngineTablePresent) { + matchingVersionIndex = FlowableVersions.getFlowableVersionIndexForDbVersion(dbVersion); + isUpgradeNeeded = (matchingVersionIndex != (FlowableVersions.FLOWABLE_VERSIONS.size() - 1)); + } + + if (isUpgradeNeeded) { + // Engine upgrade + dbSchemaUpgrade(context, matchingVersionIndex, dbVersion); + dbSchemaUpgraded(changeLogVersion); + + feedback = "upgraded Flowable from " + dbVersion + " to " + getEngineVersion(); + + } else if (!isEngineTablePresent) { + dbSchemaCreateEngine(); + } + + return feedback; + + } finally { + if (lockManager != null) { + lockManager.releaseLock(); + } + } + } + + @Override + public String getContext() { + return context; + } + + protected void dbSchemaUpgraded(ChangeLogVersion changeLogVersion) { + + } + + public boolean isEngineTablePresent() { + return isTablePresent(getEngineTableName()); + } + + protected String addMissingComponent(String missingComponents, String component) { + if (missingComponents == null) { + return "Tables missing for component(s) " + component; + } + return missingComponents + ", " + component; + } + + protected String getDbVersion() { + DbSqlSession dbSqlSession = getDbSqlSession(); + String selectSchemaVersionStatement = dbSqlSession.getDbSqlSessionFactory() + .mapStatement("org.flowable.common.engine.impl.persistence.entity.PropertyEntityImpl.selectPropertyValue"); + return dbSqlSession.getSqlSession().selectOne(selectSchemaVersionStatement, getSchemaVersionPropertyName()); + } + + protected ChangeLogVersion getChangeLogVersion() { + String changeLogTableName = getChangeLogTableName(); + if (changeLogTableName != null && isTablePresent(changeLogTableName)) { + DbSqlSession dbSqlSession = getDbSqlSession(); + String selectChangeLogVersionsStatement = dbSqlSession.getDbSqlSessionFactory().mapStatement("org.flowable.common.engine.impl.persistence.change.ChangeLog.selectFlowableChangeLogVersions"); + List changeLogIds = dbSqlSession.getSqlSession().selectList(selectChangeLogVersionsStatement, getChangeLogTablePrefixName()); + if (changeLogIds != null && !changeLogIds.isEmpty()) { + String changeLogVersion = changeLogIds.get(changeLogIds.size() - 1); + return new ChangeLogVersion(changeLogVersion, getDbVersionForChangelogVersion(changeLogVersion)); + } + } + + return new ChangeLogVersion(null, getDbVersionForChangelogVersion(null)); + } + + protected boolean isMissingTablesException(Exception e) { + String exceptionMessage = e.getMessage(); + if (e.getMessage() != null) { + // Matches message returned from H2 + if ((exceptionMessage.contains("Table")) && (exceptionMessage.contains("not found"))) { + return true; + } + + // Message returned from MySQL and Oracle + if ((exceptionMessage.contains("Table") || exceptionMessage.contains("table")) && (exceptionMessage.contains("doesn't exist"))) { + return true; + } + + // Message returned from Postgres + if ((exceptionMessage.contains("relation") || exceptionMessage.contains("table")) && (exceptionMessage.contains("does not exist"))) { + return true; + } + } + return false; + } + + public record ChangeLogVersion(String version, String dbVersion) { + } + +} diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/LiquibaseBasedSchemaManager.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/LiquibaseBasedSchemaManager.java deleted file mode 100644 index 68654fbd9a2..00000000000 --- a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/LiquibaseBasedSchemaManager.java +++ /dev/null @@ -1,215 +0,0 @@ -/* Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.flowable.common.engine.impl.db; - -import java.sql.Connection; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; - -import org.apache.commons.lang3.StringUtils; -import org.flowable.common.engine.api.FlowableException; -import org.flowable.common.engine.impl.AbstractEngineConfiguration; -import org.flowable.common.engine.impl.context.Context; -import org.flowable.common.engine.impl.interceptor.CommandContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.util.ClassUtils; - -import liquibase.Liquibase; -import liquibase.Scope; -import liquibase.database.Database; -import liquibase.database.DatabaseConnection; -import liquibase.database.DatabaseFactory; -import liquibase.database.jvm.JdbcConnection; -import liquibase.exception.DatabaseException; -import liquibase.resource.ClassLoaderResourceAccessor; -import liquibase.ui.LoggerUIService; - -/** - * @author Filip Hrisafov - */ -public abstract class LiquibaseBasedSchemaManager implements SchemaManager { - - protected static final Map LIQUIBASE_SCOPE_VALUES = new HashMap<>(); - - static { - LoggerUIService uiService = new LoggerUIService(); - uiService.setStandardLogLevel(Level.FINE); - LIQUIBASE_SCOPE_VALUES.put(Scope.Attr.ui.name(), uiService); - } - - protected final Logger logger = LoggerFactory.getLogger(getClass()); - - protected final String context; - protected final String changeLogFile; - protected final String changeLogPrefix; - - public LiquibaseBasedSchemaManager(String context, String changeLogFile, String changeLogPrefix) { - this.context = context; - this.changeLogFile = changeLogFile; - this.changeLogPrefix = changeLogPrefix; - } - - public void initSchema(String databaseSchemaUpdate) { - try { - if (AbstractEngineConfiguration.DB_SCHEMA_UPDATE_CREATE.equals(databaseSchemaUpdate)) { - runForLiquibase(this::schemaCreate); - } - else if (AbstractEngineConfiguration.DB_SCHEMA_UPDATE_CREATE_DROP.equals(databaseSchemaUpdate)) { - runForLiquibase(this::schemaCreate); - - } else if (AbstractEngineConfiguration.DB_SCHEMA_UPDATE_DROP_CREATE.equals(databaseSchemaUpdate)) { - runForLiquibase(() -> { - schemaDrop(); - schemaCreate(); - }); - - } else if (AbstractEngineConfiguration.DB_SCHEMA_UPDATE_TRUE.equals(databaseSchemaUpdate)) { - runForLiquibase(this::schemaUpdate); - - } else if (AbstractEngineConfiguration.DB_SCHEMA_UPDATE_FALSE.equals(databaseSchemaUpdate)) { - runForLiquibase(this::schemaCheckVersion); - - } - } catch (Exception e) { - throw new FlowableException("Error initialising " + context + " data model", e); - } - } - - protected void runForLiquibase(Runnable runnable) throws Exception { - Scope.child(LIQUIBASE_SCOPE_VALUES, runnable::run); - } - - @Override - public void schemaCreate() { - Liquibase liquibase = null; - try { - liquibase = createLiquibaseInstance(getDatabaseConfiguration()); - liquibase.update(context); - } catch (Exception e) { - throw new FlowableException("Error creating " + context + " engine tables", e); - } finally { - closeDatabase(liquibase); - } - } - - @Override - public void schemaDrop() { - Liquibase liquibase = null; - try { - liquibase = createLiquibaseInstance(getDatabaseConfiguration()); - liquibase.dropAll(); - } catch (Exception e) { - throw new FlowableException("Error dropping " + context + " engine tables", e); - } finally { - closeDatabase(liquibase); - } - } - - @Override - public String schemaUpdate() { - Liquibase liquibase = null; - try { - liquibase = createLiquibaseInstance(getDatabaseConfiguration()); - liquibase.update(context); - } catch (Exception e) { - throw new FlowableException("Error updating " + context + " engine tables", e); - } finally { - closeDatabase(liquibase); - } - return null; - } - - @Override - public void schemaCheckVersion() { - Liquibase liquibase = null; - try { - liquibase = createLiquibaseInstance(getDatabaseConfiguration()); - liquibase.validate(); - } catch (Exception e) { - throw new FlowableException("Error validating " + context + " engine schema", e); - } finally { - closeDatabase(liquibase); - } - } - - protected abstract LiquibaseDatabaseConfiguration getDatabaseConfiguration(); - - protected Liquibase createLiquibaseInstance(LiquibaseDatabaseConfiguration databaseConfiguration) throws SQLException { - Connection jdbcConnection = null; - boolean closeConnection = false; - try { - CommandContext commandContext = Context.getCommandContext(); - if (commandContext == null) { - jdbcConnection = databaseConfiguration.getDataSource().getConnection(); - closeConnection = true; - } else { - jdbcConnection = commandContext.getSession(DbSqlSession.class).getSqlSession().getConnection(); - } - - // A commit is needed here, because one of the things that Liquibase does when acquiring its lock - // is doing a rollback, which removes all changes done so far. - // For most databases, this is not a problem as DDL statements are not transactional. - // However for some (e.g. sql server), this would remove all previous statements, which is not wanted, - // hence the extra commit here. - if (!jdbcConnection.getAutoCommit()) { - jdbcConnection.commit(); - } - - DatabaseConnection connection = new JdbcConnection(jdbcConnection); - Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(connection); - database.setDatabaseChangeLogTableName(changeLogPrefix + database.getDatabaseChangeLogTableName()); - database.setDatabaseChangeLogLockTableName(changeLogPrefix + database.getDatabaseChangeLogLockTableName()); - - String databaseSchema = databaseConfiguration.getDatabaseSchema(); - if (StringUtils.isNotEmpty(databaseSchema)) { - database.setDefaultSchemaName(databaseSchema); - database.setLiquibaseSchemaName(databaseSchema); - } - - String databaseCatalog = databaseConfiguration.getDatabaseCatalog(); - if (StringUtils.isNotEmpty(databaseCatalog)) { - database.setDefaultCatalogName(databaseCatalog); - database.setLiquibaseCatalogName(databaseCatalog); - } - - return new Liquibase(changeLogFile, new ClassLoaderResourceAccessor(), database); - - } catch (Exception e) { - // We only close the connection if an exception occurred, otherwise the Liquibase instance cannot be used - if (jdbcConnection != null && closeConnection) { - jdbcConnection.close(); - } - throw new FlowableException("Error creating " + context + " liquibase instance", e); - } - } - - protected void closeDatabase(Liquibase liquibase) { - if (liquibase != null) { - Database database = liquibase.getDatabase(); - if (database != null) { - // do not close the shared connection if a command context is currently active - if (Context.getCommandContext() == null) { - try { - database.close(); - } catch (DatabaseException e) { - logger.warn("Error closing database for {}", context, e); - } - } - } - } - } - -} diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/LiquibaseDatabaseConfiguration.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/LiquibaseDatabaseConfiguration.java deleted file mode 100644 index 36e670b033b..00000000000 --- a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/LiquibaseDatabaseConfiguration.java +++ /dev/null @@ -1,30 +0,0 @@ -/* Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.flowable.common.engine.impl.db; - -import javax.sql.DataSource; - -/** - * A configuration that is used by the {@link LiquibaseBasedSchemaManager} - * to ease the access to certain database properties. - * - * @author Filip Hrisafov - */ -public interface LiquibaseDatabaseConfiguration { - - DataSource getDataSource(); - - String getDatabaseSchema(); - - String getDatabaseCatalog(); -} diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/SchemaManager.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/SchemaManager.java index 09e90e5695e..8ef849c21c4 100644 --- a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/SchemaManager.java +++ b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/SchemaManager.java @@ -29,5 +29,7 @@ default String schemaUpdate(String engineDbVersion) { } void schemaCheckVersion(); + + String getContext(); } diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/SchemaOperationsEngineBuild.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/SchemaOperationsEngineBuild.java new file mode 100644 index 00000000000..a7210015dbd --- /dev/null +++ b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/SchemaOperationsEngineBuild.java @@ -0,0 +1,100 @@ +/* Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flowable.common.engine.impl.db; + +import java.util.ArrayList; +import java.util.List; +import java.util.ListIterator; +import java.util.Map; + +import org.flowable.common.engine.api.FlowableIllegalArgumentException; +import org.flowable.common.engine.impl.AbstractEngineConfiguration; +import org.flowable.common.engine.impl.interceptor.Command; +import org.flowable.common.engine.impl.interceptor.CommandContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Filip Hrisafov + */ +public class SchemaOperationsEngineBuild implements Command { + + private static final Logger LOGGER = LoggerFactory.getLogger(SchemaOperationsEngineBuild.class); + + protected final String engineScopeType; + protected final String schemaOperation; + + public SchemaOperationsEngineBuild(String engineScopeType) { + this(engineScopeType, null); + } + + public SchemaOperationsEngineBuild(String engineScopeType, String schemaOperation) { + this.engineScopeType = engineScopeType; + this.schemaOperation = schemaOperation; + } + + @Override + public Void execute(CommandContext commandContext) { + + AbstractEngineConfiguration engineConfiguration = commandContext.getEngineConfigurations() + .get(engineScopeType); + if (engineConfiguration == null) { + throw new FlowableIllegalArgumentException("There is no engine configuration for scope " + engineScopeType); + } + + String databaseSchemaUpdate = schemaOperation == null ? engineConfiguration.getDatabaseSchemaUpdate() : schemaOperation; + List schemaManagers = new ArrayList<>(); + schemaManagers.add(engineConfiguration.getCommonSchemaManager()); + schemaManagers.add(engineConfiguration.getSchemaManager()); + + Map additionalSchemaManagers = engineConfiguration.getAdditionalSchemaManagers(); + + if (additionalSchemaManagers != null) { + schemaManagers.addAll(additionalSchemaManagers.values()); + } + + executeSchemaUpdate(schemaManagers, databaseSchemaUpdate); + + return null; + } + + protected void executeSchemaUpdate(List schemaManagers, String databaseSchemaUpdate) { + LOGGER.debug("Executing schema management with setting {} from engine {}", databaseSchemaUpdate, engineScopeType); + + if (AbstractEngineConfiguration.DB_SCHEMA_UPDATE_DROP_CREATE.equals(databaseSchemaUpdate)) { + // The drop is executed in the reverse order + ListIterator listIterator = schemaManagers.listIterator(schemaManagers.size()); + while (listIterator.hasPrevious()) { + SchemaManager schemaManager = listIterator.previous(); + try { + schemaManager.schemaDrop(); + } catch (RuntimeException e) { + // ignore + } + } + } + + if (AbstractEngineConfiguration.DB_SCHEMA_UPDATE_CREATE_DROP.equals(databaseSchemaUpdate) + || AbstractEngineConfiguration.DB_SCHEMA_UPDATE_DROP_CREATE.equals(databaseSchemaUpdate) + || AbstractEngineConfiguration.DB_SCHEMA_UPDATE_CREATE.equals(databaseSchemaUpdate)) { + schemaManagers.forEach(SchemaManager::schemaCreate); + + } else if (AbstractEngineConfiguration.DB_SCHEMA_UPDATE_FALSE.equals(databaseSchemaUpdate)) { + schemaManagers.forEach(SchemaManager::schemaCheckVersion); + + } else if (AbstractEngineConfiguration.DB_SCHEMA_UPDATE_TRUE.equals(databaseSchemaUpdate)) { + schemaManagers.forEach(SchemaManager::schemaUpdate); + } + + } +} diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/SchemaOperationsEngineDropDbCmd.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/SchemaOperationsEngineDropDbCmd.java new file mode 100644 index 00000000000..17865d2ca7d --- /dev/null +++ b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/SchemaOperationsEngineDropDbCmd.java @@ -0,0 +1,69 @@ +/* Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.flowable.common.engine.impl.db; + +import java.util.ArrayList; +import java.util.List; +import java.util.ListIterator; +import java.util.Map; + +import org.flowable.common.engine.api.FlowableIllegalArgumentException; +import org.flowable.common.engine.impl.AbstractEngineConfiguration; +import org.flowable.common.engine.impl.interceptor.Command; +import org.flowable.common.engine.impl.interceptor.CommandContext; + +/** + * @author Filip Hrisafov + */ +public class SchemaOperationsEngineDropDbCmd implements Command { + + protected final String engineScopeType; + + public SchemaOperationsEngineDropDbCmd(String engineScopeType) { + this.engineScopeType = engineScopeType; + } + + @Override + public Void execute(CommandContext commandContext) { + + AbstractEngineConfiguration engineConfiguration = commandContext.getEngineConfigurations() + .get(engineScopeType); + if (engineConfiguration == null) { + throw new FlowableIllegalArgumentException("There is no engine configuration for scope " + engineScopeType); + } + + List schemaManagers = new ArrayList<>(); + schemaManagers.add(engineConfiguration.getCommonSchemaManager()); + schemaManagers.add(engineConfiguration.getSchemaManager()); + + Map additionalSchemaManagers = engineConfiguration.getAdditionalSchemaManagers(); + + if (additionalSchemaManagers != null) { + schemaManagers.addAll(additionalSchemaManagers.values()); + } + + // The drop is executed in the reverse order + ListIterator listIterator = schemaManagers.listIterator(schemaManagers.size()); + while (listIterator.hasPrevious()) { + SchemaManager schemaManager = listIterator.previous(); + try { + schemaManager.schemaDrop(); + } catch (RuntimeException e) { + // ignore + } + } + + return null; + } + +} diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/ServiceSqlScriptBasedDbSchemaManager.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/ServiceSqlScriptBasedDbSchemaManager.java index 2bab240ec0c..82054e2156c 100644 --- a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/ServiceSqlScriptBasedDbSchemaManager.java +++ b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/ServiceSqlScriptBasedDbSchemaManager.java @@ -23,13 +23,11 @@ public abstract class ServiceSqlScriptBasedDbSchemaManager extends AbstractSqlSc protected String table; protected String schemaComponent; - protected String schemaComponentHistory; protected String schemaVersionProperty; - public ServiceSqlScriptBasedDbSchemaManager(String table, String schemaComponent, String schemaComponentHistory, String schemaVersionProperty) { + public ServiceSqlScriptBasedDbSchemaManager(String table, String schemaComponent, String schemaVersionProperty) { this.table = table; this.schemaComponent = schemaComponent; - this.schemaComponentHistory = schemaComponentHistory; this.schemaVersionProperty = schemaVersionProperty; } @@ -47,16 +45,14 @@ public void schemaCreate() { protected void internalDbSchemaCreate() { executeMandatorySchemaResource("create", schemaComponent); - if (isHistoryUsed()) { - executeMandatorySchemaResource("create", schemaComponentHistory); - } } @Override public void schemaDrop() { - executeMandatorySchemaResource("drop", schemaComponent); - if (isHistoryUsed()) { - executeMandatorySchemaResource("drop", schemaComponentHistory); + try { + executeMandatorySchemaResource("drop", schemaComponent); + } catch (Exception e) { + logger.info("Error dropping {} tables", schemaComponent, e); } } @@ -81,9 +77,6 @@ public String schemaUpdate(String engineDbVersion) { boolean isUpgradeNeeded = (matchingVersionIndex != (FlowableVersions.FLOWABLE_VERSIONS.size() - 1)); if (isUpgradeNeeded) { dbSchemaUpgrade(schemaComponent, matchingVersionIndex, engineDbVersion); - if (isHistoryUsed()) { - dbSchemaUpgrade(schemaComponentHistory, matchingVersionIndex, engineDbVersion); - } } feedback = "upgraded from " + compareWithVersion + " to " + FlowableVersions.CURRENT_VERSION; @@ -104,10 +97,6 @@ public void schemaCheckVersion() { protected boolean isUpdateNeeded() { return isTablePresent(table); } - - protected boolean isHistoryUsed() { - return getDbSqlSession().getDbSqlSessionFactory().isDbHistoryUsed() && schemaComponentHistory != null; - } protected String getSchemaVersion() { if (schemaVersionProperty == null) { diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/lock/LockManagerImpl.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/lock/LockManagerImpl.java index 782863d3e1b..361e7e03f5c 100644 --- a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/lock/LockManagerImpl.java +++ b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/lock/LockManagerImpl.java @@ -19,6 +19,7 @@ import org.apache.commons.lang3.StringUtils; import org.flowable.common.engine.api.FlowableException; import org.flowable.common.engine.api.FlowableOptimisticLockingException; +import org.flowable.common.engine.api.lock.LockManager; import org.flowable.common.engine.impl.cfg.TransactionPropagation; import org.flowable.common.engine.impl.cmd.GetLockValueCmd; import org.flowable.common.engine.impl.cmd.LockCmd; diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/test/EnsureCleanDbUtils.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/test/EnsureCleanDbUtils.java index 602fb1f0c69..8cfc39a226c 100644 --- a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/test/EnsureCleanDbUtils.java +++ b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/test/EnsureCleanDbUtils.java @@ -101,9 +101,15 @@ public static void assertAndEnsureCleanDb(String testName, Logger logger, Abstra logger.info("dropping and recreating db"); if (dropAndRecreateDbCommand != null) { - CommandExecutor commandExecutor = engineConfiguration.getCommandExecutor(); - CommandConfig config = new CommandConfig().transactionNotSupported(); - commandExecutor.execute(config, dropAndRecreateDbCommand); + String originalDatabaseSchemaUpdate = engineConfiguration.getDatabaseSchemaUpdate(); + try { + engineConfiguration.setDatabaseSchemaUpdate(AbstractEngineConfiguration.DB_SCHEMA_UPDATE_DROP_CREATE); + CommandExecutor commandExecutor = engineConfiguration.getCommandExecutor(); + CommandConfig config = new CommandConfig().transactionNotSupported(); + commandExecutor.execute(config, dropAndRecreateDbCommand); + } finally { + engineConfiguration.setDatabaseSchemaUpdate(originalDatabaseSchemaUpdate); + } } if (hasNoException) { diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.cockroachdb.create.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.cockroachdb.create.common.sql index 84884727c8f..4e384686a9a 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.cockroachdb.create.common.sql +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.cockroachdb.create.common.sql @@ -16,9 +16,46 @@ CREATE TABLE if not exists ACT_GE_BYTEARRAY ( ); insert into ACT_GE_PROPERTY -values ('common.schema.version', '7.1.0.0', 1); +values ('common.schema.version', '7.1.0.1', 1); insert into ACT_GE_PROPERTY values ('next.dbid', '1', 1); --- force-commit \ No newline at end of file +create table FLW_RU_BATCH ( + ID_ varchar(64) not null, + REV_ integer, + TYPE_ varchar(64) not null, + SEARCH_KEY_ varchar(255), + SEARCH_KEY2_ varchar(255), + CREATE_TIME_ timestamp not null, + COMPLETE_TIME_ timestamp, + STATUS_ varchar(255), + BATCH_DOC_ID_ varchar(64), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table FLW_RU_BATCH_PART ( + ID_ varchar(64) not null, + REV_ integer, + BATCH_ID_ varchar(64), + TYPE_ varchar(64) not null, + SCOPE_ID_ varchar(64), + SUB_SCOPE_ID_ varchar(64), + SCOPE_TYPE_ varchar(64), + SEARCH_KEY_ varchar(255), + SEARCH_KEY2_ varchar(255), + CREATE_TIME_ timestamp not null, + COMPLETE_TIME_ timestamp, + STATUS_ varchar(255), + RESULT_DOC_ID_ varchar(64), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); + +alter table FLW_RU_BATCH_PART + add constraint FLW_FK_BATCH_PART_PARENT + foreign key (BATCH_ID_) + references FLW_RU_BATCH (ID_); diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.db2.create.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.db2.create.common.sql index 8b70c5e2c1c..0d95dcb029e 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.db2.create.common.sql +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.db2.create.common.sql @@ -16,7 +16,590 @@ create table ACT_GE_BYTEARRAY ( ); insert into ACT_GE_PROPERTY -values ('common.schema.version', '7.1.0.0', 1); +values ('common.schema.version', '7.1.0.1', 1); insert into ACT_GE_PROPERTY values ('next.dbid', '1', 1); + + +create table ACT_RU_ENTITYLINK ( + ID_ varchar(64) not null, + REV_ integer, + CREATE_TIME_ timestamp, + LINK_TYPE_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PARENT_ELEMENT_ID_ varchar(255), + REF_SCOPE_ID_ varchar(255), + REF_SCOPE_TYPE_ varchar(255), + REF_SCOPE_DEFINITION_ID_ varchar(255), + ROOT_SCOPE_ID_ varchar(255), + ROOT_SCOPE_TYPE_ varchar(255), + HIERARCHY_TYPE_ varchar(255), + primary key (ID_) +); + +create index ACT_IDX_ENT_LNK_SCOPE on ACT_RU_ENTITYLINK(SCOPE_ID_, SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_REF_SCOPE on ACT_RU_ENTITYLINK(REF_SCOPE_ID_, REF_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_ROOT_SCOPE on ACT_RU_ENTITYLINK(ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_SCOPE_DEF on ACT_RU_ENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_, LINK_TYPE_); + +create table ACT_HI_ENTITYLINK ( + ID_ varchar(64) not null, + LINK_TYPE_ varchar(255), + CREATE_TIME_ timestamp, + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PARENT_ELEMENT_ID_ varchar(255), + REF_SCOPE_ID_ varchar(255), + REF_SCOPE_TYPE_ varchar(255), + REF_SCOPE_DEFINITION_ID_ varchar(255), + ROOT_SCOPE_ID_ varchar(255), + ROOT_SCOPE_TYPE_ varchar(255), + HIERARCHY_TYPE_ varchar(255), + primary key (ID_) +); + +create index ACT_IDX_HI_ENT_LNK_SCOPE on ACT_HI_ENTITYLINK(SCOPE_ID_, SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_REF_SCOPE on ACT_HI_ENTITYLINK(REF_SCOPE_ID_, REF_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_ROOT_SCOPE on ACT_HI_ENTITYLINK(ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_SCOPE_DEF on ACT_HI_ENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_, LINK_TYPE_); + + +create table ACT_RU_IDENTITYLINK ( + ID_ varchar(64) not null, + REV_ integer, + GROUP_ID_ varchar(255), + TYPE_ varchar(255), + USER_ID_ varchar(255), + TASK_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + primary key (ID_) +); + +create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_); +create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_); +create index ACT_IDX_IDENT_LNK_SCOPE on ACT_RU_IDENTITYLINK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_IDENT_LNK_SUB_SCOPE on ACT_RU_IDENTITYLINK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_IDENT_LNK_SCOPE_DEF on ACT_RU_IDENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_HI_IDENTITYLINK ( + ID_ varchar(64) not null, + GROUP_ID_ varchar(255), + TYPE_ varchar(255), + USER_ID_ varchar(255), + TASK_ID_ varchar(64), + CREATE_TIME_ timestamp, + PROC_INST_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + primary key (ID_) +); + +create index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK(USER_ID_); +create index ACT_IDX_HI_IDENT_LNK_SCOPE on ACT_HI_IDENTITYLINK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_IDENT_LNK_SUB_SCOPE on ACT_HI_IDENTITYLINK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_IDENT_LNK_SCOPE_DEF on ACT_HI_IDENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + + +create table ACT_RU_JOB ( + ID_ varchar(64) not null, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) not null, + LOCK_EXP_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ smallint check(EXCLUSIVE_ in (1,0)), + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_TIMER_JOB ( + ID_ varchar(64) not null, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) not null, + LOCK_EXP_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ smallint check(EXCLUSIVE_ in (1,0)), + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_SUSPENDED_JOB ( + ID_ varchar(64) not null, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) not null, + EXCLUSIVE_ smallint check(EXCLUSIVE_ in (1,0)), + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_DEADLETTER_JOB ( + ID_ varchar(64) not null, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) not null, + EXCLUSIVE_ smallint check(EXCLUSIVE_ in (1,0)), + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_HISTORY_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + LOCK_EXP_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + ADV_HANDLER_CFG_ID_ varchar(64), + CREATE_TIME_ timestamp, + SCOPE_TYPE_ varchar(255), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_EXTERNAL_JOB ( + ID_ varchar(64) not null, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) not null, + LOCK_EXP_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ smallint check(EXCLUSIVE_ in (1,0)), + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create index ACT_IDX_JOB_EXCEPTION_ID on ACT_RU_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_JOB_CUSTOM_VAL_ID on ACT_RU_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_JOB_CORRELATION_ID on ACT_RU_JOB(CORRELATION_ID_); + +create index ACT_IDX_TJOB_EXCEPTION_ID on ACT_RU_TIMER_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_TJOB_CUSTOM_VAL_ID on ACT_RU_TIMER_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_TJOB_CORRELATION_ID on ACT_RU_TIMER_JOB(CORRELATION_ID_); +create index ACT_IDX_TJOB_DUEDATE on ACT_RU_TIMER_JOB(DUEDATE_); + +create index ACT_IDX_SJOB_EXCEPTION_ID on ACT_RU_SUSPENDED_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_SJOB_CUSTOM_VAL_ID on ACT_RU_SUSPENDED_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_SJOB_CORRELATION_ID on ACT_RU_SUSPENDED_JOB(CORRELATION_ID_); + +create index ACT_IDX_DJOB_EXCEPTION_ID on ACT_RU_DEADLETTER_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_DJOB_CUSTOM_VAL_ID on ACT_RU_DEADLETTER_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_DJOB_CORRELATION_ID on ACT_RU_DEADLETTER_JOB(CORRELATION_ID_); + +create index ACT_IDX_EJOB_EXCEPTION_ID on ACT_RU_EXTERNAL_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_EJOB_CUSTOM_VAL_ID on ACT_RU_EXTERNAL_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_EJOB_CORRELATION_ID on ACT_RU_EXTERNAL_JOB(CORRELATION_ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_CUSTOM_VAL + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_TIMER_JOB + add constraint ACT_FK_TJOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_TIMER_JOB + add constraint ACT_FK_TJOB_CUSTOM_VAL + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_SUSPENDED_JOB + add constraint ACT_FK_SJOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_SUSPENDED_JOB + add constraint ACT_FK_SJOB_CUSTOM_VAL + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_DEADLETTER_JOB + add constraint ACT_FK_DJOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_DEADLETTER_JOB + add constraint ACT_FK_DJOB_CUSTOM_VAL + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EXTERNAL_JOB + add constraint ACT_FK_EJOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EXTERNAL_JOB + add constraint ACT_FK_EJOB_CUSTOM_VAL + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +create index ACT_IDX_JOB_SCOPE on ACT_RU_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_JOB_SUB_SCOPE on ACT_RU_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_JOB_SCOPE_DEF on ACT_RU_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_TJOB_SCOPE on ACT_RU_TIMER_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TJOB_SUB_SCOPE on ACT_RU_TIMER_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TJOB_SCOPE_DEF on ACT_RU_TIMER_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_SJOB_SCOPE on ACT_RU_SUSPENDED_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_SJOB_SUB_SCOPE on ACT_RU_SUSPENDED_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_SJOB_SCOPE_DEF on ACT_RU_SUSPENDED_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_DJOB_SCOPE on ACT_RU_DEADLETTER_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_DJOB_SUB_SCOPE on ACT_RU_DEADLETTER_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_DJOB_SCOPE_DEF on ACT_RU_DEADLETTER_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_EJOB_SCOPE on ACT_RU_EXTERNAL_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_EJOB_SUB_SCOPE on ACT_RU_EXTERNAL_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_EJOB_SCOPE_DEF on ACT_RU_EXTERNAL_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table FLW_RU_BATCH ( + ID_ varchar(64) not null, + REV_ integer, + TYPE_ varchar(64) not null, + SEARCH_KEY_ varchar(255), + SEARCH_KEY2_ varchar(255), + CREATE_TIME_ timestamp not null, + COMPLETE_TIME_ timestamp, + STATUS_ varchar(255), + BATCH_DOC_ID_ varchar(64), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table FLW_RU_BATCH_PART ( + ID_ varchar(64) not null, + REV_ integer, + BATCH_ID_ varchar(64), + TYPE_ varchar(64) not null, + SCOPE_ID_ varchar(64), + SUB_SCOPE_ID_ varchar(64), + SCOPE_TYPE_ varchar(64), + SEARCH_KEY_ varchar(255), + SEARCH_KEY2_ varchar(255), + CREATE_TIME_ timestamp not null, + COMPLETE_TIME_ timestamp, + STATUS_ varchar(255), + RESULT_DOC_ID_ varchar(64), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); + +alter table FLW_RU_BATCH_PART + add constraint FLW_FK_BATCH_PART_PARENT + foreign key (BATCH_ID_) + references FLW_RU_BATCH (ID_); + + +create table ACT_RU_TASK ( + ID_ varchar(64) not null, + REV_ integer, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + TASK_DEF_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PROPAGATED_STAGE_INST_ID_ varchar(255), + STATE_ varchar(255), + NAME_ varchar(255), + PARENT_TASK_ID_ varchar(64), + DESCRIPTION_ varchar(4000), + TASK_DEF_KEY_ varchar(255), + OWNER_ varchar(255), + ASSIGNEE_ varchar(255), + DELEGATION_ varchar(64), + PRIORITY_ integer, + CREATE_TIME_ timestamp, + IN_PROGRESS_TIME_ timestamp, + IN_PROGRESS_STARTED_BY_ varchar(255), + CLAIM_TIME_ timestamp, + CLAIMED_BY_ varchar(255), + SUSPENDED_TIME_ timestamp, + SUSPENDED_BY_ varchar(255), + IN_PROGRESS_DUE_DATE_ timestamp, + DUE_DATE_ timestamp, + CATEGORY_ varchar(255), + SUSPENSION_STATE_ integer, + TENANT_ID_ varchar(255) default '', + FORM_KEY_ varchar(255), + IS_COUNT_ENABLED_ smallint check(IS_COUNT_ENABLED_ in (1,0)), + VAR_COUNT_ integer, + ID_LINK_COUNT_ integer, + SUB_TASK_COUNT_ integer, + primary key (ID_) +); + +create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_); +create index ACT_IDX_TASK_SCOPE on ACT_RU_TASK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TASK_SUB_SCOPE on ACT_RU_TASK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TASK_SCOPE_DEF on ACT_RU_TASK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_HI_TASKINST ( + ID_ varchar(64) not null, + REV_ integer default 1, + PROC_DEF_ID_ varchar(64), + TASK_DEF_ID_ varchar(64), + TASK_DEF_KEY_ varchar(255), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PROPAGATED_STAGE_INST_ID_ varchar(255), + STATE_ varchar(255), + NAME_ varchar(255), + PARENT_TASK_ID_ varchar(64), + DESCRIPTION_ varchar(4000), + OWNER_ varchar(255), + ASSIGNEE_ varchar(255), + START_TIME_ timestamp not null, + IN_PROGRESS_TIME_ timestamp, + IN_PROGRESS_STARTED_BY_ varchar(255), + CLAIM_TIME_ timestamp, + CLAIMED_BY_ varchar(255), + SUSPENDED_TIME_ timestamp, + SUSPENDED_BY_ varchar(255), + END_TIME_ timestamp, + COMPLETED_BY_ varchar(255), + DURATION_ bigint, + DELETE_REASON_ varchar(4000), + PRIORITY_ integer, + IN_PROGRESS_DUE_DATE_ timestamp, + DUE_DATE_ timestamp, + FORM_KEY_ varchar(255), + CATEGORY_ varchar(255), + TENANT_ID_ varchar(255) default '', + LAST_UPDATED_TIME_ timestamp, + primary key (ID_) +); + +create table ACT_HI_TSK_LOG ( + ID_ bigint not null GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), + TYPE_ varchar(64), + TASK_ID_ varchar(64) not null, + TIME_STAMP_ timestamp not null, + USER_ID_ varchar(255), + DATA_ varchar(4000), + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create index ACT_IDX_HI_TASK_SCOPE on ACT_HI_TASKINST(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_TASK_SUB_SCOPE on ACT_HI_TASKINST(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_TASK_SCOPE_DEF on ACT_HI_TASKINST(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); +create index ACT_IDX_ACT_HI_TSK_LOG_TASK on ACT_HI_TSK_LOG(TASK_ID_); + + +create table ACT_RU_VARIABLE ( + ID_ varchar(64) not null, + REV_ integer, + TYPE_ varchar(255) not null, + NAME_ varchar(255) not null, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + TASK_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double precision, + LONG_ bigint, + TEXT_ varchar(4000), + TEXT2_ varchar(4000), + META_INFO_ varchar(4000), + primary key (ID_) +); + +create index ACT_IDX_RU_VAR_SCOPE_ID_TYPE on ACT_RU_VARIABLE(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_RU_VAR_SUB_ID_TYPE on ACT_RU_VARIABLE(SUB_SCOPE_ID_, SCOPE_TYPE_); + +create index ACT_IDX_VARIABLE_BA on ACT_RU_VARIABLE(BYTEARRAY_ID_); +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_BYTEARRAY + foreign key (BYTEARRAY_ID_) + references ACT_GE_BYTEARRAY (ID_); + +create table ACT_HI_VARINST ( + ID_ varchar(64) not null, + REV_ integer default 1, + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + TASK_ID_ varchar(64), + NAME_ varchar(255) not null, + VAR_TYPE_ varchar(100), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double precision, + LONG_ bigint, + TEXT_ varchar(4000), + TEXT2_ varchar(4000), + META_INFO_ varchar(4000), + CREATE_TIME_ timestamp, + LAST_UPDATED_TIME_ timestamp, + primary key (ID_) +); + +create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_); +create index ACT_IDX_HI_VAR_SCOPE_ID_TYPE on ACT_HI_VARINST(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_VAR_SUB_ID_TYPE on ACT_HI_VARINST(SUB_SCOPE_ID_, SCOPE_TYPE_); + + +create table ACT_RU_EVENT_SUBSCR ( + ID_ varchar(64) not null, + REV_ integer, + EVENT_TYPE_ varchar(255) not null, + EVENT_NAME_ varchar(255), + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + ACTIVITY_ID_ varchar(64), + CONFIGURATION_ varchar(255), + CREATED_ timestamp not null, + PROC_DEF_ID_ varchar(64), + SUB_SCOPE_ID_ varchar(64), + SCOPE_ID_ varchar(64), + SCOPE_DEFINITION_ID_ varchar(64), + SCOPE_DEFINITION_KEY_ varchar(255), + SCOPE_TYPE_ varchar(64), + LOCK_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_); +create index ACT_IDX_EVENT_SUBSCR_EXEC_ID on ACT_RU_EVENT_SUBSCR(EXECUTION_ID_); +create index ACT_IDX_EVENT_SUBSCR_SCOPEREF_ on ACT_RU_EVENT_SUBSCR(SCOPE_ID_, SCOPE_TYPE_); diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.h2.create.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.h2.create.common.sql index a6e7a0485b6..7589cd67120 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.h2.create.common.sql +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.h2.create.common.sql @@ -16,7 +16,582 @@ create table ACT_GE_BYTEARRAY ( ); insert into ACT_GE_PROPERTY -values ('common.schema.version', '7.1.0.0', 1); +values ('common.schema.version', '7.1.0.1', 1); insert into ACT_GE_PROPERTY values ('next.dbid', '1', 1); + +create table FLW_RU_BATCH ( + ID_ varchar(64) not null, + REV_ integer, + TYPE_ varchar(64) not null, + SEARCH_KEY_ varchar(255), + SEARCH_KEY2_ varchar(255), + CREATE_TIME_ timestamp not null, + COMPLETE_TIME_ timestamp, + STATUS_ varchar(255), + BATCH_DOC_ID_ varchar(64), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table FLW_RU_BATCH_PART ( + ID_ varchar(64) not null, + REV_ integer, + BATCH_ID_ varchar(64), + TYPE_ varchar(64) not null, + SCOPE_ID_ varchar(64), + SUB_SCOPE_ID_ varchar(64), + SCOPE_TYPE_ varchar(64), + SEARCH_KEY_ varchar(255), + SEARCH_KEY2_ varchar(255), + CREATE_TIME_ timestamp not null, + COMPLETE_TIME_ timestamp, + STATUS_ varchar(255), + RESULT_DOC_ID_ varchar(64), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); + +alter table FLW_RU_BATCH_PART + add constraint FLW_FK_BATCH_PART_PARENT + foreign key (BATCH_ID_) + references FLW_RU_BATCH (ID_); + +create table ACT_RU_ENTITYLINK ( + ID_ varchar(64), + REV_ integer, + CREATE_TIME_ timestamp, + LINK_TYPE_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PARENT_ELEMENT_ID_ varchar(255), + REF_SCOPE_ID_ varchar(255), + REF_SCOPE_TYPE_ varchar(255), + REF_SCOPE_DEFINITION_ID_ varchar(255), + ROOT_SCOPE_ID_ varchar(255), + ROOT_SCOPE_TYPE_ varchar(255), + HIERARCHY_TYPE_ varchar(255), + primary key (ID_) +); + +create index ACT_IDX_ENT_LNK_SCOPE on ACT_RU_ENTITYLINK(SCOPE_ID_, SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_REF_SCOPE on ACT_RU_ENTITYLINK(REF_SCOPE_ID_, REF_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_ROOT_SCOPE on ACT_RU_ENTITYLINK(ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_SCOPE_DEF on ACT_RU_ENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_, LINK_TYPE_); + +create table ACT_HI_ENTITYLINK ( + ID_ varchar(64), + LINK_TYPE_ varchar(255), + CREATE_TIME_ timestamp, + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PARENT_ELEMENT_ID_ varchar(255), + REF_SCOPE_ID_ varchar(255), + REF_SCOPE_TYPE_ varchar(255), + REF_SCOPE_DEFINITION_ID_ varchar(255), + ROOT_SCOPE_ID_ varchar(255), + ROOT_SCOPE_TYPE_ varchar(255), + HIERARCHY_TYPE_ varchar(255), + primary key (ID_) +); + +create index ACT_IDX_HI_ENT_LNK_SCOPE on ACT_HI_ENTITYLINK(SCOPE_ID_, SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_REF_SCOPE on ACT_HI_ENTITYLINK(REF_SCOPE_ID_, REF_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_ROOT_SCOPE on ACT_HI_ENTITYLINK(ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_SCOPE_DEF on ACT_HI_ENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_, LINK_TYPE_); + +create table ACT_RU_EVENT_SUBSCR ( + ID_ varchar(64) not null, + REV_ integer, + EVENT_TYPE_ varchar(255) not null, + EVENT_NAME_ varchar(255), + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + ACTIVITY_ID_ varchar(64), + CONFIGURATION_ varchar(255), + CREATED_ timestamp not null, + PROC_DEF_ID_ varchar(64), + SUB_SCOPE_ID_ varchar(64), + SCOPE_ID_ varchar(64), + SCOPE_DEFINITION_ID_ varchar(64), + SCOPE_DEFINITION_KEY_ varchar(255), + SCOPE_TYPE_ varchar(64), + LOCK_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_); +create index ACT_IDX_EVENT_SUBSCR_SCOPEREF_ on ACT_RU_EVENT_SUBSCR(SCOPE_ID_, SCOPE_TYPE_); + +create table ACT_RU_IDENTITYLINK ( + ID_ varchar(64), + REV_ integer, + GROUP_ID_ varchar(255), + TYPE_ varchar(255), + USER_ID_ varchar(255), + TASK_ID_ varchar(64), + PROC_INST_ID_ varchar(64) null, + PROC_DEF_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + primary key (ID_) +); + +create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_); +create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_); +create index ACT_IDX_IDENT_LNK_SCOPE on ACT_RU_IDENTITYLINK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_IDENT_LNK_SUB_SCOPE on ACT_RU_IDENTITYLINK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_IDENT_LNK_SCOPE_DEF on ACT_RU_IDENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_HI_IDENTITYLINK ( + ID_ varchar(64), + GROUP_ID_ varchar(255), + TYPE_ varchar(255), + USER_ID_ varchar(255), + TASK_ID_ varchar(64), + CREATE_TIME_ timestamp, + PROC_INST_ID_ varchar(64) null, + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + primary key (ID_) +); + +create index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK(USER_ID_); +create index ACT_IDX_HI_IDENT_LNK_SCOPE on ACT_HI_IDENTITYLINK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_IDENT_LNK_SUB_SCOPE on ACT_HI_IDENTITYLINK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_IDENT_LNK_SCOPE_DEF on ACT_HI_IDENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_RU_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + LOCK_EXP_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_TIMER_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + LOCK_EXP_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_SUSPENDED_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_DEADLETTER_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_HISTORY_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + LOCK_EXP_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + ADV_HANDLER_CFG_ID_ varchar(64), + CREATE_TIME_ timestamp, + SCOPE_TYPE_ varchar(255), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_EXTERNAL_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + LOCK_EXP_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create index ACT_IDX_JOB_EXCEPTION_STACK_ID on ACT_RU_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_JOB_CUSTOM_VALUES_ID on ACT_RU_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_JOB_CORRELATION_ID on ACT_RU_JOB(CORRELATION_ID_); + +create index ACT_IDX_TIMER_JOB_EXCEPTION_STACK_ID on ACT_RU_TIMER_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_TIMER_JOB_CUSTOM_VALUES_ID on ACT_RU_TIMER_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_TIMER_JOB_CORRELATION_ID on ACT_RU_TIMER_JOB(CORRELATION_ID_); +create index ACT_IDX_TIMER_JOB_DUEDATE on ACT_RU_TIMER_JOB(DUEDATE_); + +create index ACT_IDX_SUSPENDED_JOB_EXCEPTION_STACK_ID on ACT_RU_SUSPENDED_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_SUSPENDED_JOB_CUSTOM_VALUES_ID on ACT_RU_SUSPENDED_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_SUSPENDED_JOB_CORRELATION_ID on ACT_RU_SUSPENDED_JOB(CORRELATION_ID_); + +create index ACT_IDX_DEADLETTER_JOB_EXCEPTION_STACK_ID on ACT_RU_DEADLETTER_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_DEADLETTER_JOB_CUSTOM_VALUES_ID on ACT_RU_DEADLETTER_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_DEADLETTER_JOB_CORRELATION_ID on ACT_RU_DEADLETTER_JOB(CORRELATION_ID_); + +create index ACT_IDX_EXTERNAL_JOB_EXCEPTION_STACK_ID on ACT_RU_EXTERNAL_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_EXTERNAL_JOB_CUSTOM_VALUES_ID on ACT_RU_EXTERNAL_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_EXTERNAL_JOB_CORRELATION_ID on ACT_RU_EXTERNAL_JOB(CORRELATION_ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_TIMER_JOB + add constraint ACT_FK_TIMER_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_TIMER_JOB + add constraint ACT_FK_TIMER_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_SUSPENDED_JOB + add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_SUSPENDED_JOB + add constraint ACT_FK_SUSPENDED_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_DEADLETTER_JOB + add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_DEADLETTER_JOB + add constraint ACT_FK_DEADLETTER_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EXTERNAL_JOB + add constraint ACT_FK_EXTERNAL_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EXTERNAL_JOB + add constraint ACT_FK_EXTERNAL_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +create index ACT_IDX_JOB_SCOPE on ACT_RU_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_JOB_SUB_SCOPE on ACT_RU_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_JOB_SCOPE_DEF on ACT_RU_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_TJOB_SCOPE on ACT_RU_TIMER_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TJOB_SUB_SCOPE on ACT_RU_TIMER_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TJOB_SCOPE_DEF on ACT_RU_TIMER_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_SJOB_SCOPE on ACT_RU_SUSPENDED_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_SJOB_SUB_SCOPE on ACT_RU_SUSPENDED_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_SJOB_SCOPE_DEF on ACT_RU_SUSPENDED_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_DJOB_SCOPE on ACT_RU_DEADLETTER_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_DJOB_SUB_SCOPE on ACT_RU_DEADLETTER_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_DJOB_SCOPE_DEF on ACT_RU_DEADLETTER_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_EJOB_SCOPE on ACT_RU_EXTERNAL_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_EJOB_SUB_SCOPE on ACT_RU_EXTERNAL_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_EJOB_SCOPE_DEF on ACT_RU_EXTERNAL_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_RU_TASK ( + ID_ varchar(64), + REV_ integer, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + TASK_DEF_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PROPAGATED_STAGE_INST_ID_ varchar(255), + STATE_ varchar(255), + NAME_ varchar(255), + PARENT_TASK_ID_ varchar(64), + DESCRIPTION_ varchar(4000), + TASK_DEF_KEY_ varchar(255), + OWNER_ varchar(255), + ASSIGNEE_ varchar(255), + DELEGATION_ varchar(64), + PRIORITY_ integer, + CREATE_TIME_ timestamp, + IN_PROGRESS_TIME_ timestamp, + IN_PROGRESS_STARTED_BY_ varchar(255), + CLAIM_TIME_ timestamp, + CLAIMED_BY_ varchar(255), + SUSPENDED_TIME_ timestamp, + SUSPENDED_BY_ varchar(255), + IN_PROGRESS_DUE_DATE_ timestamp, + DUE_DATE_ timestamp, + CATEGORY_ varchar(255), + SUSPENSION_STATE_ integer, + TENANT_ID_ varchar(255) default '', + FORM_KEY_ varchar(255), + IS_COUNT_ENABLED_ bit, + VAR_COUNT_ integer, + ID_LINK_COUNT_ integer, + SUB_TASK_COUNT_ integer, + primary key (ID_) +); + +create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_); +create index ACT_IDX_TASK_SCOPE on ACT_RU_TASK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TASK_SUB_SCOPE on ACT_RU_TASK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TASK_SCOPE_DEF on ACT_RU_TASK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_HI_TASKINST ( + ID_ varchar(64) not null, + REV_ integer default 1, + PROC_DEF_ID_ varchar(64), + TASK_DEF_ID_ varchar(64), + TASK_DEF_KEY_ varchar(255), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PROPAGATED_STAGE_INST_ID_ varchar(255), + STATE_ varchar(255), + NAME_ varchar(255), + PARENT_TASK_ID_ varchar(64), + DESCRIPTION_ varchar(4000), + OWNER_ varchar(255), + ASSIGNEE_ varchar(255), + START_TIME_ timestamp not null, + IN_PROGRESS_TIME_ timestamp, + IN_PROGRESS_STARTED_BY_ varchar(255), + CLAIM_TIME_ timestamp, + CLAIMED_BY_ varchar(255), + SUSPENDED_TIME_ timestamp, + SUSPENDED_BY_ varchar(255), + END_TIME_ timestamp, + COMPLETED_BY_ varchar(255), + DURATION_ bigint, + DELETE_REASON_ varchar(4000), + PRIORITY_ integer, + IN_PROGRESS_DUE_DATE_ timestamp, + DUE_DATE_ timestamp, + FORM_KEY_ varchar(255), + CATEGORY_ varchar(255), + TENANT_ID_ varchar(255) default '', + LAST_UPDATED_TIME_ timestamp, + primary key (ID_) +); + +create table ACT_HI_TSK_LOG ( + ID_ identity, + TYPE_ varchar(64), + TASK_ID_ varchar(64) not null, + TIME_STAMP_ timestamp not null, + USER_ID_ varchar(255), + DATA_ varchar(4000), + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create index ACT_IDX_HI_TASK_SCOPE on ACT_HI_TASKINST(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_TASK_SUB_SCOPE on ACT_HI_TASKINST(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_TASK_SCOPE_DEF on ACT_HI_TASKINST(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); +create index ACT_IDX_ACT_HI_TSK_LOG_TASK on ACT_HI_TSK_LOG(TASK_ID_); + +create table ACT_RU_VARIABLE ( + ID_ varchar(64) not null, + REV_ integer, + TYPE_ varchar(255) not null, + NAME_ varchar(255) not null, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + TASK_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(4000), + TEXT2_ varchar(4000), + META_INFO_ varchar(4000), + primary key (ID_) +); + +create index ACT_IDX_RU_VAR_SCOPE_ID_TYPE on ACT_RU_VARIABLE(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_RU_VAR_SUB_ID_TYPE on ACT_RU_VARIABLE(SUB_SCOPE_ID_, SCOPE_TYPE_); + +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_BYTEARRAY + foreign key (BYTEARRAY_ID_) + references ACT_GE_BYTEARRAY; + +create table ACT_HI_VARINST ( + ID_ varchar(64) not null, + REV_ integer default 1, + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + TASK_ID_ varchar(64), + NAME_ varchar(255) not null, + VAR_TYPE_ varchar(100), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(4000), + TEXT2_ varchar(4000), + META_INFO_ varchar(4000), + CREATE_TIME_ timestamp, + LAST_UPDATED_TIME_ timestamp, + primary key (ID_) +); + +create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_); +create index ACT_IDX_HI_VAR_SCOPE_ID_TYPE on ACT_HI_VARINST(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_VAR_SUB_ID_TYPE on ACT_HI_VARINST(SUB_SCOPE_ID_, SCOPE_TYPE_); diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.hsql.create.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.hsql.create.common.sql index a6e7a0485b6..7589cd67120 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.hsql.create.common.sql +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.hsql.create.common.sql @@ -16,7 +16,582 @@ create table ACT_GE_BYTEARRAY ( ); insert into ACT_GE_PROPERTY -values ('common.schema.version', '7.1.0.0', 1); +values ('common.schema.version', '7.1.0.1', 1); insert into ACT_GE_PROPERTY values ('next.dbid', '1', 1); + +create table FLW_RU_BATCH ( + ID_ varchar(64) not null, + REV_ integer, + TYPE_ varchar(64) not null, + SEARCH_KEY_ varchar(255), + SEARCH_KEY2_ varchar(255), + CREATE_TIME_ timestamp not null, + COMPLETE_TIME_ timestamp, + STATUS_ varchar(255), + BATCH_DOC_ID_ varchar(64), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table FLW_RU_BATCH_PART ( + ID_ varchar(64) not null, + REV_ integer, + BATCH_ID_ varchar(64), + TYPE_ varchar(64) not null, + SCOPE_ID_ varchar(64), + SUB_SCOPE_ID_ varchar(64), + SCOPE_TYPE_ varchar(64), + SEARCH_KEY_ varchar(255), + SEARCH_KEY2_ varchar(255), + CREATE_TIME_ timestamp not null, + COMPLETE_TIME_ timestamp, + STATUS_ varchar(255), + RESULT_DOC_ID_ varchar(64), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); + +alter table FLW_RU_BATCH_PART + add constraint FLW_FK_BATCH_PART_PARENT + foreign key (BATCH_ID_) + references FLW_RU_BATCH (ID_); + +create table ACT_RU_ENTITYLINK ( + ID_ varchar(64), + REV_ integer, + CREATE_TIME_ timestamp, + LINK_TYPE_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PARENT_ELEMENT_ID_ varchar(255), + REF_SCOPE_ID_ varchar(255), + REF_SCOPE_TYPE_ varchar(255), + REF_SCOPE_DEFINITION_ID_ varchar(255), + ROOT_SCOPE_ID_ varchar(255), + ROOT_SCOPE_TYPE_ varchar(255), + HIERARCHY_TYPE_ varchar(255), + primary key (ID_) +); + +create index ACT_IDX_ENT_LNK_SCOPE on ACT_RU_ENTITYLINK(SCOPE_ID_, SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_REF_SCOPE on ACT_RU_ENTITYLINK(REF_SCOPE_ID_, REF_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_ROOT_SCOPE on ACT_RU_ENTITYLINK(ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_SCOPE_DEF on ACT_RU_ENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_, LINK_TYPE_); + +create table ACT_HI_ENTITYLINK ( + ID_ varchar(64), + LINK_TYPE_ varchar(255), + CREATE_TIME_ timestamp, + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PARENT_ELEMENT_ID_ varchar(255), + REF_SCOPE_ID_ varchar(255), + REF_SCOPE_TYPE_ varchar(255), + REF_SCOPE_DEFINITION_ID_ varchar(255), + ROOT_SCOPE_ID_ varchar(255), + ROOT_SCOPE_TYPE_ varchar(255), + HIERARCHY_TYPE_ varchar(255), + primary key (ID_) +); + +create index ACT_IDX_HI_ENT_LNK_SCOPE on ACT_HI_ENTITYLINK(SCOPE_ID_, SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_REF_SCOPE on ACT_HI_ENTITYLINK(REF_SCOPE_ID_, REF_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_ROOT_SCOPE on ACT_HI_ENTITYLINK(ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_SCOPE_DEF on ACT_HI_ENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_, LINK_TYPE_); + +create table ACT_RU_EVENT_SUBSCR ( + ID_ varchar(64) not null, + REV_ integer, + EVENT_TYPE_ varchar(255) not null, + EVENT_NAME_ varchar(255), + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + ACTIVITY_ID_ varchar(64), + CONFIGURATION_ varchar(255), + CREATED_ timestamp not null, + PROC_DEF_ID_ varchar(64), + SUB_SCOPE_ID_ varchar(64), + SCOPE_ID_ varchar(64), + SCOPE_DEFINITION_ID_ varchar(64), + SCOPE_DEFINITION_KEY_ varchar(255), + SCOPE_TYPE_ varchar(64), + LOCK_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_); +create index ACT_IDX_EVENT_SUBSCR_SCOPEREF_ on ACT_RU_EVENT_SUBSCR(SCOPE_ID_, SCOPE_TYPE_); + +create table ACT_RU_IDENTITYLINK ( + ID_ varchar(64), + REV_ integer, + GROUP_ID_ varchar(255), + TYPE_ varchar(255), + USER_ID_ varchar(255), + TASK_ID_ varchar(64), + PROC_INST_ID_ varchar(64) null, + PROC_DEF_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + primary key (ID_) +); + +create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_); +create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_); +create index ACT_IDX_IDENT_LNK_SCOPE on ACT_RU_IDENTITYLINK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_IDENT_LNK_SUB_SCOPE on ACT_RU_IDENTITYLINK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_IDENT_LNK_SCOPE_DEF on ACT_RU_IDENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_HI_IDENTITYLINK ( + ID_ varchar(64), + GROUP_ID_ varchar(255), + TYPE_ varchar(255), + USER_ID_ varchar(255), + TASK_ID_ varchar(64), + CREATE_TIME_ timestamp, + PROC_INST_ID_ varchar(64) null, + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + primary key (ID_) +); + +create index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK(USER_ID_); +create index ACT_IDX_HI_IDENT_LNK_SCOPE on ACT_HI_IDENTITYLINK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_IDENT_LNK_SUB_SCOPE on ACT_HI_IDENTITYLINK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_IDENT_LNK_SCOPE_DEF on ACT_HI_IDENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_RU_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + LOCK_EXP_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_TIMER_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + LOCK_EXP_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_SUSPENDED_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_DEADLETTER_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_HISTORY_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + LOCK_EXP_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + ADV_HANDLER_CFG_ID_ varchar(64), + CREATE_TIME_ timestamp, + SCOPE_TYPE_ varchar(255), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_EXTERNAL_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + LOCK_EXP_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create index ACT_IDX_JOB_EXCEPTION_STACK_ID on ACT_RU_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_JOB_CUSTOM_VALUES_ID on ACT_RU_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_JOB_CORRELATION_ID on ACT_RU_JOB(CORRELATION_ID_); + +create index ACT_IDX_TIMER_JOB_EXCEPTION_STACK_ID on ACT_RU_TIMER_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_TIMER_JOB_CUSTOM_VALUES_ID on ACT_RU_TIMER_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_TIMER_JOB_CORRELATION_ID on ACT_RU_TIMER_JOB(CORRELATION_ID_); +create index ACT_IDX_TIMER_JOB_DUEDATE on ACT_RU_TIMER_JOB(DUEDATE_); + +create index ACT_IDX_SUSPENDED_JOB_EXCEPTION_STACK_ID on ACT_RU_SUSPENDED_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_SUSPENDED_JOB_CUSTOM_VALUES_ID on ACT_RU_SUSPENDED_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_SUSPENDED_JOB_CORRELATION_ID on ACT_RU_SUSPENDED_JOB(CORRELATION_ID_); + +create index ACT_IDX_DEADLETTER_JOB_EXCEPTION_STACK_ID on ACT_RU_DEADLETTER_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_DEADLETTER_JOB_CUSTOM_VALUES_ID on ACT_RU_DEADLETTER_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_DEADLETTER_JOB_CORRELATION_ID on ACT_RU_DEADLETTER_JOB(CORRELATION_ID_); + +create index ACT_IDX_EXTERNAL_JOB_EXCEPTION_STACK_ID on ACT_RU_EXTERNAL_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_EXTERNAL_JOB_CUSTOM_VALUES_ID on ACT_RU_EXTERNAL_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_EXTERNAL_JOB_CORRELATION_ID on ACT_RU_EXTERNAL_JOB(CORRELATION_ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_TIMER_JOB + add constraint ACT_FK_TIMER_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_TIMER_JOB + add constraint ACT_FK_TIMER_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_SUSPENDED_JOB + add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_SUSPENDED_JOB + add constraint ACT_FK_SUSPENDED_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_DEADLETTER_JOB + add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_DEADLETTER_JOB + add constraint ACT_FK_DEADLETTER_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EXTERNAL_JOB + add constraint ACT_FK_EXTERNAL_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EXTERNAL_JOB + add constraint ACT_FK_EXTERNAL_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +create index ACT_IDX_JOB_SCOPE on ACT_RU_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_JOB_SUB_SCOPE on ACT_RU_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_JOB_SCOPE_DEF on ACT_RU_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_TJOB_SCOPE on ACT_RU_TIMER_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TJOB_SUB_SCOPE on ACT_RU_TIMER_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TJOB_SCOPE_DEF on ACT_RU_TIMER_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_SJOB_SCOPE on ACT_RU_SUSPENDED_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_SJOB_SUB_SCOPE on ACT_RU_SUSPENDED_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_SJOB_SCOPE_DEF on ACT_RU_SUSPENDED_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_DJOB_SCOPE on ACT_RU_DEADLETTER_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_DJOB_SUB_SCOPE on ACT_RU_DEADLETTER_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_DJOB_SCOPE_DEF on ACT_RU_DEADLETTER_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_EJOB_SCOPE on ACT_RU_EXTERNAL_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_EJOB_SUB_SCOPE on ACT_RU_EXTERNAL_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_EJOB_SCOPE_DEF on ACT_RU_EXTERNAL_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_RU_TASK ( + ID_ varchar(64), + REV_ integer, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + TASK_DEF_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PROPAGATED_STAGE_INST_ID_ varchar(255), + STATE_ varchar(255), + NAME_ varchar(255), + PARENT_TASK_ID_ varchar(64), + DESCRIPTION_ varchar(4000), + TASK_DEF_KEY_ varchar(255), + OWNER_ varchar(255), + ASSIGNEE_ varchar(255), + DELEGATION_ varchar(64), + PRIORITY_ integer, + CREATE_TIME_ timestamp, + IN_PROGRESS_TIME_ timestamp, + IN_PROGRESS_STARTED_BY_ varchar(255), + CLAIM_TIME_ timestamp, + CLAIMED_BY_ varchar(255), + SUSPENDED_TIME_ timestamp, + SUSPENDED_BY_ varchar(255), + IN_PROGRESS_DUE_DATE_ timestamp, + DUE_DATE_ timestamp, + CATEGORY_ varchar(255), + SUSPENSION_STATE_ integer, + TENANT_ID_ varchar(255) default '', + FORM_KEY_ varchar(255), + IS_COUNT_ENABLED_ bit, + VAR_COUNT_ integer, + ID_LINK_COUNT_ integer, + SUB_TASK_COUNT_ integer, + primary key (ID_) +); + +create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_); +create index ACT_IDX_TASK_SCOPE on ACT_RU_TASK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TASK_SUB_SCOPE on ACT_RU_TASK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TASK_SCOPE_DEF on ACT_RU_TASK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_HI_TASKINST ( + ID_ varchar(64) not null, + REV_ integer default 1, + PROC_DEF_ID_ varchar(64), + TASK_DEF_ID_ varchar(64), + TASK_DEF_KEY_ varchar(255), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PROPAGATED_STAGE_INST_ID_ varchar(255), + STATE_ varchar(255), + NAME_ varchar(255), + PARENT_TASK_ID_ varchar(64), + DESCRIPTION_ varchar(4000), + OWNER_ varchar(255), + ASSIGNEE_ varchar(255), + START_TIME_ timestamp not null, + IN_PROGRESS_TIME_ timestamp, + IN_PROGRESS_STARTED_BY_ varchar(255), + CLAIM_TIME_ timestamp, + CLAIMED_BY_ varchar(255), + SUSPENDED_TIME_ timestamp, + SUSPENDED_BY_ varchar(255), + END_TIME_ timestamp, + COMPLETED_BY_ varchar(255), + DURATION_ bigint, + DELETE_REASON_ varchar(4000), + PRIORITY_ integer, + IN_PROGRESS_DUE_DATE_ timestamp, + DUE_DATE_ timestamp, + FORM_KEY_ varchar(255), + CATEGORY_ varchar(255), + TENANT_ID_ varchar(255) default '', + LAST_UPDATED_TIME_ timestamp, + primary key (ID_) +); + +create table ACT_HI_TSK_LOG ( + ID_ identity, + TYPE_ varchar(64), + TASK_ID_ varchar(64) not null, + TIME_STAMP_ timestamp not null, + USER_ID_ varchar(255), + DATA_ varchar(4000), + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create index ACT_IDX_HI_TASK_SCOPE on ACT_HI_TASKINST(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_TASK_SUB_SCOPE on ACT_HI_TASKINST(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_TASK_SCOPE_DEF on ACT_HI_TASKINST(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); +create index ACT_IDX_ACT_HI_TSK_LOG_TASK on ACT_HI_TSK_LOG(TASK_ID_); + +create table ACT_RU_VARIABLE ( + ID_ varchar(64) not null, + REV_ integer, + TYPE_ varchar(255) not null, + NAME_ varchar(255) not null, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + TASK_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(4000), + TEXT2_ varchar(4000), + META_INFO_ varchar(4000), + primary key (ID_) +); + +create index ACT_IDX_RU_VAR_SCOPE_ID_TYPE on ACT_RU_VARIABLE(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_RU_VAR_SUB_ID_TYPE on ACT_RU_VARIABLE(SUB_SCOPE_ID_, SCOPE_TYPE_); + +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_BYTEARRAY + foreign key (BYTEARRAY_ID_) + references ACT_GE_BYTEARRAY; + +create table ACT_HI_VARINST ( + ID_ varchar(64) not null, + REV_ integer default 1, + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + TASK_ID_ varchar(64), + NAME_ varchar(255) not null, + VAR_TYPE_ varchar(100), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(4000), + TEXT2_ varchar(4000), + META_INFO_ varchar(4000), + CREATE_TIME_ timestamp, + LAST_UPDATED_TIME_ timestamp, + primary key (ID_) +); + +create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_); +create index ACT_IDX_HI_VAR_SCOPE_ID_TYPE on ACT_HI_VARINST(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_VAR_SUB_ID_TYPE on ACT_HI_VARINST(SUB_SCOPE_ID_, SCOPE_TYPE_); diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.mssql.create.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.mssql.create.common.sql index ce396e8c910..5bcee4c16a3 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.mssql.create.common.sql +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.mssql.create.common.sql @@ -16,7 +16,588 @@ create table ACT_GE_BYTEARRAY ( ); insert into ACT_GE_PROPERTY -values ('common.schema.version', '7.1.0.0', 1); +values ('common.schema.version', '7.1.0.1', 1); insert into ACT_GE_PROPERTY values ('next.dbid', '1', 1); + + +create table ACT_RU_ENTITYLINK ( + ID_ nvarchar(64), + REV_ int, + CREATE_TIME_ datetime, + LINK_TYPE_ nvarchar(255), + SCOPE_ID_ nvarchar(255), + SUB_SCOPE_ID_ nvarchar(255), + SCOPE_TYPE_ nvarchar(255), + SCOPE_DEFINITION_ID_ nvarchar(255), + PARENT_ELEMENT_ID_ nvarchar(255), + REF_SCOPE_ID_ nvarchar(255), + REF_SCOPE_TYPE_ nvarchar(255), + REF_SCOPE_DEFINITION_ID_ nvarchar(255), + ROOT_SCOPE_ID_ nvarchar(255), + ROOT_SCOPE_TYPE_ nvarchar(255), + HIERARCHY_TYPE_ nvarchar(255), + primary key (ID_) +); + +create index ACT_IDX_ENT_LNK_SCOPE on ACT_RU_ENTITYLINK(SCOPE_ID_, SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_REF_SCOPE on ACT_RU_ENTITYLINK(REF_SCOPE_ID_, REF_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_ROOT_SCOPE on ACT_RU_ENTITYLINK(ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_SCOPE_DEF on ACT_RU_ENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_, LINK_TYPE_); + +create table ACT_HI_ENTITYLINK ( + ID_ nvarchar(64), + LINK_TYPE_ nvarchar(255), + CREATE_TIME_ datetime, + SCOPE_ID_ nvarchar(255), + SUB_SCOPE_ID_ nvarchar(255), + SCOPE_TYPE_ nvarchar(255), + SCOPE_DEFINITION_ID_ nvarchar(255), + PARENT_ELEMENT_ID_ nvarchar(255), + REF_SCOPE_ID_ nvarchar(255), + REF_SCOPE_TYPE_ nvarchar(255), + REF_SCOPE_DEFINITION_ID_ nvarchar(255), + ROOT_SCOPE_ID_ nvarchar(255), + ROOT_SCOPE_TYPE_ nvarchar(255), + HIERARCHY_TYPE_ nvarchar(255), + primary key (ID_) +); + +create index ACT_IDX_HI_ENT_LNK_SCOPE on ACT_HI_ENTITYLINK(SCOPE_ID_, SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_REF_SCOPE on ACT_HI_ENTITYLINK(REF_SCOPE_ID_, REF_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_ROOT_SCOPE on ACT_HI_ENTITYLINK(ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_SCOPE_DEF on ACT_HI_ENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_, LINK_TYPE_); + + +create table ACT_RU_IDENTITYLINK ( + ID_ nvarchar(64), + REV_ int, + GROUP_ID_ nvarchar(255), + TYPE_ nvarchar(255), + USER_ID_ nvarchar(255), + TASK_ID_ nvarchar(64), + PROC_INST_ID_ nvarchar(64), + PROC_DEF_ID_ nvarchar(64), + SCOPE_ID_ nvarchar(255), + SUB_SCOPE_ID_ nvarchar(255), + SCOPE_TYPE_ nvarchar(255), + SCOPE_DEFINITION_ID_ nvarchar(255), + primary key (ID_) +); + +create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_); +create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_); +create index ACT_IDX_IDENT_LNK_SCOPE on ACT_RU_IDENTITYLINK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_IDENT_LNK_SUB_SCOPE on ACT_RU_IDENTITYLINK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_IDENT_LNK_SCOPE_DEF on ACT_RU_IDENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_HI_IDENTITYLINK ( + ID_ nvarchar(64), + GROUP_ID_ nvarchar(255), + TYPE_ nvarchar(255), + USER_ID_ nvarchar(255), + TASK_ID_ nvarchar(64), + CREATE_TIME_ datetime, + PROC_INST_ID_ nvarchar(64), + SCOPE_ID_ nvarchar(255), + SUB_SCOPE_ID_ nvarchar(255), + SCOPE_TYPE_ nvarchar(255), + SCOPE_DEFINITION_ID_ nvarchar(255), + primary key (ID_) +); + +create index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK(USER_ID_); +create index ACT_IDX_HI_IDENT_LNK_SCOPE on ACT_HI_IDENTITYLINK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_IDENT_LNK_SUB_SCOPE on ACT_HI_IDENTITYLINK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_IDENT_LNK_SCOPE_DEF on ACT_HI_IDENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + + +create table ACT_RU_JOB ( + ID_ nvarchar(64) NOT NULL, + REV_ int, + CATEGORY_ varchar(255), + TYPE_ nvarchar(255) NOT NULL, + LOCK_EXP_TIME_ datetime, + LOCK_OWNER_ nvarchar(255), + EXCLUSIVE_ bit, + EXECUTION_ID_ nvarchar(64), + PROCESS_INSTANCE_ID_ nvarchar(64), + PROC_DEF_ID_ nvarchar(64), + ELEMENT_ID_ nvarchar(255), + ELEMENT_NAME_ nvarchar(255), + SCOPE_ID_ nvarchar(255), + SUB_SCOPE_ID_ nvarchar(255), + SCOPE_TYPE_ nvarchar(255), + SCOPE_DEFINITION_ID_ nvarchar(255), + CORRELATION_ID_ nvarchar(255), + RETRIES_ int, + EXCEPTION_STACK_ID_ nvarchar(64), + EXCEPTION_MSG_ nvarchar(4000), + DUEDATE_ datetime NULL, + REPEAT_ nvarchar(255), + HANDLER_TYPE_ nvarchar(255), + HANDLER_CFG_ nvarchar(4000), + CUSTOM_VALUES_ID_ nvarchar(64), + CREATE_TIME_ datetime2 NULL, + TENANT_ID_ nvarchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_TIMER_JOB ( + ID_ nvarchar(64) NOT NULL, + REV_ int, + CATEGORY_ varchar(255), + TYPE_ nvarchar(255) NOT NULL, + LOCK_EXP_TIME_ datetime, + LOCK_OWNER_ nvarchar(255), + EXCLUSIVE_ bit, + EXECUTION_ID_ nvarchar(64), + PROCESS_INSTANCE_ID_ nvarchar(64), + PROC_DEF_ID_ nvarchar(64), + ELEMENT_ID_ nvarchar(255), + ELEMENT_NAME_ nvarchar(255), + SCOPE_ID_ nvarchar(255), + SUB_SCOPE_ID_ nvarchar(255), + SCOPE_TYPE_ nvarchar(255), + SCOPE_DEFINITION_ID_ nvarchar(255), + CORRELATION_ID_ nvarchar(255), + RETRIES_ int, + EXCEPTION_STACK_ID_ nvarchar(64), + EXCEPTION_MSG_ nvarchar(4000), + DUEDATE_ datetime NULL, + REPEAT_ nvarchar(255), + HANDLER_TYPE_ nvarchar(255), + HANDLER_CFG_ nvarchar(4000), + CUSTOM_VALUES_ID_ nvarchar(64), + CREATE_TIME_ datetime2 NULL, + TENANT_ID_ nvarchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_SUSPENDED_JOB ( + ID_ nvarchar(64) NOT NULL, + REV_ int, + CATEGORY_ varchar(255), + TYPE_ nvarchar(255) NOT NULL, + EXCLUSIVE_ bit, + EXECUTION_ID_ nvarchar(64), + PROCESS_INSTANCE_ID_ nvarchar(64), + PROC_DEF_ID_ nvarchar(64), + ELEMENT_ID_ nvarchar(255), + ELEMENT_NAME_ nvarchar(255), + SCOPE_ID_ nvarchar(255), + SUB_SCOPE_ID_ nvarchar(255), + SCOPE_TYPE_ nvarchar(255), + SCOPE_DEFINITION_ID_ nvarchar(255), + CORRELATION_ID_ nvarchar(255), + RETRIES_ int, + EXCEPTION_STACK_ID_ nvarchar(64), + EXCEPTION_MSG_ nvarchar(4000), + DUEDATE_ datetime NULL, + REPEAT_ nvarchar(255), + HANDLER_TYPE_ nvarchar(255), + HANDLER_CFG_ nvarchar(4000), + CUSTOM_VALUES_ID_ nvarchar(64), + CREATE_TIME_ datetime2 NULL, + TENANT_ID_ nvarchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_DEADLETTER_JOB ( + ID_ nvarchar(64) NOT NULL, + REV_ int, + CATEGORY_ varchar(255), + TYPE_ nvarchar(255) NOT NULL, + EXCLUSIVE_ bit, + EXECUTION_ID_ nvarchar(64), + PROCESS_INSTANCE_ID_ nvarchar(64), + PROC_DEF_ID_ nvarchar(64), + ELEMENT_ID_ nvarchar(255), + ELEMENT_NAME_ nvarchar(255), + SCOPE_ID_ nvarchar(255), + SUB_SCOPE_ID_ nvarchar(255), + SCOPE_TYPE_ nvarchar(255), + SCOPE_DEFINITION_ID_ nvarchar(255), + CORRELATION_ID_ nvarchar(255), + EXCEPTION_STACK_ID_ nvarchar(64), + EXCEPTION_MSG_ nvarchar(4000), + DUEDATE_ datetime NULL, + REPEAT_ nvarchar(255), + HANDLER_TYPE_ nvarchar(255), + HANDLER_CFG_ nvarchar(4000), + CUSTOM_VALUES_ID_ nvarchar(64), + CREATE_TIME_ datetime2 NULL, + TENANT_ID_ nvarchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_HISTORY_JOB ( + ID_ nvarchar(64) NOT NULL, + REV_ int, + LOCK_EXP_TIME_ datetime NULL, + LOCK_OWNER_ nvarchar(255), + RETRIES_ int, + EXCEPTION_STACK_ID_ nvarchar(64), + EXCEPTION_MSG_ nvarchar(4000), + HANDLER_TYPE_ nvarchar(255), + HANDLER_CFG_ nvarchar(4000), + CUSTOM_VALUES_ID_ nvarchar(64), + ADV_HANDLER_CFG_ID_ nvarchar(64), + CREATE_TIME_ datetime2 NULL, + SCOPE_TYPE_ nvarchar(255), + TENANT_ID_ nvarchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_EXTERNAL_JOB ( + ID_ nvarchar(64) NOT NULL, + REV_ int, + CATEGORY_ varchar(255), + TYPE_ nvarchar(255) NOT NULL, + LOCK_EXP_TIME_ datetime, + LOCK_OWNER_ nvarchar(255), + EXCLUSIVE_ bit, + EXECUTION_ID_ nvarchar(64), + PROCESS_INSTANCE_ID_ nvarchar(64), + PROC_DEF_ID_ nvarchar(64), + ELEMENT_ID_ nvarchar(255), + ELEMENT_NAME_ nvarchar(255), + SCOPE_ID_ nvarchar(255), + SUB_SCOPE_ID_ nvarchar(255), + SCOPE_TYPE_ nvarchar(255), + SCOPE_DEFINITION_ID_ nvarchar(255), + CORRELATION_ID_ nvarchar(255), + RETRIES_ int, + EXCEPTION_STACK_ID_ nvarchar(64), + EXCEPTION_MSG_ nvarchar(4000), + DUEDATE_ datetime NULL, + REPEAT_ nvarchar(255), + HANDLER_TYPE_ nvarchar(255), + HANDLER_CFG_ nvarchar(4000), + CUSTOM_VALUES_ID_ nvarchar(64), + CREATE_TIME_ datetime2 NULL, + TENANT_ID_ nvarchar(255) default '', + primary key (ID_) +); + +create index ACT_IDX_JOB_EXCEPTION_STACK_ID on ACT_RU_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_JOB_CUSTOM_VALUES_ID on ACT_RU_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_JOB_CORRELATION_ID on ACT_RU_JOB(CORRELATION_ID_); + +create index ACT_IDX_TIMER_JOB_EXCEPTION_STACK_ID on ACT_RU_TIMER_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_TIMER_JOB_CUSTOM_VALUES_ID on ACT_RU_TIMER_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_TIMER_JOB_CORRELATION_ID on ACT_RU_TIMER_JOB(CORRELATION_ID_); +create index ACT_IDX_TIMER_JOB_DUEDATE on ACT_RU_TIMER_JOB(DUEDATE_); + +create index ACT_IDX_SUSPENDED_JOB_EXCEPTION_STACK_ID on ACT_RU_SUSPENDED_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_SUSPENDED_JOB_CUSTOM_VALUES_ID on ACT_RU_SUSPENDED_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_SUSPENDED_JOB_CORRELATION_ID on ACT_RU_SUSPENDED_JOB(CORRELATION_ID_); + +create index ACT_IDX_DEADLETTER_JOB_EXCEPTION_STACK_ID on ACT_RU_DEADLETTER_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_DEADLETTER_JOB_CUSTOM_VALUES_ID on ACT_RU_DEADLETTER_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_DEADLETTER_JOB_CORRELATION_ID on ACT_RU_DEADLETTER_JOB(CORRELATION_ID_); + +create index ACT_IDX_EXTERNAL_JOB_EXCEPTION_STACK_ID on ACT_RU_EXTERNAL_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_EXTERNAL_JOB_CUSTOM_VALUES_ID on ACT_RU_EXTERNAL_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_EXTERNAL_JOB_CORRELATION_ID on ACT_RU_EXTERNAL_JOB(CORRELATION_ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_TIMER_JOB + add constraint ACT_FK_TIMER_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_TIMER_JOB + add constraint ACT_FK_TIMER_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_SUSPENDED_JOB + add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_SUSPENDED_JOB + add constraint ACT_FK_SUSPENDED_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_DEADLETTER_JOB + add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_DEADLETTER_JOB + add constraint ACT_FK_DEADLETTER_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EXTERNAL_JOB + add constraint ACT_FK_EXTERNAL_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EXTERNAL_JOB + add constraint ACT_FK_EXTERNAL_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +create index ACT_IDX_JOB_SCOPE on ACT_RU_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_JOB_SUB_SCOPE on ACT_RU_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_JOB_SCOPE_DEF on ACT_RU_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_TJOB_SCOPE on ACT_RU_TIMER_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TJOB_SUB_SCOPE on ACT_RU_TIMER_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TJOB_SCOPE_DEF on ACT_RU_TIMER_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_SJOB_SCOPE on ACT_RU_SUSPENDED_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_SJOB_SUB_SCOPE on ACT_RU_SUSPENDED_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_SJOB_SCOPE_DEF on ACT_RU_SUSPENDED_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_DJOB_SCOPE on ACT_RU_DEADLETTER_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_DJOB_SUB_SCOPE on ACT_RU_DEADLETTER_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_DJOB_SCOPE_DEF on ACT_RU_DEADLETTER_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_EJOB_SCOPE on ACT_RU_EXTERNAL_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_EJOB_SUB_SCOPE on ACT_RU_EXTERNAL_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_EJOB_SCOPE_DEF on ACT_RU_EXTERNAL_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table FLW_RU_BATCH ( + ID_ nvarchar(64) not null, + REV_ int, + TYPE_ nvarchar(64) not null, + SEARCH_KEY_ nvarchar(255), + SEARCH_KEY2_ nvarchar(255), + CREATE_TIME_ datetime not null, + COMPLETE_TIME_ datetime, + STATUS_ nvarchar(255), + BATCH_DOC_ID_ nvarchar(64), + TENANT_ID_ nvarchar(255) default '', + primary key (ID_) +); + +create table FLW_RU_BATCH_PART ( + ID_ nvarchar(64) not null, + REV_ int, + BATCH_ID_ nvarchar(64), + TYPE_ nvarchar(64) not null, + SCOPE_ID_ nvarchar(64), + SUB_SCOPE_ID_ nvarchar(64), + SCOPE_TYPE_ nvarchar(64), + SEARCH_KEY_ nvarchar(255), + SEARCH_KEY2_ nvarchar(255), + CREATE_TIME_ datetime not null, + COMPLETE_TIME_ datetime, + STATUS_ nvarchar(255), + RESULT_DOC_ID_ nvarchar(64), + TENANT_ID_ nvarchar(255) default '', + primary key (ID_) +); + +create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); + +alter table FLW_RU_BATCH_PART + add constraint FLW_FK_BATCH_PART_PARENT + foreign key (BATCH_ID_) + references FLW_RU_BATCH (ID_); + +create table ACT_RU_TASK ( + ID_ nvarchar(64), + REV_ int, + EXECUTION_ID_ nvarchar(64), + PROC_INST_ID_ nvarchar(64), + PROC_DEF_ID_ nvarchar(64), + TASK_DEF_ID_ nvarchar(64), + SCOPE_ID_ nvarchar(255), + SUB_SCOPE_ID_ nvarchar(255), + SCOPE_TYPE_ nvarchar(255), + SCOPE_DEFINITION_ID_ nvarchar(255), + PROPAGATED_STAGE_INST_ID_ nvarchar(255), + STATE_ nvarchar(255), + NAME_ nvarchar(255), + PARENT_TASK_ID_ nvarchar(64), + DESCRIPTION_ nvarchar(4000), + TASK_DEF_KEY_ nvarchar(255), + OWNER_ nvarchar(255), + ASSIGNEE_ nvarchar(255), + DELEGATION_ nvarchar(64), + PRIORITY_ int, + CREATE_TIME_ datetime, + IN_PROGRESS_TIME_ datetime, + IN_PROGRESS_STARTED_BY_ nvarchar(255), + CLAIM_TIME_ datetime, + CLAIMED_BY_ nvarchar(255), + SUSPENDED_TIME_ datetime, + SUSPENDED_BY_ nvarchar(255), + IN_PROGRESS_DUE_DATE_ datetime, + DUE_DATE_ datetime, + CATEGORY_ nvarchar(255), + SUSPENSION_STATE_ int, + TENANT_ID_ nvarchar(255) default '', + FORM_KEY_ nvarchar(255), + IS_COUNT_ENABLED_ tinyint, + VAR_COUNT_ int, + ID_LINK_COUNT_ int, + SUB_TASK_COUNT_ int, + primary key (ID_) +); + +create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_); +create index ACT_IDX_TASK_SCOPE on ACT_RU_TASK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TASK_SUB_SCOPE on ACT_RU_TASK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TASK_SCOPE_DEF on ACT_RU_TASK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_HI_TASKINST ( + ID_ nvarchar(64) not null, + REV_ int default 1, + PROC_DEF_ID_ nvarchar(64), + TASK_DEF_ID_ nvarchar(64), + TASK_DEF_KEY_ nvarchar(255), + PROC_INST_ID_ nvarchar(64), + EXECUTION_ID_ nvarchar(64), + SCOPE_ID_ nvarchar(255), + SUB_SCOPE_ID_ nvarchar(255), + SCOPE_TYPE_ nvarchar(255), + SCOPE_DEFINITION_ID_ nvarchar(255), + PROPAGATED_STAGE_INST_ID_ nvarchar(255), + STATE_ nvarchar(255), + NAME_ nvarchar(255), + PARENT_TASK_ID_ nvarchar(64), + DESCRIPTION_ nvarchar(4000), + OWNER_ nvarchar(255), + ASSIGNEE_ nvarchar(255), + START_TIME_ datetime not null, + IN_PROGRESS_TIME_ datetime, + IN_PROGRESS_STARTED_BY_ nvarchar(255), + CLAIM_TIME_ datetime, + CLAIMED_BY_ nvarchar(255), + SUSPENDED_TIME_ datetime, + SUSPENDED_BY_ nvarchar(255), + END_TIME_ datetime, + COMPLETED_BY_ nvarchar(255), + DURATION_ numeric(19,0), + DELETE_REASON_ nvarchar(4000), + PRIORITY_ int, + IN_PROGRESS_DUE_DATE_ datetime, + DUE_DATE_ datetime, + FORM_KEY_ nvarchar(255), + CATEGORY_ nvarchar(255), + TENANT_ID_ nvarchar(255) default '', + LAST_UPDATED_TIME_ datetime2, + primary key (ID_) +); + +create table ACT_HI_TSK_LOG ( + ID_ numeric(19,0) IDENTITY (1,1), + TYPE_ nvarchar(64), + TASK_ID_ nvarchar(64) not null, + TIME_STAMP_ datetime not null, + USER_ID_ nvarchar(255), + DATA_ nvarchar(4000), + EXECUTION_ID_ nvarchar(64), + PROC_INST_ID_ nvarchar(64), + PROC_DEF_ID_ nvarchar(64), + SCOPE_ID_ nvarchar(255), + SCOPE_DEFINITION_ID_ nvarchar(255), + SUB_SCOPE_ID_ nvarchar(255), + SCOPE_TYPE_ nvarchar(255), + TENANT_ID_ nvarchar(255) default '', + primary key (ID_) +); + +create index ACT_IDX_HI_TASK_SCOPE on ACT_HI_TASKINST(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_TASK_SUB_SCOPE on ACT_HI_TASKINST(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_TASK_SCOPE_DEF on ACT_HI_TASKINST(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); +create index ACT_IDX_ACT_HI_TSK_LOG_TASK on ACT_HI_TSK_LOG(TASK_ID_); + +create table ACT_RU_VARIABLE ( + ID_ nvarchar(64) not null, + REV_ int, + TYPE_ nvarchar(255) not null, + NAME_ nvarchar(255) not null, + EXECUTION_ID_ nvarchar(64), + PROC_INST_ID_ nvarchar(64), + TASK_ID_ nvarchar(64), + SCOPE_ID_ nvarchar(255), + SUB_SCOPE_ID_ nvarchar(255), + SCOPE_TYPE_ nvarchar(255), + BYTEARRAY_ID_ nvarchar(64), + DOUBLE_ double precision, + LONG_ numeric(19,0), + TEXT_ nvarchar(4000), + TEXT2_ nvarchar(4000), + META_INFO_ nvarchar(4000), + primary key (ID_) +); + +create index ACT_IDX_RU_VAR_SCOPE_ID_TYPE on ACT_RU_VARIABLE(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_RU_VAR_SUB_ID_TYPE on ACT_RU_VARIABLE(SUB_SCOPE_ID_, SCOPE_TYPE_); + +create index ACT_IDX_VARIABLE_BA on ACT_RU_VARIABLE(BYTEARRAY_ID_); +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_BYTEARRAY + foreign key (BYTEARRAY_ID_) + references ACT_GE_BYTEARRAY (ID_); + +create table ACT_HI_VARINST ( + ID_ nvarchar(64) not null, + REV_ int default 1, + PROC_INST_ID_ nvarchar(64), + EXECUTION_ID_ nvarchar(64), + TASK_ID_ nvarchar(64), + NAME_ nvarchar(255) not null, + VAR_TYPE_ nvarchar(100), + SCOPE_ID_ nvarchar(255), + SUB_SCOPE_ID_ nvarchar(255), + SCOPE_TYPE_ nvarchar(255), + BYTEARRAY_ID_ nvarchar(64), + DOUBLE_ double precision, + LONG_ numeric(19,0), + TEXT_ nvarchar(4000), + TEXT2_ nvarchar(4000), + META_INFO_ nvarchar(4000), + CREATE_TIME_ datetime, + LAST_UPDATED_TIME_ datetime2, + primary key (ID_) +); + +create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_); +create index ACT_IDX_HI_VAR_SCOPE_ID_TYPE on ACT_HI_VARINST(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_VAR_SUB_ID_TYPE on ACT_HI_VARINST(SUB_SCOPE_ID_, SCOPE_TYPE_); + + +create table ACT_RU_EVENT_SUBSCR ( + ID_ nvarchar(64) not null, + REV_ int, + EVENT_TYPE_ nvarchar(255) not null, + EVENT_NAME_ nvarchar(255), + EXECUTION_ID_ nvarchar(64), + PROC_INST_ID_ nvarchar(64), + ACTIVITY_ID_ nvarchar(64), + CONFIGURATION_ nvarchar(255), + CREATED_ datetime not null, + PROC_DEF_ID_ nvarchar(64), + SUB_SCOPE_ID_ nvarchar(64), + SCOPE_ID_ nvarchar(64), + SCOPE_DEFINITION_ID_ nvarchar(64), + SCOPE_DEFINITION_KEY_ nvarchar(255), + SCOPE_TYPE_ nvarchar(64), + LOCK_TIME_ datetime, + LOCK_OWNER_ nvarchar(255), + TENANT_ID_ nvarchar(255) default '', + primary key (ID_) +); + +create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_); +create index ACT_IDX_EVENT_SUBSCR_EXEC_ID on ACT_RU_EVENT_SUBSCR(EXECUTION_ID_); +create index ACT_IDX_EVENT_SUBSCR_SCOPEREF_ on ACT_RU_EVENT_SUBSCR(SCOPE_ID_, SCOPE_TYPE_); diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.mysql.create.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.mysql.create.common.sql index bbdec94096f..466b99a328a 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.mysql.create.common.sql +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.mysql.create.common.sql @@ -16,7 +16,587 @@ create table ACT_GE_BYTEARRAY ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; insert into ACT_GE_PROPERTY -values ('common.schema.version', '7.1.0.0', 1); +values ('common.schema.version', '7.1.0.1', 1); insert into ACT_GE_PROPERTY values ('next.dbid', '1', 1); + + +create table ACT_RU_ENTITYLINK ( + ID_ varchar(64), + REV_ integer, + CREATE_TIME_ datetime(3), + LINK_TYPE_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PARENT_ELEMENT_ID_ varchar(255), + REF_SCOPE_ID_ varchar(255), + REF_SCOPE_TYPE_ varchar(255), + REF_SCOPE_DEFINITION_ID_ varchar(255), + ROOT_SCOPE_ID_ varchar(255), + ROOT_SCOPE_TYPE_ varchar(255), + HIERARCHY_TYPE_ varchar(255), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_ENT_LNK_SCOPE on ACT_RU_ENTITYLINK(SCOPE_ID_, SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_REF_SCOPE on ACT_RU_ENTITYLINK(REF_SCOPE_ID_, REF_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_ROOT_SCOPE on ACT_RU_ENTITYLINK(ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_SCOPE_DEF on ACT_RU_ENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_, LINK_TYPE_); + +create table ACT_HI_ENTITYLINK ( + ID_ varchar(64), + LINK_TYPE_ varchar(255), + CREATE_TIME_ datetime(3), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PARENT_ELEMENT_ID_ varchar(255), + REF_SCOPE_ID_ varchar(255), + REF_SCOPE_TYPE_ varchar(255), + REF_SCOPE_DEFINITION_ID_ varchar(255), + ROOT_SCOPE_ID_ varchar(255), + ROOT_SCOPE_TYPE_ varchar(255), + HIERARCHY_TYPE_ varchar(255), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_HI_ENT_LNK_SCOPE on ACT_HI_ENTITYLINK(SCOPE_ID_, SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_REF_SCOPE on ACT_HI_ENTITYLINK(REF_SCOPE_ID_, REF_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_ROOT_SCOPE on ACT_HI_ENTITYLINK(ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_SCOPE_DEF on ACT_HI_ENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_, LINK_TYPE_); + + +create table ACT_RU_IDENTITYLINK ( + ID_ varchar(64), + REV_ integer, + GROUP_ID_ varchar(255), + TYPE_ varchar(255), + USER_ID_ varchar(255), + TASK_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_); +create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_); +create index ACT_IDX_IDENT_LNK_SCOPE on ACT_RU_IDENTITYLINK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_IDENT_LNK_SUB_SCOPE on ACT_RU_IDENTITYLINK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_IDENT_LNK_SCOPE_DEF on ACT_RU_IDENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_HI_IDENTITYLINK ( + ID_ varchar(64), + GROUP_ID_ varchar(255), + TYPE_ varchar(255), + USER_ID_ varchar(255), + TASK_ID_ varchar(64), + CREATE_TIME_ datetime(3), + PROC_INST_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK(USER_ID_); +create index ACT_IDX_HI_IDENT_LNK_SCOPE on ACT_HI_IDENTITYLINK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_IDENT_LNK_SUB_SCOPE on ACT_HI_IDENTITYLINK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_IDENT_LNK_SCOPE_DEF on ACT_HI_IDENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + + +create table ACT_RU_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + LOCK_EXP_TIME_ timestamp(3) NULL, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp(3) NULL, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp(3) NULL, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_TIMER_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + LOCK_EXP_TIME_ timestamp(3) NULL, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp(3) NULL, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp(3) NULL, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_SUSPENDED_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp(3) NULL, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp(3) NULL, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_DEADLETTER_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp(3) NULL, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp(3) NULL, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_HISTORY_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + LOCK_EXP_TIME_ timestamp(3) NULL, + LOCK_OWNER_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + ADV_HANDLER_CFG_ID_ varchar(64), + CREATE_TIME_ timestamp(3) NULL, + SCOPE_TYPE_ varchar(255), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_EXTERNAL_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + LOCK_EXP_TIME_ timestamp(3) NULL, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp(3) NULL, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp(3) NULL, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_JOB_EXCEPTION_STACK_ID on ACT_RU_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_JOB_CUSTOM_VALUES_ID on ACT_RU_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_JOB_CORRELATION_ID on ACT_RU_JOB(CORRELATION_ID_); + +create index ACT_IDX_TIMER_JOB_EXCEPTION_STACK_ID on ACT_RU_TIMER_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_TIMER_JOB_CUSTOM_VALUES_ID on ACT_RU_TIMER_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_TIMER_JOB_CORRELATION_ID on ACT_RU_TIMER_JOB(CORRELATION_ID_); +create index ACT_IDX_TIMER_JOB_DUEDATE on ACT_RU_TIMER_JOB(DUEDATE_); + +create index ACT_IDX_SUSPENDED_JOB_EXCEPTION_STACK_ID on ACT_RU_SUSPENDED_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_SUSPENDED_JOB_CUSTOM_VALUES_ID on ACT_RU_SUSPENDED_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_SUSPENDED_JOB_CORRELATION_ID on ACT_RU_SUSPENDED_JOB(CORRELATION_ID_); + +create index ACT_IDX_DEADLETTER_JOB_EXCEPTION_STACK_ID on ACT_RU_DEADLETTER_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_DEADLETTER_JOB_CUSTOM_VALUES_ID on ACT_RU_DEADLETTER_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_DEADLETTER_JOB_CORRELATION_ID on ACT_RU_DEADLETTER_JOB(CORRELATION_ID_); + +create index ACT_IDX_EXTERNAL_JOB_EXCEPTION_STACK_ID on ACT_RU_EXTERNAL_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_EXTERNAL_JOB_CUSTOM_VALUES_ID on ACT_RU_EXTERNAL_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_EXTERNAL_JOB_CORRELATION_ID on ACT_RU_EXTERNAL_JOB(CORRELATION_ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_TIMER_JOB + add constraint ACT_FK_TIMER_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_TIMER_JOB + add constraint ACT_FK_TIMER_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_SUSPENDED_JOB + add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_SUSPENDED_JOB + add constraint ACT_FK_SUSPENDED_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_DEADLETTER_JOB + add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_DEADLETTER_JOB + add constraint ACT_FK_DEADLETTER_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EXTERNAL_JOB + add constraint ACT_FK_EXTERNAL_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EXTERNAL_JOB + add constraint ACT_FK_EXTERNAL_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +create index ACT_IDX_JOB_SCOPE on ACT_RU_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_JOB_SUB_SCOPE on ACT_RU_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_JOB_SCOPE_DEF on ACT_RU_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_TJOB_SCOPE on ACT_RU_TIMER_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TJOB_SUB_SCOPE on ACT_RU_TIMER_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TJOB_SCOPE_DEF on ACT_RU_TIMER_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_SJOB_SCOPE on ACT_RU_SUSPENDED_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_SJOB_SUB_SCOPE on ACT_RU_SUSPENDED_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_SJOB_SCOPE_DEF on ACT_RU_SUSPENDED_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_DJOB_SCOPE on ACT_RU_DEADLETTER_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_DJOB_SUB_SCOPE on ACT_RU_DEADLETTER_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_DJOB_SCOPE_DEF on ACT_RU_DEADLETTER_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_EJOB_SCOPE on ACT_RU_EXTERNAL_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_EJOB_SUB_SCOPE on ACT_RU_EXTERNAL_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_EJOB_SCOPE_DEF on ACT_RU_EXTERNAL_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table FLW_RU_BATCH ( + ID_ varchar(64) not null, + REV_ integer, + TYPE_ varchar(64) not null, + SEARCH_KEY_ varchar(255), + SEARCH_KEY2_ varchar(255), + CREATE_TIME_ datetime(3) not null, + COMPLETE_TIME_ datetime(3), + STATUS_ varchar(255), + BATCH_DOC_ID_ varchar(64), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table FLW_RU_BATCH_PART ( + ID_ varchar(64) not null, + REV_ integer, + BATCH_ID_ varchar(64), + TYPE_ varchar(64) not null, + SCOPE_ID_ varchar(64), + SUB_SCOPE_ID_ varchar(64), + SCOPE_TYPE_ varchar(64), + SEARCH_KEY_ varchar(255), + SEARCH_KEY2_ varchar(255), + CREATE_TIME_ datetime(3) not null, + COMPLETE_TIME_ datetime(3), + STATUS_ varchar(255), + RESULT_DOC_ID_ varchar(64), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); + +alter table FLW_RU_BATCH_PART + add constraint FLW_FK_BATCH_PART_PARENT + foreign key (BATCH_ID_) + references FLW_RU_BATCH (ID_); + +create table ACT_RU_TASK ( + ID_ varchar(64), + REV_ integer, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + TASK_DEF_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PROPAGATED_STAGE_INST_ID_ varchar(255), + STATE_ varchar(255), + NAME_ varchar(255), + PARENT_TASK_ID_ varchar(64), + DESCRIPTION_ varchar(4000), + TASK_DEF_KEY_ varchar(255), + OWNER_ varchar(255), + ASSIGNEE_ varchar(255), + DELEGATION_ varchar(64), + PRIORITY_ integer, + CREATE_TIME_ timestamp(3) NULL, + IN_PROGRESS_TIME_ datetime(3), + IN_PROGRESS_STARTED_BY_ varchar(255), + CLAIM_TIME_ datetime(3), + CLAIMED_BY_ varchar(255), + SUSPENDED_TIME_ datetime(3), + SUSPENDED_BY_ varchar(255), + IN_PROGRESS_DUE_DATE_ datetime(3), + DUE_DATE_ datetime(3), + CATEGORY_ varchar(255), + SUSPENSION_STATE_ integer, + TENANT_ID_ varchar(255) default '', + FORM_KEY_ varchar(255), + IS_COUNT_ENABLED_ TINYINT, + VAR_COUNT_ integer, + ID_LINK_COUNT_ integer, + SUB_TASK_COUNT_ integer, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_); +create index ACT_IDX_TASK_SCOPE on ACT_RU_TASK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TASK_SUB_SCOPE on ACT_RU_TASK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TASK_SCOPE_DEF on ACT_RU_TASK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_HI_TASKINST ( + ID_ varchar(64) not null, + REV_ integer default 1, + PROC_DEF_ID_ varchar(64), + TASK_DEF_ID_ varchar(64), + TASK_DEF_KEY_ varchar(255), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PROPAGATED_STAGE_INST_ID_ varchar(255), + STATE_ varchar(255), + NAME_ varchar(255), + PARENT_TASK_ID_ varchar(64), + DESCRIPTION_ varchar(4000), + OWNER_ varchar(255), + ASSIGNEE_ varchar(255), + START_TIME_ datetime(3) not null, + IN_PROGRESS_TIME_ datetime(3), + IN_PROGRESS_STARTED_BY_ varchar(255), + CLAIM_TIME_ datetime(3), + CLAIMED_BY_ varchar(255), + SUSPENDED_TIME_ datetime(3), + SUSPENDED_BY_ varchar(255), + END_TIME_ datetime(3), + COMPLETED_BY_ varchar(255), + DURATION_ bigint, + DELETE_REASON_ varchar(4000), + PRIORITY_ integer, + IN_PROGRESS_DUE_DATE_ datetime(3), + DUE_DATE_ datetime(3), + FORM_KEY_ varchar(255), + CATEGORY_ varchar(255), + TENANT_ID_ varchar(255) default '', + LAST_UPDATED_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_TSK_LOG ( + ID_ bigint auto_increment, + TYPE_ varchar(64), + TASK_ID_ varchar(64) not null, + TIME_STAMP_ timestamp(3) not null, + USER_ID_ varchar(255), + DATA_ varchar(4000), + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_HI_TASK_SCOPE on ACT_HI_TASKINST(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_TASK_SUB_SCOPE on ACT_HI_TASKINST(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_TASK_SCOPE_DEF on ACT_HI_TASKINST(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); +create index ACT_IDX_ACT_HI_TSK_LOG_TASK on ACT_HI_TSK_LOG(TASK_ID_); + + +create table ACT_RU_VARIABLE ( + ID_ varchar(64) not null, + REV_ integer, + TYPE_ varchar(255) not null, + NAME_ varchar(255) not null, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + TASK_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(4000), + TEXT2_ varchar(4000), + META_INFO_ varchar(4000), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_RU_VAR_SCOPE_ID_TYPE on ACT_RU_VARIABLE(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_RU_VAR_SUB_ID_TYPE on ACT_RU_VARIABLE(SUB_SCOPE_ID_, SCOPE_TYPE_); + +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_BYTEARRAY + foreign key (BYTEARRAY_ID_) + references ACT_GE_BYTEARRAY (ID_); + +create table ACT_HI_VARINST ( + ID_ varchar(64) not null, + REV_ integer default 1, + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + TASK_ID_ varchar(64), + NAME_ varchar(255) not null, + VAR_TYPE_ varchar(100), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(4000), + TEXT2_ varchar(4000), + META_INFO_ varchar(4000), + CREATE_TIME_ datetime(3), + LAST_UPDATED_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_); +create index ACT_IDX_HI_VAR_SCOPE_ID_TYPE on ACT_HI_VARINST(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_VAR_SUB_ID_TYPE on ACT_HI_VARINST(SUB_SCOPE_ID_, SCOPE_TYPE_); + + +create table ACT_RU_EVENT_SUBSCR ( + ID_ varchar(64) not null, + REV_ integer, + EVENT_TYPE_ varchar(255) not null, + EVENT_NAME_ varchar(255), + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + ACTIVITY_ID_ varchar(64), + CONFIGURATION_ varchar(255), + CREATED_ timestamp(3) not null DEFAULT CURRENT_TIMESTAMP(3), + PROC_DEF_ID_ varchar(64), + SUB_SCOPE_ID_ varchar(64), + SCOPE_ID_ varchar(64), + SCOPE_DEFINITION_ID_ varchar(64), + SCOPE_DEFINITION_KEY_ varchar(255), + SCOPE_TYPE_ varchar(64), + LOCK_TIME_ timestamp(3) NULL, + LOCK_OWNER_ varchar(255), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_); +create index ACT_IDX_EVENT_SUBSCR_SCOPEREF_ on ACT_RU_EVENT_SUBSCR(SCOPE_ID_, SCOPE_TYPE_); diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.mysql55.create.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.mysql55.create.common.sql deleted file mode 100644 index bbdec94096f..00000000000 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.mysql55.create.common.sql +++ /dev/null @@ -1,22 +0,0 @@ -create table ACT_GE_PROPERTY ( - NAME_ varchar(64), - VALUE_ varchar(300), - REV_ integer, - primary key (NAME_) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; - -create table ACT_GE_BYTEARRAY ( - ID_ varchar(64), - REV_ integer, - NAME_ varchar(255), - DEPLOYMENT_ID_ varchar(64), - BYTES_ LONGBLOB, - GENERATED_ TINYINT, - primary key (ID_) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; - -insert into ACT_GE_PROPERTY -values ('common.schema.version', '7.1.0.0', 1); - -insert into ACT_GE_PROPERTY -values ('next.dbid', '1', 1); diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.oracle.create.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.oracle.create.common.sql index c4c3def0484..db635a59f65 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.oracle.create.common.sql +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.oracle.create.common.sql @@ -16,7 +16,590 @@ create table ACT_GE_BYTEARRAY ( ); insert into ACT_GE_PROPERTY -values ('common.schema.version', '7.1.0.0', 1); +values ('common.schema.version', '7.1.0.1', 1); insert into ACT_GE_PROPERTY values ('next.dbid', '1', 1); + + +create table ACT_RU_ENTITYLINK ( + ID_ NVARCHAR2(64), + REV_ INTEGER, + CREATE_TIME_ TIMESTAMP(6), + LINK_TYPE_ NVARCHAR2(255), + SCOPE_ID_ NVARCHAR2(255), + SUB_SCOPE_ID_ NVARCHAR2(255), + SCOPE_TYPE_ NVARCHAR2(255), + SCOPE_DEFINITION_ID_ NVARCHAR2(255), + PARENT_ELEMENT_ID_ NVARCHAR2(255), + REF_SCOPE_ID_ NVARCHAR2(255), + REF_SCOPE_TYPE_ NVARCHAR2(255), + REF_SCOPE_DEFINITION_ID_ NVARCHAR2(255), + ROOT_SCOPE_ID_ NVARCHAR2(255), + ROOT_SCOPE_TYPE_ NVARCHAR2(255), + HIERARCHY_TYPE_ NVARCHAR2(255), + primary key (ID_) +); + +create index ACT_IDX_ENT_LNK_SCOPE on ACT_RU_ENTITYLINK(SCOPE_ID_, SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_REF_SCOPE on ACT_RU_ENTITYLINK(REF_SCOPE_ID_, REF_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_ROOT_SCOPE on ACT_RU_ENTITYLINK(ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_SCOPE_DEF on ACT_RU_ENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_, LINK_TYPE_); + +create table ACT_HI_ENTITYLINK ( + ID_ NVARCHAR2(64), + LINK_TYPE_ NVARCHAR2(255), + CREATE_TIME_ TIMESTAMP(6), + SCOPE_ID_ NVARCHAR2(255), + SUB_SCOPE_ID_ NVARCHAR2(255), + SCOPE_TYPE_ NVARCHAR2(255), + SCOPE_DEFINITION_ID_ NVARCHAR2(255), + PARENT_ELEMENT_ID_ NVARCHAR2(255), + REF_SCOPE_ID_ NVARCHAR2(255), + REF_SCOPE_TYPE_ NVARCHAR2(255), + REF_SCOPE_DEFINITION_ID_ NVARCHAR2(255), + ROOT_SCOPE_ID_ NVARCHAR2(255), + ROOT_SCOPE_TYPE_ NVARCHAR2(255), + HIERARCHY_TYPE_ NVARCHAR2(255), + primary key (ID_) +); + +create index ACT_IDX_HI_ENT_LNK_SCOPE on ACT_HI_ENTITYLINK(SCOPE_ID_, SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_REF_SCOPE on ACT_HI_ENTITYLINK(REF_SCOPE_ID_, REF_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_ROOT_SCOPE on ACT_HI_ENTITYLINK(ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_SCOPE_DEF on ACT_HI_ENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_, LINK_TYPE_); + + +create table ACT_RU_IDENTITYLINK ( + ID_ NVARCHAR2(64), + REV_ INTEGER, + GROUP_ID_ NVARCHAR2(255), + TYPE_ NVARCHAR2(255), + USER_ID_ NVARCHAR2(255), + TASK_ID_ NVARCHAR2(64), + PROC_INST_ID_ NVARCHAR2(64), + PROC_DEF_ID_ NVARCHAR2(64), + SCOPE_ID_ NVARCHAR2(255), + SUB_SCOPE_ID_ NVARCHAR2(255), + SCOPE_TYPE_ NVARCHAR2(255), + SCOPE_DEFINITION_ID_ NVARCHAR2(255), + primary key (ID_) +); + +create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_); +create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_); +create index ACT_IDX_IDENT_LNK_SCOPE on ACT_RU_IDENTITYLINK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_IDENT_LNK_SUB_SCOPE on ACT_RU_IDENTITYLINK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_IDENT_LNK_SCOPE_DEF on ACT_RU_IDENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_HI_IDENTITYLINK ( + ID_ NVARCHAR2(64), + GROUP_ID_ NVARCHAR2(255), + TYPE_ NVARCHAR2(255), + USER_ID_ NVARCHAR2(255), + TASK_ID_ NVARCHAR2(64), + CREATE_TIME_ TIMESTAMP(6), + PROC_INST_ID_ NVARCHAR2(64), + SCOPE_ID_ NVARCHAR2(255), + SUB_SCOPE_ID_ NVARCHAR2(255), + SCOPE_TYPE_ NVARCHAR2(255), + SCOPE_DEFINITION_ID_ NVARCHAR2(255), + primary key (ID_) +); + +create index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK(USER_ID_); +create index ACT_IDX_HI_IDENT_LNK_SCOPE on ACT_HI_IDENTITYLINK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_IDENT_LNK_SUB_SCOPE on ACT_HI_IDENTITYLINK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_IDENT_LNK_SCOPE_DEF on ACT_HI_IDENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + + +create table ACT_RU_JOB ( + ID_ NVARCHAR2(64) NOT NULL, + REV_ INTEGER, + CATEGORY_ NVARCHAR2(255), + TYPE_ NVARCHAR2(255) NOT NULL, + LOCK_EXP_TIME_ TIMESTAMP(6), + LOCK_OWNER_ NVARCHAR2(255), + EXCLUSIVE_ NUMBER(1,0) CHECK (EXCLUSIVE_ IN (1,0)), + EXECUTION_ID_ NVARCHAR2(64), + PROCESS_INSTANCE_ID_ NVARCHAR2(64), + PROC_DEF_ID_ NVARCHAR2(64), + ELEMENT_ID_ NVARCHAR2(255), + ELEMENT_NAME_ NVARCHAR2(255), + SCOPE_ID_ NVARCHAR2(255), + SUB_SCOPE_ID_ NVARCHAR2(255), + SCOPE_TYPE_ NVARCHAR2(255), + SCOPE_DEFINITION_ID_ NVARCHAR2(255), + CORRELATION_ID_ NVARCHAR2(255), + RETRIES_ INTEGER, + EXCEPTION_STACK_ID_ NVARCHAR2(64), + EXCEPTION_MSG_ NVARCHAR2(2000), + DUEDATE_ TIMESTAMP(6), + REPEAT_ NVARCHAR2(255), + HANDLER_TYPE_ NVARCHAR2(255), + HANDLER_CFG_ NVARCHAR2(2000), + CUSTOM_VALUES_ID_ NVARCHAR2(64), + CREATE_TIME_ TIMESTAMP(6), + TENANT_ID_ NVARCHAR2(255) DEFAULT '', + primary key (ID_) +); + +create table ACT_RU_TIMER_JOB ( + ID_ NVARCHAR2(64) NOT NULL, + REV_ INTEGER, + CATEGORY_ NVARCHAR2(255), + TYPE_ NVARCHAR2(255) NOT NULL, + LOCK_EXP_TIME_ TIMESTAMP(6), + LOCK_OWNER_ NVARCHAR2(255), + EXCLUSIVE_ NUMBER(1,0) CHECK (EXCLUSIVE_ IN (1,0)), + EXECUTION_ID_ NVARCHAR2(64), + PROCESS_INSTANCE_ID_ NVARCHAR2(64), + PROC_DEF_ID_ NVARCHAR2(64), + ELEMENT_ID_ NVARCHAR2(255), + ELEMENT_NAME_ NVARCHAR2(255), + SCOPE_ID_ NVARCHAR2(255), + SUB_SCOPE_ID_ NVARCHAR2(255), + SCOPE_TYPE_ NVARCHAR2(255), + SCOPE_DEFINITION_ID_ NVARCHAR2(255), + CORRELATION_ID_ NVARCHAR2(255), + RETRIES_ INTEGER, + EXCEPTION_STACK_ID_ NVARCHAR2(64), + EXCEPTION_MSG_ NVARCHAR2(2000), + DUEDATE_ TIMESTAMP(6), + REPEAT_ NVARCHAR2(255), + HANDLER_TYPE_ NVARCHAR2(255), + HANDLER_CFG_ NVARCHAR2(2000), + CUSTOM_VALUES_ID_ NVARCHAR2(64), + CREATE_TIME_ TIMESTAMP(6), + TENANT_ID_ NVARCHAR2(255) DEFAULT '', + primary key (ID_) +); + +create table ACT_RU_SUSPENDED_JOB ( + ID_ NVARCHAR2(64) NOT NULL, + REV_ INTEGER, + CATEGORY_ NVARCHAR2(255), + TYPE_ NVARCHAR2(255) NOT NULL, + EXCLUSIVE_ NUMBER(1,0) CHECK (EXCLUSIVE_ IN (1,0)), + EXECUTION_ID_ NVARCHAR2(64), + PROCESS_INSTANCE_ID_ NVARCHAR2(64), + PROC_DEF_ID_ NVARCHAR2(64), + ELEMENT_ID_ NVARCHAR2(255), + ELEMENT_NAME_ NVARCHAR2(255), + SCOPE_ID_ NVARCHAR2(255), + SUB_SCOPE_ID_ NVARCHAR2(255), + SCOPE_TYPE_ NVARCHAR2(255), + SCOPE_DEFINITION_ID_ NVARCHAR2(255), + CORRELATION_ID_ NVARCHAR2(255), + RETRIES_ INTEGER, + EXCEPTION_STACK_ID_ NVARCHAR2(64), + EXCEPTION_MSG_ NVARCHAR2(2000), + DUEDATE_ TIMESTAMP(6), + REPEAT_ NVARCHAR2(255), + HANDLER_TYPE_ NVARCHAR2(255), + HANDLER_CFG_ NVARCHAR2(2000), + CUSTOM_VALUES_ID_ NVARCHAR2(64), + CREATE_TIME_ TIMESTAMP(6), + TENANT_ID_ NVARCHAR2(255) DEFAULT '', + primary key (ID_) +); + +create table ACT_RU_DEADLETTER_JOB ( + ID_ NVARCHAR2(64) NOT NULL, + REV_ INTEGER, + CATEGORY_ NVARCHAR2(255), + TYPE_ NVARCHAR2(255) NOT NULL, + EXCLUSIVE_ NUMBER(1,0) CHECK (EXCLUSIVE_ IN (1,0)), + EXECUTION_ID_ NVARCHAR2(64), + PROCESS_INSTANCE_ID_ NVARCHAR2(64), + PROC_DEF_ID_ NVARCHAR2(64), + ELEMENT_ID_ NVARCHAR2(255), + ELEMENT_NAME_ NVARCHAR2(255), + SCOPE_ID_ NVARCHAR2(255), + SUB_SCOPE_ID_ NVARCHAR2(255), + SCOPE_TYPE_ NVARCHAR2(255), + SCOPE_DEFINITION_ID_ NVARCHAR2(255), + CORRELATION_ID_ NVARCHAR2(255), + EXCEPTION_STACK_ID_ NVARCHAR2(64), + EXCEPTION_MSG_ NVARCHAR2(2000), + DUEDATE_ TIMESTAMP(6), + REPEAT_ NVARCHAR2(255), + HANDLER_TYPE_ NVARCHAR2(255), + HANDLER_CFG_ NVARCHAR2(2000), + CUSTOM_VALUES_ID_ NVARCHAR2(64), + CREATE_TIME_ TIMESTAMP(6), + TENANT_ID_ NVARCHAR2(255) DEFAULT '', + primary key (ID_) +); + +create table ACT_RU_HISTORY_JOB ( + ID_ NVARCHAR2(64) NOT NULL, + REV_ INTEGER, + LOCK_EXP_TIME_ TIMESTAMP(6), + LOCK_OWNER_ NVARCHAR2(255), + RETRIES_ INTEGER, + EXCEPTION_STACK_ID_ NVARCHAR2(64), + EXCEPTION_MSG_ NVARCHAR2(2000), + HANDLER_TYPE_ NVARCHAR2(255), + HANDLER_CFG_ NVARCHAR2(2000), + CUSTOM_VALUES_ID_ NVARCHAR2(64), + ADV_HANDLER_CFG_ID_ NVARCHAR2(64), + CREATE_TIME_ TIMESTAMP(6), + SCOPE_TYPE_ NVARCHAR2(255), + TENANT_ID_ NVARCHAR2(255) DEFAULT '', + primary key (ID_) +); + +create table ACT_RU_EXTERNAL_JOB ( + ID_ NVARCHAR2(64) NOT NULL, + REV_ INTEGER, + CATEGORY_ NVARCHAR2(255), + TYPE_ NVARCHAR2(255) NOT NULL, + LOCK_EXP_TIME_ TIMESTAMP(6), + LOCK_OWNER_ NVARCHAR2(255), + EXCLUSIVE_ NUMBER(1,0) CHECK (EXCLUSIVE_ IN (1,0)), + EXECUTION_ID_ NVARCHAR2(64), + PROCESS_INSTANCE_ID_ NVARCHAR2(64), + PROC_DEF_ID_ NVARCHAR2(64), + ELEMENT_ID_ NVARCHAR2(255), + ELEMENT_NAME_ NVARCHAR2(255), + SCOPE_ID_ NVARCHAR2(255), + SUB_SCOPE_ID_ NVARCHAR2(255), + SCOPE_TYPE_ NVARCHAR2(255), + SCOPE_DEFINITION_ID_ NVARCHAR2(255), + CORRELATION_ID_ NVARCHAR2(255), + RETRIES_ INTEGER, + EXCEPTION_STACK_ID_ NVARCHAR2(64), + EXCEPTION_MSG_ NVARCHAR2(2000), + DUEDATE_ TIMESTAMP(6), + REPEAT_ NVARCHAR2(255), + HANDLER_TYPE_ NVARCHAR2(255), + HANDLER_CFG_ NVARCHAR2(2000), + CUSTOM_VALUES_ID_ NVARCHAR2(64), + CREATE_TIME_ TIMESTAMP(6), + TENANT_ID_ NVARCHAR2(255) DEFAULT '', + primary key (ID_) +); + +create index ACT_IDX_JOB_EXCEPTION on ACT_RU_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_JOB_CUSTOM_VAL_ID on ACT_RU_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_JOB_CORRELATION_ID on ACT_RU_JOB(CORRELATION_ID_); + +create index ACT_IDX_TJOB_EXCEPTION on ACT_RU_TIMER_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_TJOB_CUSTOM_VAL_ID on ACT_RU_TIMER_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_TJOB_CORRELATION_ID on ACT_RU_TIMER_JOB(CORRELATION_ID_); + +create index ACT_IDX_SJOB_EXCEPTION on ACT_RU_SUSPENDED_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_SJOB_CUSTOM_VAL_ID on ACT_RU_SUSPENDED_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_SJOB_CORRELATION_ID on ACT_RU_SUSPENDED_JOB(CORRELATION_ID_); + +create index ACT_IDX_DJOB_EXCEPTION on ACT_RU_DEADLETTER_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_DJOB_CUSTOM_VAL_ID on ACT_RU_DEADLETTER_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_DJOB_CORRELATION_ID on ACT_RU_DEADLETTER_JOB(CORRELATION_ID_); + +create index ACT_IDX_EJOB_EXCEPTION on ACT_RU_EXTERNAL_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_EJOB_CUSTOM_VAL_ID on ACT_RU_EXTERNAL_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_EJOB_CORRELATION_ID on ACT_RU_EXTERNAL_JOB(CORRELATION_ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_CUSTOM_VAL + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_TIMER_JOB + add constraint ACT_FK_TJOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_TIMER_JOB + add constraint ACT_FK_TJOB_CUSTOM_VAL + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_SUSPENDED_JOB + add constraint ACT_FK_SJOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_SUSPENDED_JOB + add constraint ACT_FK_SJOB_CUSTOM_VAL + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_DEADLETTER_JOB + add constraint ACT_FK_DJOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_DEADLETTER_JOB + add constraint ACT_FK_DJOB_CUSTOM_VAL + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EXTERNAL_JOB + add constraint ACT_FK_EJOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EXTERNAL_JOB + add constraint ACT_FK_EJOB_CUSTOM_VAL + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +create index ACT_IDX_JOB_SCOPE on ACT_RU_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_JOB_SUB_SCOPE on ACT_RU_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_JOB_SCOPE_DEF on ACT_RU_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_TJOB_SCOPE on ACT_RU_TIMER_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TJOB_SUB_SCOPE on ACT_RU_TIMER_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TJOB_SCOPE_DEF on ACT_RU_TIMER_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); +create index ACT_IDX_TJOB_DUEDATE on ACT_RU_TIMER_JOB(DUEDATE_); + +create index ACT_IDX_SJOB_SCOPE on ACT_RU_SUSPENDED_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_SJOB_SUB_SCOPE on ACT_RU_SUSPENDED_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_SJOB_SCOPE_DEF on ACT_RU_SUSPENDED_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_DJOB_SCOPE on ACT_RU_DEADLETTER_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_DJOB_SUB_SCOPE on ACT_RU_DEADLETTER_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_DJOB_SCOPE_DEF on ACT_RU_DEADLETTER_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_EJOB_SCOPE on ACT_RU_EXTERNAL_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_EJOB_SUB_SCOPE on ACT_RU_EXTERNAL_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_EJOB_SCOPE_DEF on ACT_RU_EXTERNAL_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table FLW_RU_BATCH ( + ID_ NVARCHAR2(64) not null, + REV_ INTEGER, + TYPE_ NVARCHAR2(64) not null, + SEARCH_KEY_ NVARCHAR2(255), + SEARCH_KEY2_ NVARCHAR2(255), + CREATE_TIME_ TIMESTAMP(6) not null, + COMPLETE_TIME_ TIMESTAMP(6), + STATUS_ NVARCHAR2(255), + BATCH_DOC_ID_ NVARCHAR2(64), + TENANT_ID_ NVARCHAR2(255) default '', + primary key (ID_) +); + +create table FLW_RU_BATCH_PART ( + ID_ NVARCHAR2(64) not null, + REV_ INTEGER, + BATCH_ID_ NVARCHAR2(64), + TYPE_ NVARCHAR2(64) not null, + SCOPE_ID_ NVARCHAR2(64), + SUB_SCOPE_ID_ NVARCHAR2(64), + SCOPE_TYPE_ NVARCHAR2(64), + SEARCH_KEY_ NVARCHAR2(255), + SEARCH_KEY2_ NVARCHAR2(255), + CREATE_TIME_ TIMESTAMP(6) not null, + COMPLETE_TIME_ TIMESTAMP(6), + STATUS_ NVARCHAR2(255), + RESULT_DOC_ID_ NVARCHAR2(64), + TENANT_ID_ NVARCHAR2(255) default '', + primary key (ID_) +); + +create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); + +alter table FLW_RU_BATCH_PART + add constraint FLW_FK_BATCH_PART_PARENT + foreign key (BATCH_ID_) + references FLW_RU_BATCH (ID_); + +create table ACT_RU_TASK ( + ID_ NVARCHAR2(64), + REV_ INTEGER, + EXECUTION_ID_ NVARCHAR2(64), + PROC_INST_ID_ NVARCHAR2(64), + PROC_DEF_ID_ NVARCHAR2(64), + TASK_DEF_ID_ NVARCHAR2(64), + SCOPE_ID_ NVARCHAR2(255), + SUB_SCOPE_ID_ NVARCHAR2(255), + SCOPE_TYPE_ NVARCHAR2(255), + SCOPE_DEFINITION_ID_ NVARCHAR2(255), + PROPAGATED_STAGE_INST_ID_ NVARCHAR2(255), + STATE_ NVARCHAR2(255), + NAME_ NVARCHAR2(255), + PARENT_TASK_ID_ NVARCHAR2(64), + DESCRIPTION_ NVARCHAR2(2000), + TASK_DEF_KEY_ NVARCHAR2(255), + OWNER_ NVARCHAR2(255), + ASSIGNEE_ NVARCHAR2(255), + DELEGATION_ NVARCHAR2(64), + PRIORITY_ INTEGER, + CREATE_TIME_ TIMESTAMP(6), + IN_PROGRESS_TIME_ TIMESTAMP(6), + IN_PROGRESS_STARTED_BY_ NVARCHAR2(255), + CLAIM_TIME_ TIMESTAMP(6), + CLAIMED_BY_ NVARCHAR2(255), + SUSPENDED_TIME_ TIMESTAMP(6), + SUSPENDED_BY_ NVARCHAR2(255), + IN_PROGRESS_DUE_DATE_ TIMESTAMP(6), + DUE_DATE_ TIMESTAMP(6), + CATEGORY_ NVARCHAR2(255), + SUSPENSION_STATE_ INTEGER, + TENANT_ID_ NVARCHAR2(255) DEFAULT '', + FORM_KEY_ NVARCHAR2(255), + IS_COUNT_ENABLED_ NUMBER(1,0) CHECK (IS_COUNT_ENABLED_ IN (1,0)), + VAR_COUNT_ INTEGER, + ID_LINK_COUNT_ INTEGER, + SUB_TASK_COUNT_ INTEGER, + primary key (ID_) +); + +create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_); +create index ACT_IDX_TASK_SCOPE on ACT_RU_TASK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TASK_SUB_SCOPE on ACT_RU_TASK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TASK_SCOPE_DEF on ACT_RU_TASK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_HI_TASKINST ( + ID_ NVARCHAR2(64) not null, + REV_ INTEGER default 1, + PROC_DEF_ID_ NVARCHAR2(64), + TASK_DEF_ID_ NVARCHAR2(64), + TASK_DEF_KEY_ NVARCHAR2(255), + PROC_INST_ID_ NVARCHAR2(64), + EXECUTION_ID_ NVARCHAR2(64), + SCOPE_ID_ NVARCHAR2(255), + SUB_SCOPE_ID_ NVARCHAR2(255), + SCOPE_TYPE_ NVARCHAR2(255), + SCOPE_DEFINITION_ID_ NVARCHAR2(255), + PROPAGATED_STAGE_INST_ID_ NVARCHAR2(255), + PARENT_TASK_ID_ NVARCHAR2(64), + STATE_ NVARCHAR2(255), + NAME_ NVARCHAR2(255), + DESCRIPTION_ NVARCHAR2(2000), + OWNER_ NVARCHAR2(255), + ASSIGNEE_ NVARCHAR2(255), + START_TIME_ TIMESTAMP(6) not null, + IN_PROGRESS_TIME_ TIMESTAMP(6), + IN_PROGRESS_STARTED_BY_ NVARCHAR2(255), + CLAIM_TIME_ TIMESTAMP(6), + CLAIMED_BY_ NVARCHAR2(255), + SUSPENDED_TIME_ TIMESTAMP(6), + SUSPENDED_BY_ NVARCHAR2(255), + END_TIME_ TIMESTAMP(6), + COMPLETED_BY_ NVARCHAR2(255), + DURATION_ NUMBER(19,0), + DELETE_REASON_ NVARCHAR2(2000), + PRIORITY_ INTEGER, + IN_PROGRESS_DUE_DATE_ TIMESTAMP(6), + DUE_DATE_ TIMESTAMP(6), + FORM_KEY_ NVARCHAR2(255), + CATEGORY_ NVARCHAR2(255), + TENANT_ID_ NVARCHAR2(255) default '', + LAST_UPDATED_TIME_ TIMESTAMP(6), + primary key (ID_) +); + +create table ACT_HI_TSK_LOG ( + ID_ NUMBER(19), + TYPE_ NVARCHAR2(64), + TASK_ID_ NVARCHAR2(64) not null, + TIME_STAMP_ TIMESTAMP(6) not null, + USER_ID_ NVARCHAR2(255), + DATA_ NVARCHAR2(2000), + EXECUTION_ID_ NVARCHAR2(64), + PROC_INST_ID_ NVARCHAR2(64), + PROC_DEF_ID_ NVARCHAR2(64), + SCOPE_ID_ NVARCHAR2(255), + SCOPE_DEFINITION_ID_ NVARCHAR2(255), + SUB_SCOPE_ID_ NVARCHAR2(255), + SCOPE_TYPE_ NVARCHAR2(255), + TENANT_ID_ NVARCHAR2(255) default '', + primary key (ID_) +); + +create sequence act_hi_task_evt_log_seq start with 1 increment by 1; + +create index ACT_IDX_HI_TASK_SCOPE on ACT_HI_TASKINST(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_TASK_SUB_SCOPE on ACT_HI_TASKINST(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_TASK_SCOPE_DEF on ACT_HI_TASKINST(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); +create index ACT_IDX_ACT_HI_TSK_LOG_TASK on ACT_HI_TSK_LOG(TASK_ID_); + +create table ACT_RU_VARIABLE ( + ID_ NVARCHAR2(64) not null, + REV_ INTEGER, + TYPE_ NVARCHAR2(255) not null, + NAME_ NVARCHAR2(255) not null, + EXECUTION_ID_ NVARCHAR2(64), + PROC_INST_ID_ NVARCHAR2(64), + TASK_ID_ NVARCHAR2(64), + SCOPE_ID_ NVARCHAR2(255), + SUB_SCOPE_ID_ NVARCHAR2(255), + SCOPE_TYPE_ NVARCHAR2(255), + BYTEARRAY_ID_ NVARCHAR2(64), + DOUBLE_ NUMBER(*,10), + LONG_ NUMBER(19,0), + TEXT_ NVARCHAR2(2000), + TEXT2_ NVARCHAR2(2000), + META_INFO_ NVARCHAR2(2000), + primary key (ID_) +); + +create index ACT_IDX_RU_VAR_SCOPE_ID_TYPE on ACT_RU_VARIABLE(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_RU_VAR_SUB_ID_TYPE on ACT_RU_VARIABLE(SUB_SCOPE_ID_, SCOPE_TYPE_); + +create index ACT_IDX_VAR_BYTEARRAY on ACT_RU_VARIABLE(BYTEARRAY_ID_); +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_BYTEARRAY + foreign key (BYTEARRAY_ID_) + references ACT_GE_BYTEARRAY (ID_); + +create table ACT_HI_VARINST ( + ID_ NVARCHAR2(64) not null, + REV_ INTEGER default 1, + PROC_INST_ID_ NVARCHAR2(64), + EXECUTION_ID_ NVARCHAR2(64), + TASK_ID_ NVARCHAR2(64), + NAME_ NVARCHAR2(255) not null, + VAR_TYPE_ NVARCHAR2(100), + SCOPE_ID_ NVARCHAR2(255), + SUB_SCOPE_ID_ NVARCHAR2(255), + SCOPE_TYPE_ NVARCHAR2(255), + BYTEARRAY_ID_ NVARCHAR2(64), + DOUBLE_ NUMBER(*,10), + LONG_ NUMBER(19,0), + TEXT_ NVARCHAR2(2000), + TEXT2_ NVARCHAR2(2000), + META_INFO_ NVARCHAR2(2000), + CREATE_TIME_ TIMESTAMP(6), + LAST_UPDATED_TIME_ TIMESTAMP(6), + primary key (ID_) +); + +create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_); +create index ACT_IDX_HI_VAR_SCOPE_ID_TYPE on ACT_HI_VARINST(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_VAR_SUB_ID_TYPE on ACT_HI_VARINST(SUB_SCOPE_ID_, SCOPE_TYPE_); + + +create table ACT_RU_EVENT_SUBSCR ( + ID_ NVARCHAR2(64) not null, + REV_ integer, + EVENT_TYPE_ NVARCHAR2(255) not null, + EVENT_NAME_ NVARCHAR2(255), + EXECUTION_ID_ NVARCHAR2(64), + PROC_INST_ID_ NVARCHAR2(64), + ACTIVITY_ID_ NVARCHAR2(64), + CONFIGURATION_ NVARCHAR2(255), + CREATED_ TIMESTAMP(6) not null, + PROC_DEF_ID_ NVARCHAR2(64), + SUB_SCOPE_ID_ NVARCHAR2(64), + SCOPE_ID_ NVARCHAR2(64), + SCOPE_DEFINITION_ID_ NVARCHAR2(64), + SCOPE_DEFINITION_KEY_ NVARCHAR2(255), + SCOPE_TYPE_ NVARCHAR2(64), + LOCK_TIME_ TIMESTAMP(6), + LOCK_OWNER_ NVARCHAR2(255), + TENANT_ID_ NVARCHAR2(255) DEFAULT '', + primary key (ID_) +); + +create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_); +create index ACT_IDX_EVENT_SUBSCR on ACT_RU_EVENT_SUBSCR(EXECUTION_ID_); +create index ACT_IDX_EVENT_SUBSCR_SCOPEREF_ on ACT_RU_EVENT_SUBSCR(SCOPE_ID_, SCOPE_TYPE_); diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.postgres.create.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.postgres.create.common.sql index ad762197d08..87c6c5fd55d 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.postgres.create.common.sql +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/create/flowable.postgres.create.common.sql @@ -16,7 +16,587 @@ create table ACT_GE_BYTEARRAY ( ); insert into ACT_GE_PROPERTY -values ('common.schema.version', '7.1.0.0', 1); +values ('common.schema.version', '7.1.0.1', 1); insert into ACT_GE_PROPERTY values ('next.dbid', '1', 1); + + +create table ACT_RU_ENTITYLINK ( + ID_ varchar(64), + REV_ integer, + CREATE_TIME_ timestamp, + LINK_TYPE_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PARENT_ELEMENT_ID_ varchar(255), + REF_SCOPE_ID_ varchar(255), + REF_SCOPE_TYPE_ varchar(255), + REF_SCOPE_DEFINITION_ID_ varchar(255), + ROOT_SCOPE_ID_ varchar(255), + ROOT_SCOPE_TYPE_ varchar(255), + HIERARCHY_TYPE_ varchar(255), + primary key (ID_) +); + +create index ACT_IDX_ENT_LNK_SCOPE on ACT_RU_ENTITYLINK(SCOPE_ID_, SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_REF_SCOPE on ACT_RU_ENTITYLINK(REF_SCOPE_ID_, REF_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_ROOT_SCOPE on ACT_RU_ENTITYLINK(ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_ENT_LNK_SCOPE_DEF on ACT_RU_ENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_, LINK_TYPE_); + +create table ACT_HI_ENTITYLINK ( + ID_ varchar(64), + LINK_TYPE_ varchar(255), + CREATE_TIME_ timestamp, + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PARENT_ELEMENT_ID_ varchar(255), + REF_SCOPE_ID_ varchar(255), + REF_SCOPE_TYPE_ varchar(255), + REF_SCOPE_DEFINITION_ID_ varchar(255), + ROOT_SCOPE_ID_ varchar(255), + ROOT_SCOPE_TYPE_ varchar(255), + HIERARCHY_TYPE_ varchar(255), + primary key (ID_) +); + +create index ACT_IDX_HI_ENT_LNK_SCOPE on ACT_HI_ENTITYLINK(SCOPE_ID_, SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_REF_SCOPE on ACT_HI_ENTITYLINK(REF_SCOPE_ID_, REF_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_ROOT_SCOPE on ACT_HI_ENTITYLINK(ROOT_SCOPE_ID_, ROOT_SCOPE_TYPE_, LINK_TYPE_); +create index ACT_IDX_HI_ENT_LNK_SCOPE_DEF on ACT_HI_ENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_, LINK_TYPE_); + + +create table ACT_RU_IDENTITYLINK ( + ID_ varchar(64), + REV_ integer, + GROUP_ID_ varchar(255), + TYPE_ varchar(255), + USER_ID_ varchar(255), + TASK_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar (64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + primary key (ID_) +); + +create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_); +create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_); +create index ACT_IDX_IDENT_LNK_SCOPE on ACT_RU_IDENTITYLINK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_IDENT_LNK_SUB_SCOPE on ACT_RU_IDENTITYLINK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_IDENT_LNK_SCOPE_DEF on ACT_RU_IDENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_HI_IDENTITYLINK ( + ID_ varchar(64), + GROUP_ID_ varchar(255), + TYPE_ varchar(255), + USER_ID_ varchar(255), + TASK_ID_ varchar(64), + CREATE_TIME_ timestamp, + PROC_INST_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + primary key (ID_) +); + +create index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK(USER_ID_); +create index ACT_IDX_HI_IDENT_LNK_SCOPE on ACT_HI_IDENTITYLINK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_IDENT_LNK_SUB_SCOPE on ACT_HI_IDENTITYLINK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_IDENT_LNK_SCOPE_DEF on ACT_HI_IDENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + + +create table ACT_RU_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + LOCK_EXP_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_TIMER_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + LOCK_EXP_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_SUSPENDED_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_DEADLETTER_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_HISTORY_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + LOCK_EXP_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + ADV_HANDLER_CFG_ID_ varchar(64), + CREATE_TIME_ timestamp, + SCOPE_TYPE_ varchar(255), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table ACT_RU_EXTERNAL_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + TYPE_ varchar(255) NOT NULL, + LOCK_EXP_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + ELEMENT_ID_ varchar(255), + ELEMENT_NAME_ varchar(255), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + CORRELATION_ID_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + DUEDATE_ timestamp, + REPEAT_ varchar(255), + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + CUSTOM_VALUES_ID_ varchar(64), + CREATE_TIME_ timestamp, + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create index ACT_IDX_JOB_EXCEPTION_STACK_ID on ACT_RU_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_JOB_CUSTOM_VALUES_ID on ACT_RU_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_JOB_CORRELATION_ID on ACT_RU_JOB(CORRELATION_ID_); + +create index ACT_IDX_TIMER_JOB_EXCEPTION_STACK_ID on ACT_RU_TIMER_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_TIMER_JOB_CUSTOM_VALUES_ID on ACT_RU_TIMER_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_TIMER_JOB_CORRELATION_ID on ACT_RU_TIMER_JOB(CORRELATION_ID_); +create index ACT_IDX_TIMER_JOB_DUEDATE on ACT_RU_TIMER_JOB(DUEDATE_); + +create index ACT_IDX_SUSPENDED_JOB_EXCEPTION_STACK_ID on ACT_RU_SUSPENDED_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_SUSPENDED_JOB_CUSTOM_VALUES_ID on ACT_RU_SUSPENDED_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_SUSPENDED_JOB_CORRELATION_ID on ACT_RU_SUSPENDED_JOB(CORRELATION_ID_); + +create index ACT_IDX_DEADLETTER_JOB_EXCEPTION_STACK_ID on ACT_RU_DEADLETTER_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_DEADLETTER_JOB_CUSTOM_VALUES_ID on ACT_RU_DEADLETTER_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_DEADLETTER_JOB_CORRELATION_ID on ACT_RU_DEADLETTER_JOB(CORRELATION_ID_); + +create index ACT_IDX_EXTERNAL_JOB_EXCEPTION_STACK_ID on ACT_RU_EXTERNAL_JOB(EXCEPTION_STACK_ID_); +create index ACT_IDX_EXTERNAL_JOB_CUSTOM_VALUES_ID on ACT_RU_EXTERNAL_JOB(CUSTOM_VALUES_ID_); +create index ACT_IDX_EXTERNAL_JOB_CORRELATION_ID on ACT_RU_EXTERNAL_JOB(CORRELATION_ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_TIMER_JOB + add constraint ACT_FK_TIMER_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_TIMER_JOB + add constraint ACT_FK_TIMER_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_SUSPENDED_JOB + add constraint ACT_FK_SUSPENDED_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_SUSPENDED_JOB + add constraint ACT_FK_SUSPENDED_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_DEADLETTER_JOB + add constraint ACT_FK_DEADLETTER_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_DEADLETTER_JOB + add constraint ACT_FK_DEADLETTER_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EXTERNAL_JOB + add constraint ACT_FK_EXTERNAL_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EXTERNAL_JOB + add constraint ACT_FK_EXTERNAL_JOB_CUSTOM_VALUES + foreign key (CUSTOM_VALUES_ID_) + references ACT_GE_BYTEARRAY (ID_); + +create index ACT_IDX_JOB_SCOPE on ACT_RU_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_JOB_SUB_SCOPE on ACT_RU_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_JOB_SCOPE_DEF on ACT_RU_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_TJOB_SCOPE on ACT_RU_TIMER_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TJOB_SUB_SCOPE on ACT_RU_TIMER_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TJOB_SCOPE_DEF on ACT_RU_TIMER_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_SJOB_SCOPE on ACT_RU_SUSPENDED_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_SJOB_SUB_SCOPE on ACT_RU_SUSPENDED_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_SJOB_SCOPE_DEF on ACT_RU_SUSPENDED_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_DJOB_SCOPE on ACT_RU_DEADLETTER_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_DJOB_SUB_SCOPE on ACT_RU_DEADLETTER_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_DJOB_SCOPE_DEF on ACT_RU_DEADLETTER_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create index ACT_IDX_EJOB_SCOPE on ACT_RU_EXTERNAL_JOB(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_EJOB_SUB_SCOPE on ACT_RU_EXTERNAL_JOB(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_EJOB_SCOPE_DEF on ACT_RU_EXTERNAL_JOB(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table FLW_RU_BATCH ( + ID_ varchar(64) not null, + REV_ integer, + TYPE_ varchar(64) not null, + SEARCH_KEY_ varchar(255), + SEARCH_KEY2_ varchar(255), + CREATE_TIME_ timestamp not null, + COMPLETE_TIME_ timestamp, + STATUS_ varchar(255), + BATCH_DOC_ID_ varchar(64), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create table FLW_RU_BATCH_PART ( + ID_ varchar(64) not null, + REV_ integer, + BATCH_ID_ varchar(64), + TYPE_ varchar(64) not null, + SCOPE_ID_ varchar(64), + SUB_SCOPE_ID_ varchar(64), + SCOPE_TYPE_ varchar(64), + SEARCH_KEY_ varchar(255), + SEARCH_KEY2_ varchar(255), + CREATE_TIME_ timestamp not null, + COMPLETE_TIME_ timestamp, + STATUS_ varchar(255), + RESULT_DOC_ID_ varchar(64), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART(BATCH_ID_); + +alter table FLW_RU_BATCH_PART + add constraint FLW_FK_BATCH_PART_PARENT + foreign key (BATCH_ID_) + references FLW_RU_BATCH (ID_); + +create table ACT_RU_TASK ( + ID_ varchar(64), + REV_ integer, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + TASK_DEF_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PROPAGATED_STAGE_INST_ID_ varchar(255), + STATE_ varchar(255), + NAME_ varchar(255), + PARENT_TASK_ID_ varchar(64), + DESCRIPTION_ varchar(4000), + TASK_DEF_KEY_ varchar(255), + OWNER_ varchar(255), + ASSIGNEE_ varchar(255), + DELEGATION_ varchar(64), + PRIORITY_ integer, + CREATE_TIME_ timestamp, + IN_PROGRESS_TIME_ timestamp, + IN_PROGRESS_STARTED_BY_ varchar(255), + CLAIM_TIME_ timestamp, + CLAIMED_BY_ varchar(255), + SUSPENDED_TIME_ timestamp, + SUSPENDED_BY_ varchar(255), + IN_PROGRESS_DUE_DATE_ timestamp, + DUE_DATE_ timestamp, + CATEGORY_ varchar(255), + SUSPENSION_STATE_ integer, + TENANT_ID_ varchar(255) default '', + FORM_KEY_ varchar(255), + IS_COUNT_ENABLED_ boolean, + VAR_COUNT_ integer, + ID_LINK_COUNT_ integer, + SUB_TASK_COUNT_ integer, + primary key (ID_) +); + +create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_); +create index ACT_IDX_TASK_SCOPE on ACT_RU_TASK(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TASK_SUB_SCOPE on ACT_RU_TASK(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_TASK_SCOPE_DEF on ACT_RU_TASK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); + +create table ACT_HI_TASKINST ( + ID_ varchar(64) not null, + REV_ integer default 1, + PROC_DEF_ID_ varchar(64), + TASK_DEF_ID_ varchar(64), + TASK_DEF_KEY_ varchar(255), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + PROPAGATED_STAGE_INST_ID_ varchar(255), + STATE_ varchar(255), + NAME_ varchar(255), + PARENT_TASK_ID_ varchar(64), + DESCRIPTION_ varchar(4000), + OWNER_ varchar(255), + ASSIGNEE_ varchar(255), + START_TIME_ timestamp not null, + IN_PROGRESS_TIME_ timestamp, + IN_PROGRESS_STARTED_BY_ varchar(255), + CLAIM_TIME_ timestamp, + CLAIMED_BY_ varchar(255), + SUSPENDED_TIME_ timestamp, + SUSPENDED_BY_ varchar(255), + END_TIME_ timestamp, + COMPLETED_BY_ varchar(255), + DURATION_ bigint, + DELETE_REASON_ varchar(4000), + PRIORITY_ integer, + IN_PROGRESS_DUE_DATE_ timestamp, + DUE_DATE_ timestamp, + FORM_KEY_ varchar(255), + CATEGORY_ varchar(255), + TENANT_ID_ varchar(255) default '', + LAST_UPDATED_TIME_ timestamp, + primary key (ID_) +); + +create table ACT_HI_TSK_LOG ( + ID_ SERIAL PRIMARY KEY, + TYPE_ varchar(64), + TASK_ID_ varchar(64) not null, + TIME_STAMP_ timestamp not null, + USER_ID_ varchar(255), + DATA_ varchar(4000), + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SCOPE_DEFINITION_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + TENANT_ID_ varchar(255) default '' +); + +create index ACT_IDX_HI_TASK_SCOPE on ACT_HI_TASKINST(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_TASK_SUB_SCOPE on ACT_HI_TASKINST(SUB_SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_TASK_SCOPE_DEF on ACT_HI_TASKINST(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); +create index ACT_IDX_ACT_HI_TSK_LOG_TASK on ACT_HI_TSK_LOG(TASK_ID_); + +create table ACT_RU_VARIABLE ( + ID_ varchar(64) not null, + REV_ integer, + TYPE_ varchar(255) not null, + NAME_ varchar(255) not null, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + TASK_ID_ varchar(64), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double precision, + LONG_ bigint, + TEXT_ varchar(4000), + TEXT2_ varchar(4000), + META_INFO_ varchar(4000), + primary key (ID_) +); + +create index ACT_IDX_RU_VAR_SCOPE_ID_TYPE on ACT_RU_VARIABLE(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_RU_VAR_SUB_ID_TYPE on ACT_RU_VARIABLE(SUB_SCOPE_ID_, SCOPE_TYPE_); + +create index ACT_IDX_VAR_BYTEARRAY on ACT_RU_VARIABLE(BYTEARRAY_ID_); +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_BYTEARRAY + foreign key (BYTEARRAY_ID_) + references ACT_GE_BYTEARRAY (ID_); + +create table ACT_HI_VARINST ( + ID_ varchar(64) not null, + REV_ integer default 1, + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + TASK_ID_ varchar(64), + NAME_ varchar(255) not null, + VAR_TYPE_ varchar(100), + SCOPE_ID_ varchar(255), + SUB_SCOPE_ID_ varchar(255), + SCOPE_TYPE_ varchar(255), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double precision, + LONG_ bigint, + TEXT_ varchar(4000), + TEXT2_ varchar(4000), + META_INFO_ varchar(4000), + CREATE_TIME_ timestamp, + LAST_UPDATED_TIME_ timestamp, + primary key (ID_) +); + +create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_); +create index ACT_IDX_HI_VAR_SCOPE_ID_TYPE on ACT_HI_VARINST(SCOPE_ID_, SCOPE_TYPE_); +create index ACT_IDX_HI_VAR_SUB_ID_TYPE on ACT_HI_VARINST(SUB_SCOPE_ID_, SCOPE_TYPE_); + + +create table ACT_RU_EVENT_SUBSCR ( + ID_ varchar(64) not null, + REV_ integer, + EVENT_TYPE_ varchar(255) not null, + EVENT_NAME_ varchar(255), + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + ACTIVITY_ID_ varchar(64), + CONFIGURATION_ varchar(255), + CREATED_ timestamp not null, + PROC_DEF_ID_ varchar(64), + SUB_SCOPE_ID_ varchar(64), + SCOPE_ID_ varchar(64), + SCOPE_DEFINITION_ID_ varchar(64), + SCOPE_DEFINITION_KEY_ varchar(255), + SCOPE_TYPE_ varchar(64), + LOCK_TIME_ timestamp, + LOCK_OWNER_ varchar(255), + TENANT_ID_ varchar(255) default '', + primary key (ID_) +); + +create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_); +create index ACT_IDX_EVENT_SUBSCR on ACT_RU_EVENT_SUBSCR(EXECUTION_ID_); +create index ACT_IDX_EVENT_SUBSCR_SCOPEREF_ on ACT_RU_EVENT_SUBSCR(SCOPE_ID_, SCOPE_TYPE_); diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.cockroachdb.drop.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.cockroachdb.drop.common.sql index df96f4db2ed..172ad175490 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.cockroachdb.drop.common.sql +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.cockroachdb.drop.common.sql @@ -1,4 +1,38 @@ +drop table if exists flw_ru_batch_part cascade; +drop table if exists flw_ru_batch cascade; + +-- force-commit + +drop table if exists act_ru_entitylink cascade; + +-- force-commit + +drop table if exists ACT_RU_EVENT_SUBSCR cascade; + +drop table if exists act_ru_identitylink cascade; + +-- force-commit + +drop table if exists act_ru_job cascade; +drop table if exists act_ru_timer_job cascade; +drop table if exists act_ru_suspended_job cascade; +drop table if exists act_ru_deadletter_job cascade; +drop table if exists act_ru_history_job cascade; +drop table if exists act_ru_external_job cascade; + +-- force-commit + +drop table if exists act_ru_task cascade; + +-- force-commit + + +drop table if exists act_ru_variable cascade; + +-- force-commit + drop table if exists act_ge_bytearray cascade; drop table if exists act_ge_property cascade; --- force-commit \ No newline at end of file +-- force-commit + diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.db2.drop.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.db2.drop.common.sql index 5f8ef049b28..3fea75eeccd 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.db2.drop.common.sql +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.db2.drop.common.sql @@ -1,2 +1,97 @@ +drop index FLW_IDX_BATCH_PART; + +drop table FLW_RU_BATCH_PART; +drop table FLW_RU_BATCH; + +drop index ACT_IDX_ENT_LNK_SCOPE; +drop index ACT_IDX_ENT_LNK_SCOPE_DEF; + +drop table ACT_RU_ENTITYLINK; + +drop index ACT_IDX_EVENT_SUBSCR_CONFIG_; +drop index ACT_IDX_EVENT_SUBSCR_EXEC_ID; +drop index ACT_IDX_EVENT_SUBSCR_SCOPEREF_; + +drop table ACT_RU_EVENT_SUBSCR; + +drop index ACT_IDX_IDENT_LNK_USER; +drop index ACT_IDX_IDENT_LNK_GROUP; +drop index ACT_IDX_IDENT_LNK_SCOPE; +drop index ACT_IDX_IDENT_LNK_SUB_SCOPE; +drop index ACT_IDX_IDENT_LNK_SCOPE_DEF; + +drop table ACT_RU_IDENTITYLINK; + +drop index ACT_IDX_JOB_SCOPE; +drop index ACT_IDX_JOB_SUB_SCOPE; +drop index ACT_IDX_JOB_SCOPE_DEF; +drop index ACT_IDX_TJOB_SCOPE; +drop index ACT_IDX_TJOB_SUB_SCOPE; +drop index ACT_IDX_TJOB_SCOPE_DEF; +drop index ACT_IDX_SJOB_SCOPE; +drop index ACT_IDX_SJOB_SUB_SCOPE; +drop index ACT_IDX_SJOB_SCOPE_DEF; +drop index ACT_IDX_DJOB_SCOPE; +drop index ACT_IDX_DJOB_SUB_SCOPE; +drop index ACT_IDX_DJOB_SCOPE_DEF; +drop index ACT_IDX_EJOB_SCOPE; +drop index ACT_IDX_EJOB_SUB_SCOPE; +drop index ACT_IDX_EJOB_SCOPE_DEF; + +alter table ACT_RU_JOB + drop foreign key ACT_FK_JOB_EXCEPTION; + +alter table ACT_RU_JOB + drop foreign key ACT_FK_JOB_CUSTOM_VAL; + +alter table ACT_RU_TIMER_JOB + drop foreign key ACT_FK_TJOB_EXCEPTION; + +alter table ACT_RU_TIMER_JOB + drop foreign key ACT_FK_TJOB_CUSTOM_VAL; + +alter table ACT_RU_SUSPENDED_JOB + drop foreign key ACT_FK_SJOB_EXCEPTION; + +alter table ACT_RU_SUSPENDED_JOB + drop foreign key ACT_FK_SJOB_CUSTOM_VAL; + +alter table ACT_RU_DEADLETTER_JOB + drop foreign key ACT_FK_DJOB_EXCEPTION; + +alter table ACT_RU_DEADLETTER_JOB + drop foreign key ACT_FK_DJOB_CUSTOM_VAL; + +alter table ACT_RU_EXTERNAL_JOB + drop foreign key ACT_FK_EJOB_EXCEPTION; + +alter table ACT_RU_EXTERNAL_JOB + drop foreign key ACT_FK_EJOB_CUSTOM_VAL; + +drop table ACT_RU_JOB; +drop table ACT_RU_TIMER_JOB; +drop table ACT_RU_SUSPENDED_JOB; +drop table ACT_RU_DEADLETTER_JOB; +drop table ACT_RU_HISTORY_JOB; +drop table ACT_RU_EXTERNAL_JOB; + + +drop index ACT_IDX_TASK_CREATE; +drop index ACT_IDX_TASK_SCOPE; +drop index ACT_IDX_TASK_SUB_SCOPE; +drop index ACT_IDX_TASK_SCOPE_DEF; + +drop table ACT_HI_TSK_LOG; + +drop index ACT_IDX_RU_VAR_SCOPE_ID_TYPE; +drop index ACT_IDX_RU_VAR_SUB_ID_TYPE; + +alter table ACT_RU_VARIABLE + drop foreign key ACT_FK_VAR_BYTEARRAY; + +drop table ACT_RU_VARIABLE; + + drop table ACT_GE_BYTEARRAY; -drop table ACT_GE_PROPERTY; \ No newline at end of file +drop table ACT_GE_PROPERTY; + diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.h2.drop.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.h2.drop.common.sql index baeb2522785..7364ece1f5b 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.h2.drop.common.sql +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.h2.drop.common.sql @@ -1,2 +1,82 @@ +drop table if exists FLW_RU_BATCH_PART cascade constraints; +drop table if exists FLW_RU_BATCH cascade constraints; + +drop index if exists FLW_IDX_BATCH_PART; + +drop table if exists ACT_RU_ENTITYLINK cascade constraints; + +drop index if exists ACT_IDX_ENT_LNK_SCOPE; +drop index if exists ACT_IDX_ENT_LNK_SCOPE_DEF; + +drop table if exists ACT_HI_ENTITYLINK cascade constraints; + +drop index if exists ACT_IDX_HI_ENT_LNK_SCOPE; +drop index if exists ACT_IDX_HI_ENT_LNK_SCOPE_DEF; + +drop table if exists ACT_RU_EVENT_SUBSCR cascade constraints; + +drop index if exists ACT_IDX_EVENT_SUBSCR_CONFIG_; +drop index if exists ACT_IDX_EVENT_SUBSCR_SCOPEREF_; + +drop table if exists ACT_RU_IDENTITYLINK cascade constraints; + +drop index if exists ACT_IDX_IDENT_LNK_USER; +drop index if exists ACT_IDX_IDENT_LNK_GROUP; +drop index if exists ACT_IDX_IDENT_LNK_SCOPE; +drop index if exists ACT_IDX_IDENT_LNK_SUB_SCOPE; +drop index if exists ACT_IDX_IDENT_LNK_SCOPE_DEF; + +drop table if exists ACT_HI_IDENTITYLINK cascade constraints; + +drop index if exists ACT_IDX_HI_IDENT_LNK_USER; +drop index if exists ACT_IDX_HI_IDENT_LNK_SCOPE; +drop index if exists ACT_IDX_HI_IDENT_LNK_SUB_SCOPE; +drop index if exists ACT_IDX_HI_IDENT_LNK_SCOPE_DEF; + +drop index if exists ACT_IDX_JOB_SCOPE; +drop index if exists ACT_IDX_JOB_SUB_SCOPE; +drop index if exists ACT_IDX_JOB_SCOPE_DEF; +drop index if exists ACT_IDX_TJOB_SCOPE; +drop index if exists ACT_IDX_TJOB_SUB_SCOPE; +drop index if exists ACT_IDX_TJOB_SCOPE_DEF; +drop index if exists ACT_IDX_SJOB_SCOPE; +drop index if exists ACT_IDX_SJOB_SUB_SCOPE; +drop index if exists ACT_IDX_SJOB_SCOPE_DEF; +drop index if exists ACT_IDX_DJOB_SCOPE; +drop index if exists ACT_IDX_DJOB_SUB_SCOPE; +drop index if exists ACT_IDX_DJOB_SCOPE_DEF; +drop index if exists ACT_IDX_EJOB_SCOPE; +drop index if exists ACT_IDX_EJOB_SUB_SCOPE; +drop index if exists ACT_IDX_EJOB_SCOPE_DEF; + +drop table if exists ACT_RU_JOB cascade constraints; +drop table if exists ACT_RU_EXTERNAL_JOB cascade constraints; +drop table if exists ACT_RU_TIMER_JOB cascade constraints; +drop table if exists ACT_RU_SUSPENDED_JOB cascade constraints; +drop table if exists ACT_RU_DEADLETTER_JOB cascade constraints; +drop table if exists ACT_RU_HISTORY_JOB cascade constraints; + +drop table if exists ACT_RU_TASK cascade constraints; + +drop index if exists ACT_IDX_TASK_CREATE; + +drop table if exists ACT_HI_TASKINST cascade constraints; +drop table if exists ACT_HI_TSK_LOG cascade constraints; + +drop index if exists ACT_IDX_HI_TASK_SCOPE; +drop index if exists ACT_IDX_HI_TASK_SUB_SCOPE; +drop index if exists ACT_IDX_HI_TASK_SCOPE_DEF; + +drop table if exists ACT_RU_VARIABLE cascade constraints; + + +drop table if exists ACT_HI_VARINST cascade constraints; + +drop index if exists ACT_IDX_HI_PROCVAR_NAME_TYPE; +drop index if exists ACT_IDX_HI_VAR_SCOPE_ID_TYPE; +drop index if exists ACT_IDX_HI_VAR_SUB_ID_TYPE; + + drop table if exists ACT_GE_BYTEARRAY cascade constraints; -drop table if exists ACT_GE_PROPERTY cascade constraints; \ No newline at end of file +drop table if exists ACT_GE_PROPERTY cascade constraints; + diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.hsql.drop.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.hsql.drop.common.sql index 44691e17b91..c1f26622073 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.hsql.drop.common.sql +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.hsql.drop.common.sql @@ -1,2 +1,56 @@ +drop table if exists FLW_RU_BATCH_PART cascade constraints; +drop table if exists FLW_RU_BATCH cascade constraints; + +drop index if exists FLW_IDX_BATCH_PART; + +drop table if exists ACT_RU_ENTITYLINK cascade; + +drop index if exists ACT_IDX_ENT_LNK_SCOPE; +drop index if exists ACT_IDX_ENT_LNK_SCOPE_DEF; + +drop table if exists ACT_RU_EVENT_SUBSCR cascade; + +drop index if exists ACT_IDX_EVENT_SUBSCR_CONFIG_; +drop index if exists ACT_IDX_EVENT_SUBSCR_SCOPEREF_; + +drop table if exists ACT_RU_IDENTITYLINK cascade; + +drop index if exists ACT_IDX_IDENT_LNK_USER; +drop index if exists ACT_IDX_IDENT_LNK_GROUP; +drop index if exists ACT_IDX_IDENT_LNK_SCOPE; +drop index if exists ACT_IDX_IDENT_LNK_SUB_SCOPE; +drop index if exists ACT_IDX_IDENT_LNK_SCOPE_DEF; + +drop index if exists ACT_IDX_JOB_SCOPE; +drop index if exists ACT_IDX_JOB_SUB_SCOPE; +drop index if exists ACT_IDX_JOB_SCOPE_DEF; +drop index if exists ACT_IDX_TJOB_SCOPE; +drop index if exists ACT_IDX_TJOB_SUB_SCOPE; +drop index if exists ACT_IDX_TJOB_SCOPE_DEF; +drop index if exists ACT_IDX_SJOB_SCOPE; +drop index if exists ACT_IDX_SJOB_SUB_SCOPE; +drop index if exists ACT_IDX_SJOB_SCOPE_DEF; +drop index if exists ACT_IDX_DJOB_SCOPE; +drop index if exists ACT_IDX_DJOB_SUB_SCOPE; +drop index if exists ACT_IDX_DJOB_SCOPE_DEF; + +drop table if exists ACT_RU_JOB cascade; +drop table if exists ACT_RU_TIMER_JOB cascade; +drop table if exists ACT_RU_SUSPENDED_JOB cascade; +drop table if exists ACT_RU_DEADLETTER_JOB cascade; +drop table if exists ACT_RU_EXTERNAL_JOB cascade; +drop table if exists ACT_RU_HISTORY_JOB cascade; + +drop table if exists ACT_RU_TASK cascade; + +drop index if exists ACT_IDX_TASK_CREATE; +drop index if exists ACT_IDX_TASK_SCOPE; +drop index if exists ACT_IDX_TASK_SUB_SCOPE; +drop index if exists ACT_IDX_TASK_SCOPE_DEF; + +drop table if exists ACT_RU_VARIABLE cascade; + + drop table if exists ACT_GE_BYTEARRAY cascade; -drop table if exists ACT_GE_PROPERTY cascade; \ No newline at end of file +drop table if exists ACT_GE_PROPERTY cascade; + diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.mssql.drop.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.mssql.drop.common.sql index f1b06b5e220..0b909914e2d 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.mssql.drop.common.sql +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.mssql.drop.common.sql @@ -1,2 +1,75 @@ +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'FLW_IDX_BATCH_PART') drop index FLW_RU_BATCH_PART.FLW_IDX_BATCH_PART; + +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'FLW_RU_BATCH_PART') drop table FLW_RU_BATCH_PART; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'FLW_RU_BATCH') drop table FLW_RU_BATCH; + +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_ENT_LNK_SCOPE') drop index ACT_RU_ENTITYLINK.ACT_IDX_ENT_LNK_SCOPE; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_ENT_LNK_SCOPE_DEF') drop index ACT_RU_ENTITYLINK.ACT_IDX_ENT_LNK_SCOPE_DEF; + +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_ENTITYLINK') drop table ACT_RU_ENTITYLINK; + +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_EVENT_SUBSCR_CONFIG_') drop index ACT_RU_EVENT_SUBSCR.ACT_IDX_EVENT_SUBSCR_CONFIG_; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_EVENT_SUBSCR_EXEC_ID') drop index ACT_RU_EVENT_SUBSCR.ACT_IDX_EVENT_SUBSCR_EXEC_ID; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_EVENT_SUBSCR_SCOPEREF_') drop index ACT_RU_EVENT_SUBSCR.ACT_IDX_EVENT_SUBSCR_SCOPEREF_; + +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_EVENT_SUBSCR') drop table ACT_RU_EVENT_SUBSCR; + +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_IDENT_LNK_USER') drop index ACT_RU_IDENTITYLINK.ACT_IDX_IDENT_LNK_USER; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_IDENT_LNK_GROUP') drop index ACT_RU_IDENTITYLINK.ACT_IDX_IDENT_LNK_GROUP; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_IDENT_LNK_SCOPE') drop index ACT_RU_IDENTITYLINK.ACT_IDX_IDENT_LNK_SCOPE; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_IDENT_LNK_SUB_SCOPE') drop index ACT_RU_IDENTITYLINK.ACT_IDX_IDENT_LNK_SUB_SCOPE; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_IDENT_LNK_SCOPE_DEF') drop index ACT_RU_IDENTITYLINK.ACT_IDX_IDENT_LNK_SCOPE_DEF; + +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_IDENTITYLINK') drop table ACT_RU_IDENTITYLINK; + +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_JOB_SCOPE') drop index ACT_RU_JOB.ACT_IDX_JOB_SCOPE; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_JOB_SUB_SCOPE') drop index ACT_RU_JOB.ACT_IDX_JOB_SUB_SCOPE; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_JOB_SCOPE_DEF') drop index ACT_RU_JOB.ACT_IDX_JOB_SCOPE_DEF; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_TJOB_SCOPE') drop index ACT_RU_TIMER_JOB.ACT_IDX_TJOB_SCOPE; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_TJOB_SUB_SCOPE') drop index ACT_RU_TIMER_JOB.ACT_IDX_TJOB_SUB_SCOPE; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_TJOB_SCOPE_DEF') drop index ACT_RU_TIMER_JOB.ACT_IDX_TJOB_SCOPE_DEF; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_SJOB_SCOPE') drop index ACT_RU_SUSPENDED_JOB.ACT_IDX_SJOB_SCOPE; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_SJOB_SUB_SCOPE') drop index ACT_RU_SUSPENDED_JOB.ACT_IDX_SJOB_SUB_SCOPE; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_SJOB_SCOPE_DEF') drop index ACT_RU_SUSPENDED_JOB.ACT_IDX_SJOB_SCOPE_DEF; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_DJOB_SCOPE') drop index ACT_RU_DEADLETTER_JOB.ACT_IDX_DJOB_SCOPE; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_DJOB_SUB_SCOPE') drop index ACT_RU_DEADLETTER_JOB.ACT_IDX_DJOB_SUB_SCOPE; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_DJOB_SCOPE_DEF') drop index ACT_RU_DEADLETTER_JOB.ACT_IDX_DJOB_SCOPE_DEF; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_EJOB_SCOPE') drop index ACT_RU_EXTERNAL_JOB.ACT_IDX_EJOB_SCOPE; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_EJOB_SUB_SCOPE') drop index ACT_RU_EXTERNAL_JOB.ACT_IDX_EJOB_SUB_SCOPE; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_EJOB_SCOPE_DEF') drop index ACT_RU_EXTERNAL_JOB.ACT_IDX_EJOB_SCOPE_DEF; + +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_JOB') alter table ACT_RU_JOB drop constraint ACT_FK_JOB_EXCEPTION; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_JOB') alter table ACT_RU_JOB drop constraint ACT_FK_JOB_CUSTOM_VALUES; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_TIMER_JOB') alter table ACT_RU_TIMER_JOB drop constraint ACT_FK_TIMER_JOB_EXCEPTION; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_TIMER_JOB') alter table ACT_RU_TIMER_JOB drop constraint ACT_FK_TIMER_JOB_CUSTOM_VALUES; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_SUSPENDED_JOB') alter table ACT_RU_SUSPENDED_JOB drop constraint ACT_FK_SUSPENDED_JOB_EXCEPTION; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_SUSPENDED_JOB') alter table ACT_RU_SUSPENDED_JOB drop constraint ACT_FK_SUSPENDED_JOB_CUSTOM_VALUES; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_DEADLETTER_JOB') alter table ACT_RU_DEADLETTER_JOB drop constraint ACT_FK_DEADLETTER_JOB_EXCEPTION; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_DEADLETTER_JOB') alter table ACT_RU_DEADLETTER_JOB drop constraint ACT_FK_DEADLETTER_JOB_CUSTOM_VALUES; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_EXTERNAL_JOB') alter table ACT_RU_EXTERNAL_JOB drop constraint ACT_FK_EXTERNAL_JOB_EXCEPTION; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_EXTERNAL_JOB') alter table ACT_RU_EXTERNAL_JOB drop constraint ACT_FK_EXTERNAL_JOB_CUSTOM_VALUES; + +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_JOB') drop table ACT_RU_JOB; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_TIMER_JOB') drop table ACT_RU_TIMER_JOB; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_SUSPENDED_JOB') drop table ACT_RU_SUSPENDED_JOB; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_DEADLETTER_JOB') drop table ACT_RU_DEADLETTER_JOB; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_HISTORY_JOB') drop table ACT_RU_HISTORY_JOB; +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_EXTERNAL_JOB') drop table ACT_RU_EXTERNAL_JOB; + + +if exists (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_TASK_CREATE') drop index ACT_RU_TASK.ACT_IDX_TASK_CREATE; +if exists (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_TASK_SCOPE') drop index ACT_RU_TASK.ACT_IDX_TASK_SCOPE; +if exists (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_TASK_SUB_SCOPE') drop index ACT_RU_TASK.ACT_IDX_TASK_SUB_SCOPE; +if exists (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_TASK_SCOPE_DEF') drop index ACT_RU_TASK.ACT_IDX_TASK_SCOPE_DEF; + +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_TASK') drop table ACT_RU_TASK; + +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_VARIABLE') alter table ACT_RU_VARIABLE drop constraint ACT_FK_VAR_BYTEARRAY; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_RU_VAR_SCOPE_ID_TYPE') drop index ACT_RU_VARIABLE.ACT_IDX_RU_VAR_SCOPE_ID_TYPE; +IF EXISTS (SELECT name FROM sysindexes WHERE name = 'ACT_IDX_RU_VAR_SUB_ID_TYPE') drop index ACT_RU_VARIABLE.ACT_IDX_RU_VAR_SUB_ID_TYPE; + +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_RU_VARIABLE') drop table ACT_RU_VARIABLE; + if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_GE_BYTEARRAY') drop table ACT_GE_BYTEARRAY; -if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_GE_PROPERTY') drop table ACT_GE_PROPERTY; \ No newline at end of file +if exists (select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'ACT_GE_PROPERTY') drop table ACT_GE_PROPERTY; + diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.mysql.drop.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.mysql.drop.common.sql index 46790073ab1..6aafcdcd5cc 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.mysql.drop.common.sql +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.mysql.drop.common.sql @@ -1,2 +1,95 @@ +drop index FLW_IDX_BATCH_PART on FLW_RU_BATCH_PART; + +drop table if exists FLW_RU_BATCH_PART; +drop table if exists FLW_RU_BATCH; + +drop index ACT_IDX_ENT_LNK_SCOPE on ACT_RU_ENTITYLINK; +drop index ACT_IDX_ENT_LNK_SCOPE_DEF on ACT_RU_ENTITYLINK; + +drop table if exists ACT_RU_ENTITYLINK; + +drop index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR; +drop index ACT_IDX_EVENT_SUBSCR_SCOPEREF_ on ACT_RU_EVENT_SUBSCR; + +drop table if exists ACT_RU_EVENT_SUBSCR; + +drop index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK; +drop index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK; +drop index ACT_IDX_IDENT_LNK_SCOPE on ACT_RU_IDENTITYLINK; +drop index ACT_IDX_IDENT_LNK_SUB_SCOPE on ACT_RU_IDENTITYLINK; +drop index ACT_IDX_IDENT_LNK_SCOPE_DEF on ACT_RU_IDENTITYLINK; + +drop table if exists ACT_RU_IDENTITYLINK; + +drop index ACT_IDX_JOB_SCOPE on ACT_RU_JOB; +drop index ACT_IDX_JOB_SUB_SCOPE on ACT_RU_JOB; +drop index ACT_IDX_JOB_SCOPE_DEF on ACT_RU_JOB; +drop index ACT_IDX_TJOB_SCOPE on ACT_RU_TIMER_JOB; +drop index ACT_IDX_TJOB_SUB_SCOPE on ACT_RU_TIMER_JOB; +drop index ACT_IDX_TJOB_SCOPE_DEF on ACT_RU_TIMER_JOB; +drop index ACT_IDX_SJOB_SCOPE on ACT_RU_SUSPENDED_JOB; +drop index ACT_IDX_SJOB_SUB_SCOPE on ACT_RU_SUSPENDED_JOB; +drop index ACT_IDX_SJOB_SCOPE_DEF on ACT_RU_SUSPENDED_JOB; +drop index ACT_IDX_DJOB_SCOPE on ACT_RU_DEADLETTER_JOB; +drop index ACT_IDX_DJOB_SUB_SCOPE on ACT_RU_DEADLETTER_JOB; +drop index ACT_IDX_DJOB_SCOPE_DEF on ACT_RU_DEADLETTER_JOB; +drop index ACT_IDX_EJOB_SCOPE on ACT_RU_EXTERNAL_JOB; +drop index ACT_IDX_EJOB_SUB_SCOPE on ACT_RU_EXTERNAL_JOB; +drop index ACT_IDX_EJOB_SCOPE_DEF on ACT_RU_EXTERNAL_JOB; + +alter table ACT_RU_JOB + drop foreign key ACT_FK_JOB_EXCEPTION; + +alter table ACT_RU_JOB + drop foreign key ACT_FK_JOB_CUSTOM_VALUES; + +alter table ACT_RU_TIMER_JOB + drop foreign key ACT_FK_TIMER_JOB_EXCEPTION; + +alter table ACT_RU_TIMER_JOB + drop foreign key ACT_FK_TIMER_JOB_CUSTOM_VALUES; + +alter table ACT_RU_SUSPENDED_JOB + drop foreign key ACT_FK_SUSPENDED_JOB_EXCEPTION; + +alter table ACT_RU_SUSPENDED_JOB + drop foreign key ACT_FK_SUSPENDED_JOB_CUSTOM_VALUES; + +alter table ACT_RU_DEADLETTER_JOB + drop foreign key ACT_FK_DEADLETTER_JOB_EXCEPTION; + +alter table ACT_RU_DEADLETTER_JOB + drop foreign key ACT_FK_DEADLETTER_JOB_CUSTOM_VALUES; + +alter table ACT_RU_EXTERNAL_JOB + drop foreign key ACT_FK_EXTERNAL_JOB_EXCEPTION; + +alter table ACT_RU_EXTERNAL_JOB + drop foreign key ACT_FK_EXTERNAL_JOB_CUSTOM_VALUES; + +drop table if exists ACT_RU_JOB; +drop table if exists ACT_RU_TIMER_JOB; +drop table if exists ACT_RU_SUSPENDED_JOB; +drop table if exists ACT_RU_DEADLETTER_JOB; +drop table if exists ACT_RU_HISTORY_JOB; +drop table if exists ACT_RU_EXTERNAL_JOB; + +drop index ACT_IDX_TASK_CREATE on ACT_RU_TASK; +drop index ACT_IDX_TASK_SCOPE on ACT_RU_TASK; +drop index ACT_IDX_TASK_SUB_SCOPE on ACT_RU_TASK; +drop index ACT_IDX_TASK_SCOPE_DEF on ACT_RU_TASK; + +drop table if exists ACT_RU_TASK; + +alter table ACT_RU_VARIABLE + drop FOREIGN KEY ACT_FK_VAR_BYTEARRAY; + +drop index ACT_IDX_RU_VAR_SCOPE_ID_TYPE on ACT_RU_VARIABLE; +drop index ACT_IDX_RU_VAR_SUB_ID_TYPE on ACT_RU_VARIABLE; + +drop table if exists ACT_RU_VARIABLE; + + drop table if exists ACT_GE_BYTEARRAY; -drop table if exists ACT_GE_PROPERTY; \ No newline at end of file +drop table if exists ACT_GE_PROPERTY; + diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.oracle.drop.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.oracle.drop.common.sql index 5f8ef049b28..96b446825d9 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.oracle.drop.common.sql +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.oracle.drop.common.sql @@ -1,2 +1,119 @@ +drop index FLW_IDX_BATCH_PART; + +drop table FLW_RU_BATCH_PART; +drop table FLW_RU_BATCH; + +drop index ACT_IDX_ENT_LNK_SCOPE; +drop index ACT_IDX_ENT_LNK_SCOPE_DEF; + +drop table ACT_RU_ENTITYLINK; + +drop index ACT_IDX_EVENT_SUBSCR_CONFIG_; +drop index ACT_IDX_EVENT_SUBSCR; +drop index ACT_IDX_EVENT_SUBSCR_SCOPEREF_; + +drop table ACT_RU_EVENT_SUBSCR; + +drop index ACT_IDX_IDENT_LNK_USER; +drop index ACT_IDX_IDENT_LNK_GROUP; +drop index ACT_IDX_IDENT_LNK_SCOPE; +drop index ACT_IDX_IDENT_LNK_SUB_SCOPE; +drop index ACT_IDX_IDENT_LNK_SCOPE_DEF; + +drop table ACT_RU_IDENTITYLINK; + +drop index ACT_IDX_JOB_SCOPE; +drop index ACT_IDX_JOB_SUB_SCOPE; +drop index ACT_IDX_JOB_SCOPE_DEF; +drop index ACT_IDX_TJOB_SCOPE; +drop index ACT_IDX_TJOB_SUB_SCOPE; +drop index ACT_IDX_TJOB_SCOPE_DEF; +drop index ACT_IDX_SJOB_SCOPE; +drop index ACT_IDX_SJOB_SUB_SCOPE; +drop index ACT_IDX_SJOB_SCOPE_DEF; +drop index ACT_IDX_DJOB_SCOPE; +drop index ACT_IDX_DJOB_SUB_SCOPE; +drop index ACT_IDX_DJOB_SCOPE_DEF; +drop index ACT_IDX_EJOB_SCOPE; +drop index ACT_IDX_EJOB_SUB_SCOPE; +drop index ACT_IDX_EJOB_SCOPE_DEF; + +drop index ACT_IDX_JOB_EXCEPTION; +drop index ACT_IDX_JOB_CUSTOM_VAL_ID; +drop index ACT_IDX_JOB_CORRELATION_ID; + +drop index ACT_IDX_TJOB_EXCEPTION; +drop index ACT_IDX_TJOB_CUSTOM_VAL_ID; +drop index ACT_IDX_TJOB_CORRELATION_ID; +drop index ACT_IDX_TJOB_DUEDATE; + +drop index ACT_IDX_SJOB_EXCEPTION; +drop index ACT_IDX_SJOB_CUSTOM_VAL_ID; +drop index ACT_IDX_SJOB_CORRELATION_ID; + +drop index ACT_IDX_DJOB_EXCEPTION; +drop index ACT_IDX_DJOB_CUSTOM_VAL_ID; +drop index ACT_IDX_DJOB_CORRELATION_ID; + +drop index ACT_IDX_EJOB_EXCEPTION; +drop index ACT_IDX_EJOB_CUSTOM_VAL_ID; +drop index ACT_IDX_EJOB_CORRELATION_ID; + +alter table ACT_RU_JOB + drop CONSTRAINT ACT_FK_JOB_EXCEPTION; + +alter table ACT_RU_JOB + drop CONSTRAINT ACT_FK_JOB_CUSTOM_VAL; + +alter table ACT_RU_TIMER_JOB + drop CONSTRAINT ACT_FK_TJOB_EXCEPTION; + +alter table ACT_RU_TIMER_JOB + drop CONSTRAINT ACT_FK_TJOB_CUSTOM_VAL; + +alter table ACT_RU_SUSPENDED_JOB + drop CONSTRAINT ACT_FK_SJOB_EXCEPTION; + +alter table ACT_RU_SUSPENDED_JOB + drop CONSTRAINT ACT_FK_SJOB_CUSTOM_VAL; + +alter table ACT_RU_DEADLETTER_JOB + drop CONSTRAINT ACT_FK_DJOB_EXCEPTION; + +alter table ACT_RU_DEADLETTER_JOB + drop CONSTRAINT ACT_FK_DJOB_CUSTOM_VAL; + +alter table ACT_RU_EXTERNAL_JOB + drop CONSTRAINT ACT_FK_DJOB_EXCEPTION; + +alter table ACT_RU_EXTERNAL_JOB + drop CONSTRAINT ACT_FK_DJOB_CUSTOM_VAL; + +drop table ACT_RU_JOB; +drop table ACT_RU_TIMER_JOB; +drop table ACT_RU_SUSPENDED_JOB; +drop table ACT_RU_DEADLETTER_JOB; +drop table ACT_RU_HISTORY_JOB; +drop table ACT_RU_EXTERNAL_JOB; + + +drop index ACT_IDX_TASK_CREATE; +drop index ACT_IDX_TASK_SCOPE; +drop index ACT_IDX_TASK_SUB_SCOPE; +drop index ACT_IDX_TASK_SCOPE_DEF; + +drop table ACT_RU_TASK; + +drop index ACT_IDX_VAR_BYTEARRAY; +drop index ACT_IDX_RU_VAR_SCOPE_ID_TYPE; +drop index ACT_IDX_RU_VAR_SUB_ID_TYPE; + +alter table ACT_RU_VARIABLE + drop CONSTRAINT ACT_FK_VAR_BYTEARRAY; + +drop table ACT_RU_VARIABLE; + + drop table ACT_GE_BYTEARRAY; -drop table ACT_GE_PROPERTY; \ No newline at end of file +drop table ACT_GE_PROPERTY; + diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.postgres.drop.common.sql b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.postgres.drop.common.sql index 9fd50cba413..743c649600f 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.postgres.drop.common.sql +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/drop/flowable.postgres.drop.common.sql @@ -1,2 +1,26 @@ +drop table if exists FLW_RU_BATCH_PART cascade; +drop table if exists FLW_RU_BATCH cascade; + +drop table if exists ACT_RU_ENTITYLINK cascade; + +drop table if exists ACT_RU_EVENT_SUBSCR cascade; + +drop table if exists ACT_RU_IDENTITYLINK cascade; + +drop table if exists ACT_RU_JOB cascade; +drop table if exists ACT_RU_TIMER_JOB cascade; +drop table if exists ACT_RU_SUSPENDED_JOB cascade; +drop table if exists ACT_RU_DEADLETTER_JOB cascade; +drop table if exists ACT_RU_HISTORY_JOB cascade; +drop table if exists ACT_RU_EXTERNAL_JOB cascade; + +drop table if exists ACT_RU_TASK cascade; + + +drop table if exists ACT_RU_VARIABLE cascade; + + drop table if exists ACT_GE_BYTEARRAY cascade; drop table if exists ACT_GE_PROPERTY cascade; + + diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/mapping/ChangeLog.xml b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/mapping/ChangeLog.xml new file mode 100644 index 00000000000..02c17b226b8 --- /dev/null +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/mapping/ChangeLog.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/mapping/entity/Property.xml b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/mapping/entity/Property.xml index 2c598d5d3c9..b2baff3e0a5 100644 --- a/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/mapping/entity/Property.xml +++ b/modules/flowable-engine-common/src/main/resources/org/flowable/common/db/mapping/entity/Property.xml @@ -77,8 +77,8 @@ - + select VALUE_ from ${prefix}ACT_GE_PROPERTY where NAME_ = #{name, jdbcType=NVARCHAR}