How to specify tablespaces and prefix for table names in apache activiti

Viewed 341

I'm using activiti in my Spring Boot application: 'org.activiti:activiti-spring-boot-starter:7.1.0.M3.1'. By default, all activiti tables are contained in Spring Boot App database schema - Oracle 12.2 in my case. All activiti table names start with 'ACT_' prefix and all this tables and its indexes are in default 'USERS' tablespace.

Is it possible to specify additional prefix for activiti tables? For example I want to add 'FOO_' prefix to all activiti tables, then 'ACT_RE_MODEL' will be 'FOO_ACT_RE_MODEL'.

How can I specify tablespace 'INDX' to make activiti create indexes in different tablespace, not in 'USERS'?

2 Answers

If you are using Activiti 5 or 6 it uses MyBatis as the ORM. In order to update the standard table names and indexes, you will need to modify the mybatis mappings under activiti-engine/src/main/resources/org/activiti/db)

You will also need to update the create and drop sql files (under the same folder)

Obviously this will create an upgrade issue, but I'm sure you already appreciate that.

You probably don't want to use the USERS tablespace for anything related to your application. Instead of trying to customize the tablespace per-object, it's usually simpler to just set a default tablespace for the entire schema, like this:

alter user app_schema default tablespace schema_tablespace;
Related