Browse Source
Merge pull request #12853 from irynamatveieva/dedicated-datasource
Added cf debug event entity to dedicated events config
pull/12855/head
Viacheslav Klimov
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
3 additions and
2 deletions
-
application/src/main/resources/thingsboard.yml
-
dao/src/main/java/org/thingsboard/server/dao/config/DedicatedEventsJpaDaoConfig.java
|
|
|
@ -817,7 +817,7 @@ spring: |
|
|
|
events: |
|
|
|
# Enable dedicated datasource (a separate database) for events and audit logs. |
|
|
|
# Before enabling this, make sure you have set up the following tables in the new DB: |
|
|
|
# error_event, lc_event, rule_chain_debug_event, rule_node_debug_event, stats_event, audit_log |
|
|
|
# error_event, lc_event, rule_chain_debug_event, rule_node_debug_event, stats_event, audit_log, cf_debug_event |
|
|
|
enabled: "${SPRING_DEDICATED_EVENTS_DATASOURCE_ENABLED:false}" |
|
|
|
# Database driver for Spring JPA for events datasource |
|
|
|
driverClassName: "${SPRING_EVENTS_DATASOURCE_DRIVER_CLASS_NAME:org.postgresql.Driver}" |
|
|
|
|
|
|
|
@ -29,6 +29,7 @@ import org.springframework.orm.jpa.JpaTransactionManager; |
|
|
|
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; |
|
|
|
import org.springframework.transaction.support.TransactionTemplate; |
|
|
|
import org.thingsboard.server.dao.model.sql.AuditLogEntity; |
|
|
|
import org.thingsboard.server.dao.model.sql.CalculatedFieldDebugEventEntity; |
|
|
|
import org.thingsboard.server.dao.model.sql.ErrorEventEntity; |
|
|
|
import org.thingsboard.server.dao.model.sql.LifecycleEventEntity; |
|
|
|
import org.thingsboard.server.dao.model.sql.RuleChainDebugEventEntity; |
|
|
|
@ -68,7 +69,7 @@ public class DedicatedEventsJpaDaoConfig { |
|
|
|
EntityManagerFactoryBuilder builder) { |
|
|
|
return builder |
|
|
|
.dataSource(eventsDataSource) |
|
|
|
.packages(LifecycleEventEntity.class, StatisticsEventEntity.class, ErrorEventEntity.class, RuleNodeDebugEventEntity.class, RuleChainDebugEventEntity.class, AuditLogEntity.class) |
|
|
|
.packages(LifecycleEventEntity.class, StatisticsEventEntity.class, ErrorEventEntity.class, RuleNodeDebugEventEntity.class, RuleChainDebugEventEntity.class, AuditLogEntity.class, CalculatedFieldDebugEventEntity.class) |
|
|
|
.persistenceUnit(EVENTS_PERSISTENCE_UNIT) |
|
|
|
.build(); |
|
|
|
} |
|
|
|
|