tmerclub/db/2023-11-13 积分、余额记录搬迁到mongodb(看注释).sql
2025-03-20 18:21:13 +08:00

110 lines
6.5 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#
# 1. 2023-11-13 leaf模块.sql id数据要导入
# 2.mongodb连接
# mongodbtmerclub-user.yml加入以下配置
# data:
# mongodb:
# host: 192.168.193.128
# port: 27017
# database: tmerclub
# username: tmerclub
# password: tmerclub
# authentication-database: tmerclub
# 3.
# tmerclub-payment.yml替换以下配置
#
#
# datasource:
# names: ds,ds0,ds1,ds2,ds3,ds4,ds5,ds6,ds7
#
#
# datasource:
# names: ds,ds0,ds1,ds2,ds3,ds4,ds5,ds6,ds7
# ds:
# type: com.zaxxer.hikari.HikariDataSource
# driver-class-name: com.mysql.cj.jdbc.Driver
# jdbc-url: jdbc:mysql://${MYSQL_HOST:192.168.193.128}:${MYSQL_PORT:3306}/${MYSQL_DATABASE:tmerclub_payment}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true&useAffectedRows=true
# username: ${MYSQL_USERNAME:root}
# password: ${MYSQL_PASSWORD:hn02le.34lkdLKD}
# minimum-idle: 0
# maximum-pool-size: 20
# idle-timeout: 25000
# auto-commit: true
# connection-test-query: SELECT 1
#
#
# sharding:
#
#
# sharding:
# default-data-source-name: ds
#
#
# sql后nacos
use tmerclub_nacos;
update config_info set content = REPLACE(content, 'names: ds0,ds1,ds2,ds3,ds4,ds5,ds6,ds7\n', 'names: ds,ds0,ds1,ds2,ds3,ds4,ds5,ds6,ds7\n ds:\n type: com.zaxxer.hikari.HikariDataSource\n driver-class-name: com.mysql.cj.jdbc.Driver\n jdbc-url: jdbc:mysql://${MYSQL_HOST:192.168.193.128}:${MYSQL_PORT:3306}/${MYSQL_DATABASE:tmerclub_payment}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true&useAffectedRows=true\n username: ${MYSQL_USERNAME:root}\n password: ${MYSQL_PASSWORD:hn02le.34lkdLKD}\n minimum-idle: 0\n maximum-pool-size: 20\n idle-timeout: 25000\n auto-commit: true\n connection-test-query: SELECT 1\n') where data_id = 'tmerclub-payment.yml';
update config_info set content = REPLACE(content, 'sharding:\n', 'sharding:\n default-data-source-name: ds\n') where data_id = 'tmerclub-payment.yml';
# 4.search模块增加一个mongodb配置
# tmerclub-search.yml替换以下配置
#
#
# spring:
#
#
# spring:
# data:
# mongodb:
# host: 192.168.193.128
# port: 27017
# database: tmerclub
# username: tmerclub
# password: 'tmerclub'
# authentication-database: tmerclub
#
# sql后nacos
use tmerclub_nacos;
update config_info set content = REPLACE(content, 'spring:\n', 'spring:\n data:\n mongodb:\n host: 192.168.193.128\n port: 27017\n database: tmerclub\n username: tmerclub\n password: tmerclub\n authentication-database: tmerclub\n') where data_id = 'tmerclub-search.yml';
# 5.initScoreAndBalanceLogToMongodb这个定时任务只对2023-11-13(user_score_log)(user_balance_log)mysql之后mongodb
# 使**(mongodb)mysql中user_score_log和user_balance_log删除
# UserScoreLogMapperUserBalanceLogMapper以及相关定时任务代码从代码中删去
USE `tmerclub_job`;
insert into `xxl_job_info`(`job_group`, `job_desc`, `add_time`, `update_time`, `author`, `alarm_email`, `schedule_type`,
`schedule_conf`, `misfire_strategy`, `executor_route_strategy`, `executor_handler`,
`executor_param`, `executor_block_strategy`, `executor_timeout`, `executor_fail_retry_count`,
`glue_type`, `glue_source`, `glue_remark`, `glue_updatetime`, `child_jobid`,
`trigger_status`, `trigger_last_time`, `trigger_next_time`)
values (12, '初始化原有数据库记录至mongodb', '2023-11-02 10:07:30', '2023-11-02 10:07:30', 'admin', '', 'CRON',
'0 0 0 1 1 ? *', 'DO_NOTHING', 'FIRST', 'initScoreAndBalanceLogToMongodb', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN',
'', 'GLUE代码初始化', '2023-11-02 10:07:30', '', 0, 0, 0);
# 6.
USE `tmerclub_user`;
ALTER TABLE `user_extension`
ADD COLUMN `allinpay_create` tinyint(1) DEFAULT 0 COMMENT '是否创建通联会员(0:否1:是)' AFTER `allinpay_actual_balance`;
USE tmerclub_job;
INSERT INTO `xxl_job`.`xxl_job_info`(`job_group`, `job_desc`, `add_time`, `update_time`, `author`, `alarm_email`, `schedule_type`, `schedule_conf`, `misfire_strategy`, `executor_route_strategy`, `executor_handler`, `executor_param`, `executor_block_strategy`, `executor_timeout`, `executor_fail_retry_count`, `glue_type`, `glue_source`, `glue_remark`, `glue_updatetime`, `child_jobid`, `trigger_status`, `trigger_last_time`, `trigger_next_time`)
VALUES
(12, '用户创建通联会员', '2023-11-10 14:30:03', '2023-11-10 14:51:03', 'admin', '', 'CRON', '0 0/10 * * * ? *', 'DO_NOTHING', 'FIRST', 'createAllinpayMember', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化', '2023-11-10 14:30:03', '', 1, 0, 1699599600000);
# 7.
# 8.
#
USE `tmerclub_job`;
insert into `xxl_job_info` (`id`, `job_group`, `job_desc`, `add_time`, `update_time`, `author`, `alarm_email`, `schedule_type`, `schedule_conf`, `misfire_strategy`, `executor_route_strategy`, `executor_handler`, `executor_param`, `executor_block_strategy`, `executor_timeout`, `executor_fail_retry_count`, `glue_type`, `glue_source`, `glue_remark`, `glue_updatetime`, `child_jobid`, `trigger_status`, `trigger_last_time`, `trigger_next_time`) values
('612','11','初始化库存','2023-07-10 09:51:23','2023-11-10 16:38:00','admin','','CRON','0 0 0 1 10 ?','DO_NOTHING','FIRST','intiStock','','SERIAL_EXECUTION','0','0','BEAN','','GLUE代码初始化','2023-07-10 09:51:23','','0','0','0');