Browse Source

[Fix-14049][dao] fix init sql and use on conflict do update in pg (#14051)

3.2.0-release
eye-gu 2 years ago committed by GitHub
parent
commit
cfbf675737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TriggerRelationMapper.xml
  2. 3
      dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql

6
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TriggerRelationMapper.xml

@ -52,4 +52,10 @@
#{triggerRelation.triggerCode},#{triggerRelation.triggerType},#{triggerRelation.jobId},#{triggerRelation.createTime},#{triggerRelation.updateTime}) #{triggerRelation.triggerCode},#{triggerRelation.triggerType},#{triggerRelation.jobId},#{triggerRelation.createTime},#{triggerRelation.updateTime})
ON DUPLICATE KEY UPDATE update_time = #{triggerRelation.updateTime}; ON DUPLICATE KEY UPDATE update_time = #{triggerRelation.updateTime};
</insert> </insert>
<insert id="upsert" databaseId="pg">
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};
</insert>
</mapper> </mapper>

3
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql

@ -321,6 +321,7 @@ CREATE TABLE t_ds_error_command (
message text , message text ,
process_instance_id int DEFAULT 0, process_instance_id int DEFAULT 0,
process_definition_version int DEFAULT 0, process_definition_version int DEFAULT 0,
test_flag int DEFAULT NULL ,
PRIMARY KEY (id) PRIMARY KEY (id)
); );
@ -981,7 +982,7 @@ VALUES ('admin', '7ad2410b2f4c074479a8937a28a22b8f', '0', 'xxx@qq.com', '', '-1'
-- Records of t_ds_tenant -- Records of t_ds_tenant
INSERT INTO t_ds_tenant(id, tenant_code, description, queue_id, create_time, update_time) INSERT INTO t_ds_tenant(id, tenant_code, description, queue_id, create_time, update_time)
VALUES (-1, 'default', 'default tenant', '0', '2018-03-27 15:48:50', '2018-10-24 17:40:22'); VALUES (-1, 'default', 'default tenant', '1', '2018-03-27 15:48:50', '2018-10-24 17:40:22');
-- Records of t_ds_alertgroup, default admin warning group -- Records of t_ds_alertgroup, default admin warning group
INSERT INTO t_ds_alertgroup(alert_instance_ids, create_user_id, group_name, description, create_time, update_time) INSERT INTO t_ds_alertgroup(alert_instance_ids, create_user_id, group_name, description, create_time, update_time)

Loading…
Cancel
Save