TDuckCloud / tduck-platform

为企业提供「免费」表单问卷能力,「开箱即用」快速赋能业务 A questionnaire system that can be privatized and deployed - 填鸭表单问卷系统(tduck-survey-form)
https://www.tduckcloud.com
MIT License
1.04k stars 139 forks source link

点击问卷设置报错 Table 'tduck.webhook_config' doesn't exist #24

Open wangrui1573 opened 2 months ago

wangrui1573 commented 2 months ago

tduck.webhook_config 表不存在,在init的SQL中也未发现此表的创建语句

使用docker compose 方式启动的

### Error querying database. Cause: java.sql.SQLSyntaxErrorException: Table 'tduck.webhook_config' doesn't exist ### The error may exist in com/tduck/cloud/webhook/mapper/WebhookConfigMapper.java (best guess) ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: SELECT id,hook_name,source_type,source_id,url,request_type,enabled,other_options,create_time,update_time FROM webhook_config WHERE (source_type = ? AND source_id = ?) ### Cause: java.sql.SQLSyntaxErrorException: Table 'tduck.webhook_config' doesn't exist ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Table 'tduck.webhook_config' doesn't exist

ritaswc commented 2 months ago

我也是这样报错

ritaswc commented 1 month ago

找源码,发现v5的sql文件中 有这个


DROP TABLE IF EXISTS `webhook_config`;
CREATE TABLE `webhook_config`
(
    `id`            bigint                                                        NOT NULL AUTO_INCREMENT COMMENT '主键ID',
    `hook_name`     varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci           DEFAULT NULL COMMENT 'Webhook配置名称',
    `source_type`   varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  NOT NULL COMMENT '配置的来源类型',
    `source_id`     varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源Id',
    `url`           varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Webhook的URL地址',
    `request_type`  varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  NOT NULL COMMENT 'Webhook请求类型,如POST、GET等',
    `enabled`       tinyint(1) NOT NULL COMMENT '是否启用',
    `other_options` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '其他Webhook配置,例如请求头等。以JSON格式存储',
    `create_time`   timestamp                                                     NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time`   timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    KEY             `source_type` (`source_type`,`source_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=64 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='Webhook配置表';

DROP TABLE IF EXISTS `webhook_event`;
CREATE TABLE `webhook_event`
(
    `id`                bigint                                                        NOT NULL AUTO_INCREMENT COMMENT '主键ID',
    `webhook_config_id` bigint                                                        NOT NULL COMMENT '关联的Webhook配置ID',
    `source_id`         varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源的数据Id',
    `event_type`        varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  NOT NULL COMMENT 'Webhook事件类型',
    `event_data`        text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Webhook事件数据',
    `status`            varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  NOT NULL COMMENT 'Webhook事件状态,如pending、success、failed等',
    `retry_times`       int                                                           NOT NULL DEFAULT '0' COMMENT 'Webhook事件重试次数',
    `last_error`        text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Webhook事件最后一次错误信息',
    `create_time`       timestamp                                                     NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time`       timestamp                                                     NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=146 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='Webhook事件表';