cs_dsy.sql 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. drop table if exists `cs_report_datasource`;
  2. CREATE TABLE `cs_report_datasource` (
  3. `id` int NOT NULL AUTO_INCREMENT COMMENT '主键自增',
  4. `tenant_id` varchar(12) DEFAULT NULL COMMENT '租户id',
  5. `ds_name` varchar(50) not null comment '连接名,用于显示',
  6. `ds_ip` varchar(50) DEFAULT NULL COMMENT 'ip地址',
  7. `ds_port` int DEFAULT NULL COMMENT '端口',
  8. `ds_db` varchar(50) DEFAULT NULL COMMENT '数据库名/influxdbV2-org',
  9. `ds_url` varchar(300) DEFAULT NULL COMMENT '连接url',
  10. `ds_user` varchar(50) DEFAULT NULL COMMENT '用户名',
  11. `ds_password` varchar(50) DEFAULT NULL COMMENT '数据库密码',
  12. `ds_type` int DEFAULT NULL COMMENT '数据源类型 0-mysql 1-es 2-influxdb',
  13. `flux_token` varchar(100) comment 'fluxV2版本的token值/userpass任选其一',
  14. `flux_v2_status` tinyint not null default 0 comment 'influxdb是否fluxV2版本',
  15. `remark` varchar(200) DEFAULT NULL COMMENT '备注',
  16. `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  17. `create_user_id` bigint DEFAULT NULL COMMENT '创建人ID',
  18. PRIMARY KEY (`id`)
  19. ) comment '定制的数据源表';
  20. drop table if exists `cs_dsy_job`;
  21. CREATE TABLE `cs_dsy_job` (
  22. `id` int NOT NULL AUTO_INCREMENT,
  23. `tenant_id` varchar(12) NOT NULL COMMENT '租户ID',
  24. `category_id` int NOT NULL COMMENT '分类ID',
  25. `job_name` varchar(100) NOT NULL COMMENT '任务名称',
  26. `job_desc` varchar(500) DEFAULT NULL COMMENT '任务描述',
  27. `job_status` tinyint NOT NULL COMMENT '上线状态',
  28. `trigger_status` tinyint NOT NULL DEFAULT '0' COMMENT '调度状态',
  29. `job_cron` varchar(20) DEFAULT NULL COMMENT 'xxljob的任务Cron',
  30. `xxl_job_id` int DEFAULT NULL COMMENT 'xxljob的任务ID',
  31. `source_ds_id` int NOT NULL COMMENT '输入数据源ID',
  32. `source_ds_type` tinyint DEFAULT NULL COMMENT '输入数据源类型',
  33. `source_table_name` varchar(100) NOT NULL COMMENT '输入数据源表名',
  34. `target_ds_id` int NOT NULL COMMENT '目标数据源ID',
  35. `target_ds_type` tinyint DEFAULT NULL COMMENT '目标数据源类型',
  36. `target_table_name` varchar(100) NOT NULL COMMENT '目标数据源表名',
  37. `query_sql` longtext NOT NULL COMMENT '输入数据源的查询SQL',
  38. `column_json` text comment '字段映射json数组',
  39. `public_status` tinyint NOT NULL DEFAULT '0' COMMENT '公开状态(0-不公开/1-公开)',
  40. `create_time` datetime NOT NULL COMMENT '创建时间',
  41. `create_user_id` bigint NOT NULL COMMENT '创建人ID',
  42. `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
  43. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  44. `update_user_id` bigint DEFAULT NULL COMMENT '更新人ID',
  45. `update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
  46. PRIMARY KEY (`id`)
  47. ) COMMENT='定制的数据同步任务';
  48. drop table if exists `cs_dsy_job_category`;
  49. CREATE TABLE `cs_dsy_job_category` (
  50. `id` int NOT NULL AUTO_INCREMENT,
  51. `tenant_id` varchar(12) NOT NULL COMMENT '租户ID',
  52. `cate_name` varchar(50) NOT NULL COMMENT '分类名称',
  53. `parent_id` int NOT NULL DEFAULT '0' COMMENT '父级ID',
  54. `sort_num` int NOT NULL DEFAULT '0' COMMENT '排序号',
  55. `create_time` datetime NOT NULL COMMENT '创建时间',
  56. `create_user_id` bigint NOT NULL COMMENT '创建人ID',
  57. `create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
  58. PRIMARY KEY (`id`)
  59. ) COMMENT='定制的数据同步任务分类';
  60. drop table if exists `cs_dsy_job_instance`;
  61. CREATE TABLE `cs_dsy_job_instance` (
  62. `id` int NOT NULL AUTO_INCREMENT,
  63. `tenant_id` varchar(12) NOT NULL COMMENT '租户ID',
  64. `job_id` int NOT NULL COMMENT '任务ID',
  65. `start_time` datetime DEFAULT NULL COMMENT '作业开始时间',
  66. `end_time` datetime DEFAULT NULL COMMENT '作业结束时间',
  67. `instance_run_type` tinyint NOT NULL COMMENT '作业运行类型(手动 自动)',
  68. `instance_status` tinyint NOT NULL COMMENT '作业状态',
  69. `err_msg` longtext COMMENT '错误描述',
  70. `read_row_count` bigint NOT NULL DEFAULT '0' COMMENT '读取行数',
  71. `write_row_count` bigint NOT NULL DEFAULT '0' COMMENT '写入行数',
  72. `error_row_count` bigint NOT NULL DEFAULT '0' COMMENT '错误行数',
  73. `source_table_name` varchar(100) DEFAULT NULL COMMENT '输入数据源表名',
  74. `target_table_name` varchar(100) DEFAULT NULL COMMENT '目标数据源表名',
  75. `create_time` datetime NOT NULL COMMENT '任务创建时间',
  76. PRIMARY KEY (`id`) USING BTREE,
  77. KEY `job_id` (`job_id`)
  78. ) COMMENT='定制的数据同步任务实例';
  79. drop table if exists `cs_dsy_job_permission`;
  80. CREATE TABLE `cs_dsy_job_permission` (
  81. `id` int NOT NULL AUTO_INCREMENT,
  82. `job_id` int NOT NULL COMMENT '任务ID',
  83. `data_perm_id` int NOT NULL COMMENT '权限组ID',
  84. `create_time` datetime NOT NULL COMMENT '创建时间',
  85. `create_user_id` bigint NOT NULL COMMENT '创建人ID',
  86. `create_by` varchar(50) NOT NULL COMMENT '创建人',
  87. PRIMARY KEY (`id`)
  88. ) COMMENT='定制的数据同步任务权限组';