修复指尖管理师上线配置
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
-- 1. 首次部署空库时,只需要执行本文件即可完成基础建表、结构补丁、权限种子、基础参数、协议、MessageHub、VIP 规则与管理员初始化。
|
||||
-- 2. 2026-03-20_user_asset_vip_coupon_permission_patch.sql、2026-03-25_user_shop_binding_and_shop_status_patch.sql、
|
||||
-- 2026-03-20_init_admin_permission_template.sql 仍保留用于已有数据库的增量升级,不再作为空库首选入口。
|
||||
-- 3. 当前 Nacos datasource.yaml 指向 nailart,本文件默认按该库名初始化;如果你的实际数据库名不同,请先统一 datasource 与下方库名。
|
||||
-- 3. 当前 Nacos datasource.yaml 必须指向 FingertipDesigner,本文件默认按该库名初始化;Linux MySQL 环境下库名大小写敏感,请先统一 datasource 与下方库名。
|
||||
-- 4. 本文件只初始化一个平台管理员 xiaowang(默认密码 888888),不写入开发/验收用户、门店、作品、标签、订单、消息公告等业务数据。
|
||||
CREATE DATABASE IF NOT EXISTS nailart DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
use nailart;
|
||||
CREATE DATABASE IF NOT EXISTS FingertipDesigner DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
use FingertipDesigner;
|
||||
|
||||
-- auto-generated definition
|
||||
create table t_balance
|
||||
@@ -272,36 +272,38 @@ create index idx_t_nail_artist_info_participate
|
||||
-- auto-generated definition
|
||||
create table t_object_storage_file
|
||||
(
|
||||
id bigint unsigned auto_increment comment '文件记录唯一主键ID(雪花ID)'
|
||||
primary key comment '对象存储文件主键索引',
|
||||
file_name varchar(100) not null comment '文件名称',
|
||||
file_url text not null comment '文件访问链接',
|
||||
object_name varchar(512) null comment '对象存储Key',
|
||||
minio_url text null comment 'MinIO访问链接',
|
||||
oss_url text null comment '阿里云OSS内部备份链接',
|
||||
content_type varchar(128) null comment '文件Content-Type',
|
||||
file_size bigint unsigned null comment '文件大小,单位字节',
|
||||
minio_upload_status tinyint unsigned default 0 not null comment 'MinIO上传状态:0-PENDING,1-SUCCEEDED,2-FAILED',
|
||||
oss_upload_status tinyint unsigned default 0 not null comment 'OSS上传状态:0-PENDING,1-SUCCEEDED,2-FAILED',
|
||||
oss_retry_count int unsigned default 0 not null comment 'OSS备份重试次数',
|
||||
oss_last_error varchar(500) null comment '最近一次OSS备份失败原因',
|
||||
oss_uploaded_at datetime null comment 'OSS备份成功时间',
|
||||
oss_last_retry_time datetime null comment '最近一次OSS备份重试时间',
|
||||
create_time datetime default CURRENT_TIMESTAMP not null comment '文件上传时间',
|
||||
update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '文件更新时间',
|
||||
status tinyint unsigned default 1 null comment '文件状态:1-可用,0-不可用,2-回收站',
|
||||
delete_time datetime null comment '文件删除时间(NULL表示未删除)',
|
||||
recycle_time datetime null comment '文件移入回收站时间(NULL表示未移入)'
|
||||
id bigint unsigned auto_increment comment '????ID'
|
||||
primary key comment '????????',
|
||||
file_name varchar(100) not null comment '????',
|
||||
file_url text not null comment '??????',
|
||||
object_name varchar(512) null comment '????Key',
|
||||
primary_provider varchar(64) null comment '??????',
|
||||
primary_url text null comment '???????',
|
||||
backup_provider varchar(64) null comment '???????',
|
||||
backup_url text null comment '????????',
|
||||
content_type varchar(128) null comment '??Content-Type',
|
||||
file_size bigint unsigned null comment '?????????',
|
||||
primary_upload_status tinyint unsigned default 0 not null comment '????????0????1???2??',
|
||||
backup_upload_status tinyint unsigned default 0 not null comment '?????????0????1???2??',
|
||||
backup_retry_count int unsigned default 0 not null comment '??????',
|
||||
backup_last_error varchar(500) null comment '??????????',
|
||||
backup_uploaded_at datetime null comment '??????',
|
||||
backup_last_retry_time datetime null comment '??????????',
|
||||
create_time datetime default CURRENT_TIMESTAMP not null comment '??????',
|
||||
update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '??????',
|
||||
status tinyint unsigned default 1 null comment '?????1???0????2???',
|
||||
delete_time datetime null comment '??????',
|
||||
recycle_time datetime null comment '?????????'
|
||||
)
|
||||
comment '对象存储文件信息表';
|
||||
comment '?????????';
|
||||
|
||||
create index idx_status
|
||||
on t_object_storage_file (status)
|
||||
comment '按文件状态查询的索引';
|
||||
comment '??????';
|
||||
|
||||
create index idx_object_storage_file_oss_retry
|
||||
on t_object_storage_file (oss_upload_status, minio_upload_status, status)
|
||||
comment 'OSS备份失败重试扫描索引';
|
||||
create index idx_object_storage_file_backup_retry
|
||||
on t_object_storage_file (backup_upload_status, primary_upload_status, status)
|
||||
comment '????????';
|
||||
|
||||
-- auto-generated definition
|
||||
create table t_order
|
||||
@@ -568,6 +570,10 @@ create table t_user
|
||||
nickname varchar(50) not null comment '用户昵称',
|
||||
account varchar(50) not null comment '用户账号(登录用)',
|
||||
phone varchar(50) null comment '手机号',
|
||||
contact_phone varchar(50) null comment '联系电话',
|
||||
birthday date null comment '生日',
|
||||
wechat_id varchar(100) null comment '微信号',
|
||||
wechat_qr_code varchar(512) null comment '微信二维码',
|
||||
email varchar(100) null comment '邮箱',
|
||||
phone_verified tinyint unsigned default 0 null comment '手机号是否已验证:0-未验证,1-已验证',
|
||||
email_verified tinyint unsigned default 0 null comment '邮箱是否已验证:0-未验证,1-已验证',
|
||||
@@ -935,25 +941,28 @@ CALL sp_add_column_if_not_exists('t_balance', 'total_recharge_amount', 'decimal(
|
||||
CALL sp_add_column_if_not_exists('t_balance', 'last_recharge_time', 'datetime NULL COMMENT ''最近一次充值时间''');
|
||||
CALL sp_add_column_if_not_exists('t_balance', 'update_time', 'datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ''更新时间''');
|
||||
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'object_name', 'varchar(512) NULL COMMENT ''对象存储Key''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'minio_url', 'text NULL COMMENT ''MinIO访问链接''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'oss_url', 'text NULL COMMENT ''阿里云OSS内部备份链接''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'content_type', 'varchar(128) NULL COMMENT ''文件Content-Type''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'file_size', 'bigint unsigned NULL COMMENT ''文件大小,单位字节''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'minio_upload_status', 'tinyint unsigned NOT NULL DEFAULT 0 COMMENT ''MinIO上传状态:0-PENDING,1-SUCCEEDED,2-FAILED''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'oss_upload_status', 'tinyint unsigned NOT NULL DEFAULT 0 COMMENT ''OSS上传状态:0-PENDING,1-SUCCEEDED,2-FAILED''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'oss_retry_count', 'int unsigned NOT NULL DEFAULT 0 COMMENT ''OSS备份重试次数''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'oss_last_error', 'varchar(500) NULL COMMENT ''最近一次OSS备份失败原因''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'oss_uploaded_at', 'datetime NULL COMMENT ''OSS备份成功时间''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'oss_last_retry_time', 'datetime NULL COMMENT ''最近一次OSS备份重试时间''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'object_name', 'varchar(512) NULL COMMENT ''????Key''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'primary_provider', 'varchar(64) NULL COMMENT ''??????''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'primary_url', 'text NULL COMMENT ''???????''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'backup_provider', 'varchar(64) NULL COMMENT ''???????''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'backup_url', 'text NULL COMMENT ''????????''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'content_type', 'varchar(128) NULL COMMENT ''??Content-Type''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'file_size', 'bigint unsigned NULL COMMENT ''?????????''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'primary_upload_status', 'tinyint unsigned NOT NULL DEFAULT 0 COMMENT ''????????0????1???2??''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'backup_upload_status', 'tinyint unsigned NOT NULL DEFAULT 0 COMMENT ''?????????0????1???2??''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'backup_retry_count', 'int unsigned NOT NULL DEFAULT 0 COMMENT ''??????''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'backup_last_error', 'varchar(500) NULL COMMENT ''??????????''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'backup_uploaded_at', 'datetime NULL COMMENT ''??????''');
|
||||
CALL sp_add_column_if_not_exists('t_object_storage_file', 'backup_last_retry_time', 'datetime NULL COMMENT ''??????????''');
|
||||
UPDATE t_object_storage_file
|
||||
SET minio_url = COALESCE(minio_url, file_url),
|
||||
minio_upload_status = CASE WHEN minio_upload_status IS NULL OR minio_upload_status = 0 THEN 1 ELSE minio_upload_status END,
|
||||
oss_upload_status = COALESCE(oss_upload_status, 0),
|
||||
oss_retry_count = COALESCE(oss_retry_count, 0)
|
||||
SET primary_provider = COALESCE(primary_provider, 'QINIU_KODO'),
|
||||
primary_url = COALESCE(primary_url, file_url),
|
||||
backup_provider = COALESCE(backup_provider, 'ALIYUN_OSS'),
|
||||
primary_upload_status = CASE WHEN primary_upload_status IS NULL OR primary_upload_status = 0 THEN 1 ELSE primary_upload_status END,
|
||||
backup_upload_status = COALESCE(backup_upload_status, 0),
|
||||
backup_retry_count = COALESCE(backup_retry_count, 0)
|
||||
WHERE status = 1;
|
||||
CALL sp_add_index_if_not_exists('t_object_storage_file', 'idx_object_storage_file_oss_retry', '(`oss_upload_status`, `minio_upload_status`, `status`)');
|
||||
|
||||
CALL sp_add_index_if_not_exists('t_object_storage_file', 'idx_object_storage_file_backup_retry', '(`backup_upload_status`, `primary_upload_status`, `status`)');
|
||||
UPDATE t_balance
|
||||
SET total_recharge_amount = COALESCE(total_recharge_amount, 0.00)
|
||||
WHERE total_recharge_amount IS NULL;
|
||||
@@ -968,6 +977,11 @@ CALL sp_add_column_if_not_exists('t_balance_change_detail', 'operator_id', 'bigi
|
||||
CALL sp_add_column_if_not_exists('t_balance_change_detail', 'remark', 'varchar(255) NULL COMMENT ''备注''');
|
||||
CALL sp_add_column_if_not_exists('t_login_identity', 'create_time', 'datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ''创建时间''');
|
||||
|
||||
CALL sp_add_column_if_not_exists('t_user', 'contact_phone', 'varchar(50) NULL COMMENT ''联系电话''');
|
||||
CALL sp_add_column_if_not_exists('t_user', 'birthday', 'date NULL COMMENT ''生日''');
|
||||
CALL sp_add_column_if_not_exists('t_user', 'wechat_id', 'varchar(100) NULL COMMENT ''微信号''');
|
||||
CALL sp_add_column_if_not_exists('t_user', 'wechat_qr_code', 'varchar(512) NULL COMMENT ''微信二维码''');
|
||||
|
||||
UPDATE t_balance_change_detail
|
||||
SET before_balance = COALESCE(before_balance, current_balance - amount),
|
||||
after_balance = COALESCE(after_balance, current_balance),
|
||||
@@ -1712,6 +1726,36 @@ ON DUPLICATE KEY UPDATE
|
||||
is_delete = 0,
|
||||
update_time = NOW();
|
||||
|
||||
CALL sp_add_column_if_not_exists('t_order', 'customer_remark', 'varchar(500) NULL COMMENT ''用户询价预约备注''');
|
||||
CALL sp_add_column_if_not_exists('t_order', 'quote_status', 'varchar(32) NULL COMMENT ''报价状态:CONFIRMING/CONFIRMED/EXPIRED''');
|
||||
CALL sp_add_column_if_not_exists('t_order', 'quote_user_confirmed', 'tinyint unsigned NOT NULL DEFAULT 0 COMMENT ''用户是否确认当前报价''');
|
||||
CALL sp_add_column_if_not_exists('t_order', 'quote_shop_confirmed', 'tinyint unsigned NOT NULL DEFAULT 0 COMMENT ''店长是否确认当前报价''');
|
||||
CALL sp_add_column_if_not_exists('t_order', 'quote_expire_time', 'datetime NULL COMMENT ''询价报价过期时间''');
|
||||
CALL sp_add_column_if_not_exists('t_order', 'quote_confirmed_time', 'datetime NULL COMMENT ''双方确认报价时间''');
|
||||
CALL sp_add_index_if_not_exists('t_order', 'idx_t_order_quote_status_expire', '(`quote_status`, `quote_expire_time`)');
|
||||
|
||||
CALL sp_add_column_if_not_exists('t_order_item', 'reference_price', 'decimal(10,2) NULL COMMENT ''作品参考价快照''');
|
||||
CALL sp_add_column_if_not_exists('t_order_item', 'quoted_price', 'decimal(10,2) NULL COMMENT ''当前报价''');
|
||||
CALL sp_add_column_if_not_exists('t_order_item', 'confirmed_price', 'decimal(10,2) NULL COMMENT ''最终确认价''');
|
||||
|
||||
CREATE TABLE IF NOT EXISTS t_order_quote_message
|
||||
(
|
||||
id bigint unsigned auto_increment comment '报价交互消息主键'
|
||||
primary key,
|
||||
order_id bigint unsigned not null comment '订单ID',
|
||||
actor_id bigint unsigned null comment '操作人ID',
|
||||
actor_type varchar(32) not null comment '操作人类型:USER/SHOP/SYSTEM',
|
||||
action varchar(32) not null comment '动作:CREATE/SHOP_QUOTE/USER_REPLY/USER_CONFIRM/SHOP_CONFIRM/SYSTEM_CONFIRM/SYSTEM_EXPIRE',
|
||||
remark varchar(500) null comment '备注',
|
||||
items_snapshot text null comment '订单项报价快照JSON',
|
||||
create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
|
||||
update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
|
||||
is_delete tinyint unsigned default 0 null comment '逻辑删除:0-未删,1-已删'
|
||||
)
|
||||
comment '订单询价报价交互消息表';
|
||||
|
||||
CALL sp_add_index_if_not_exists('t_order_quote_message', 'idx_order_quote_message_order_id', '(`order_id`, `is_delete`, `create_time`)');
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `t_messagehub_push_config` (
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键ID',
|
||||
`scene_code` varchar(80) NOT NULL COMMENT '业务场景编码',
|
||||
@@ -2422,7 +2466,8 @@ VALUES
|
||||
(313931273555139000, 'MAP', 'MAP_PROVIDER', '当前地图渠道', 'TENCENT', 1, 'TENCENT 或 AMAP;决定后台店铺选点默认使用哪个地图渠道', NOW(), NOW(), 0),
|
||||
(313931273555139001, 'MAP', 'TENCENT_MAP_KEY', '腾讯 Web Key', '', 0, '用于后台腾讯地图选点和 Web 展示;请在后台参数管理中填入真实 Key 后启用', NOW(), NOW(), 0),
|
||||
(313931273555139002, 'MAP', 'AMAP_WEB_KEY', '高德 Web Key', '', 0, '用于后台高德地图选点和 Web 展示;Web 端 Key 与小程序 Key 分开维护', NOW(), NOW(), 0),
|
||||
(313931273555139003, 'MAP', 'AMAP_MINI_KEY', '高德小程序 Key', '', 0, '用于后续小程序端高德 SDK/API 调用;不要与 Web Key 混用', NOW(), NOW(), 0)
|
||||
(313931273555139003, 'MAP', 'AMAP_MINI_KEY', '高德小程序 Key', '', 0, '用于后续小程序端高德 SDK/API 调用;不要与 Web Key 混用', NOW(), NOW(), 0),
|
||||
(313931273555139004, 'USER', 'DEFAULT_PASSWORD', '后台新增用户默认密码', 'Fingertip@123', 1, '后台新增用户不填写密码时使用;需满足 8-32 位且至少包含数字、小写字母、大写字母、特殊符号中的 3 类', NOW(), NOW(), 0)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
config_name = VALUES(config_name),
|
||||
remark = VALUES(remark),
|
||||
|
||||
Reference in New Issue
Block a user