Ошибка после обновления Camunda 7 (column "create_time_" of relation "act_ru_ext_task" does not exist)

После обновления Camunda 7 (7.20 → 7.21, СУБД PostgreSQL) при создании External Task возникает ошибка:

2024-07-26T20:49:03.281Z WARN 1 --- [nio-8080-exec-1] org.camunda.bpm.engine.rest.exception : ENGINE-REST-HTTP500 org.camunda.bpm.engine.ProcessEnginePersistenceException: An exception occurred in the persistence layer. Please check the server logs for a detailed message and the entire exception stack trace.

Caused by: org.camunda.bpm.engine.ProcessEngineException: ENGINE-03004 Exception while executing Database Operation 'INSERT ExternalTaskEntity[7de92607-4b90-11ef-9c45-0242ac120007]' with message '
### Error flushing statements.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.ExternalTaskEntity.insertExternalTask (batch index #4) failed. 3 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Batch entry 0 insert into ACT_RU_EXT_TASK (
      ID_,
      WORKER_ID_,
      TOPIC_NAME_,
      LOCK_EXP_TIME_,
      CREATE_TIME_,
      RETRIES_,
      ERROR_MSG_,
      ERROR_DETAILS_ID_,
      SUSPENSION_STATE_,
      EXECUTION_ID_,
      PROC_INST_ID_,
      PROC_DEF_ID_,
      PROC_DEF_KEY_,
      ACT_ID_,
      ACT_INST_ID_,
      TENANT_ID_,
      PRIORITY_,
      LAST_FAILURE_LOG_ID_,
      REV_
    ) values (
      ('7de92607-4b90-11ef-9c45-0242ac120007'),
      (NULL),
      ('changeState'),
      (NULL),
      ('2024-07-26 20:49:03.158+00'),
      (NULL),
      (NULL),
      (NULL),
      ('1'::int4),
      ('7de52e65-4b90-11ef-9c45-0242ac120007'),
      ('b1039800-4a70-11ef-9ff7-0242ac120008'),
      ('simpleFlow:1:045f2be5-b91d-11ee-8fa8-0242ac120005'),
      ('simpleFlow'),
      ('inProgress'),
      ('inProgress:7de55576-4b90-11ef-9c45-0242ac120007'),
      (NULL),
      ('0'::int8),
      (NULL),
      1
    ) was aborted: ERROR: column "create_time_" of relation "act_ru_ext_task" does not exist
  Position: 107  Call getNextException to see other errors in the batch.
введите или вставьте сюда код

РЕШЕНИЕ:

Выполнить скрипт обновления базы из дистрибутива Camunda 7 Run:

psql -h <hostname> -d <db_name> < configuration/sql/upgrade/postgres_engine_7.20_to_7.21.sql

или выполнить запросы, содержащиеся в скрипте вручную:

insert into ACT_GE_SCHEMA_LOG
values ('1000', CURRENT_TIMESTAMP, '7.21.0');

alter table ACT_RU_EXT_TASK
  add column CREATE_TIME_ timestamp;

alter table ACT_RU_JOB
  add column ROOT_PROC_INST_ID_ varchar(64);

create index ACT_IDX_JOB_ROOT_PROCINST on ACT_RU_JOB(ROOT_PROC_INST_ID_);