【问题标题】:Camunda spring boot starter : create database in schema not workingCamunda spring boot starter:在模式中创建数据库不起作用
【发布时间】:2016-12-06 06:33:18
【问题描述】:

我使用了 camunda spring boot 启动项目 (1.3.0) 来启动我的 camunda 引擎和其余的 api。

在我的 application.yml 中,我试图让 camunda 在某个架构中为我创建数据库对象。

以下设置创建 db 对象...

camunda.bpm:
  database:
   schema-update: create-drop
   type: postgres  
   table-prefix: my_schema.
spring.datasource:
  url: "jdbc:postgresql://localhost:5432/mydb"
  username: myuser
  password: myuser
  driverClassName: org.postgresql.Driver

但问题是表是在公共模式中创建的。我想要做的是添加一个等于“my_schema”的表前缀。

是我错误地使用了这个设置还是我遗漏了什么?

谢谢

【问题讨论】:

  • 在普通的 Camunda(没有 spring boot 启动器)中,如果引擎使用默认模式,它只能自动正确地创建表。使用自定义模式和表前缀时,应手动应用创建脚本。我不知道 Spring Boot 启动器是否提供任何东西,但我想它没有。
  • 是否有反对仅在属性“camunda.bpm.database.schema-name”给出的模式中创建表的论据?为什么 Camunda 团队决定反对这种方法,@thorben?

标签: business-process-management camunda


【解决方案1】:

使用

camunda:
  bpm:
    admin-user:
      id: ${CM_ADMIN_USR:admin}
      password: ${CM_ADMIN_PWD:admin}
    database:
      schema-update: false
      schema-name: camunda
      table-prefix: camunda.

参考:

https://github.com/camunda/camunda-docs-manual/blob/master/content/user-guide/spring-boot-integration/configuration.md

【讨论】:

    【解决方案2】:

    Thorben 是对的:目前,camunda spring boot 使用正常的数据库设置。因此,如果(我实际上从未检查过) table_prefix 不受支持,则不能将其与 spring boot 一起使用。

    我创建了一个要删除的问题:https://github.com/camunda/camunda-bpm-spring-boot-starter/issues/177

    【讨论】:

      【解决方案3】:

      我通过提供模式名称作为数据源 URL 的后缀解决了这个问题

      喜欢:

      url: "jdbc:postgresql://localhost:5432/mydb?currentSchema=my_schema"
      

      因此应该在指定的架构下创建表。

      【讨论】:

        猜你喜欢
        • 2020-05-21
        • 1970-01-01
        • 2023-04-02
        • 1970-01-01
        • 2017-03-23
        • 2018-12-24
        • 1970-01-01
        • 2014-07-05
        相关资源
        最近更新 更多