Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wangrui1573 opened this issue Sep 18, 2024 · 2 comments
Open

Comments

@wangrui1573
Copy link

wangrui1573 commented Sep 18, 2024

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
Copy link

ritaswc commented Sep 27, 2024

我也是这样报错

@ritaswc
Copy link

ritaswc commented Sep 29, 2024

找源码,发现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事件表';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants