Skip to content

Commit

Permalink
[Bug] Fix TriggerRelationMapper cannot work due to miss DatabaseIdPro…
Browse files Browse the repository at this point in the history
…vider (#15153)
  • Loading branch information
mind-echo authored Nov 17, 2023
1 parent d6175f3 commit 36f7205
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
import org.apache.dolphinscheduler.dao.plugin.api.dialect.DatabaseDialect;
import org.apache.dolphinscheduler.dao.plugin.api.monitor.DatabaseMonitor;

import org.apache.ibatis.mapping.DatabaseIdProvider;
import org.apache.ibatis.mapping.VendorDatabaseIdProvider;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
Expand Down Expand Up @@ -61,6 +64,11 @@ public MybatisPlusInterceptor paginationInterceptor(DbType dbType) {
return interceptor;
}

@Bean
public DatabaseIdProvider databaseIdProvider() {
return new VendorDatabaseIdProvider();
}

@Bean
public DbType dbType() {
return daoPluginConfiguration.dbType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
ON DUPLICATE KEY UPDATE update_time = #{triggerRelation.updateTime};
</insert>

<insert id="upsert" databaseId="pg">
<insert id="upsert" databaseId="PostgreSQL">
INSERT INTO t_ds_trigger_relation (trigger_code, trigger_type, job_id, create_time, update_time) VALUES(
#{triggerRelation.triggerCode},#{triggerRelation.triggerType},#{triggerRelation.jobId},#{triggerRelation.createTime},#{triggerRelation.updateTime})
ON CONFLICT(trigger_type,job_id,trigger_code) DO UPDATE SET update_time = #{triggerRelation.updateTime};
Expand Down

0 comments on commit 36f7205

Please sign in to comment.