fuyuan/sql/update.sql

73 lines
5.2 KiB
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

##2023-07-27线 begin #####################################################################
-- 增加抖音小程序appid和secret配置 wuyl
INSERT INTO `la_system_config`(`type`, `name`, `value`, `create_time`, `update_time`) select 'byte_channel', 'appId', 'ttf331858c6c0d199a01', 0, 0 where not exists(select * from la_system_config where type='byte_channel' and name='appId');
INSERT INTO `la_system_config`(`type`, `name`, `value`, `create_time`, `update_time`) select 'byte_channel', 'secret', '1ea98029efc4d830483a0dabd3242cd4e84fd493', 0, 0 where not exists(select * from la_system_config where type='byte_channel' and name='secret');
alter table la_order add column latitude varchar(16) default NULL COMMENT '纬度' after address;
alter table la_order add column longitude varchar(16) default NULL COMMENT '经度' after address;
alter table la_user add column is_new tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否新用户: [0=否, 1=是]';
alter table la_user add column money decimal(10,2) DEFAULT '0.00' COMMENT '钱包余额';
CREATE TABLE IF NOT EXISTS `la_recharge_order` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`user_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户ID',
`order_sn` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '订单编号',
`pay_sn` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付编号',
`pay_way` tinyint(2) UNSIGNED NOT NULL DEFAULT 2 COMMENT '支付方式: [2=微信支付, 3=支付宝支付]',
`pay_status` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '支付状态: [0=待支付, 1=已支付]',
`pay_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '支付时间',
`order_amount` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '充值金额',
`order_terminal` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '下单终端',
`transaction_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '交易流水',
`refund_status` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '退款状态: [0=未退款 , 1=已退款]',
`create_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
`delete_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
`pay_channel` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
`cancel_time` int(10) UNSIGNED NOT NULL DEFAULT 0,
`order_status` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '充值余额订单表' ROW_FORMAT = Dynamic;
INSERT INTO `la_system_config`(`type`, `name`, `value`, `create_time`, `update_time`) SELECT 'recharge', 'rechargeOpen', '1', 1688729296, 1688729296 where not exists(select * from la_system_config where type='recharge' and name='rechargeOpen');
INSERT INTO `la_system_config`(`type`, `name`, `value`, `create_time`, `update_time`) SELECT 'recharge', 'minRechargeAmount', '0', 1688729296, 1688729296 where not exists(select * from la_system_config where type='recharge' and name='minRechargeAmount');
-- 服务区域相关的表的更改 csq
-- - 新增服务表 -
create table IF NOT EXISTS la_service_area
(
id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id'
primary key,
name varchar(64) not null comment '名称',
region_id bigint(20) not null comment '关联的地区主键id',
longitude varchar(24) null comment '定位纬度',
latitude varchar(24) null comment '定位经度',
create_time int(10) NOT NULL DEFAULT 0 COMMENT '创建时间',
update_time int(10) NOT NULL DEFAULT 0 comment '更新时间',
polygongeo polygon not null comment '服务范围多边形数据',
is_delete tinyint(1) NULL DEFAULT 0 COMMENT '是否删除 1是 0',
INDEX region_id (region_id) USING BTREE
)
comment '服务区表' collate = utf8mb4_general_ci
row_format = DYNAMIC;
-- - 新增 服务区表与师傅关联表 -
create table IF NOT EXISTS la_service_area_staff
(
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id' primary key,
service_area_id bigint(20) not null comment '服务区域主键id',
staff_id bigint(20) not null comment '师傅主键id',
create_time int(10) NOT NULL DEFAULT 0 COMMENT '创建时间',
update_time int(10) NOT NULL DEFAULT 0 comment '更新时间',
INDEX service_area_id (service_area_id) USING BTREE,
INDEX staff_id (staff_id) USING BTREE
)
comment '服务区表-师傅关联表' collate = utf8mb4_general_ci
row_format = DYNAMIC;
-- - 修改 地址表新增服务区域id关联服务区域表
alter table la_user_address Add column service_area_id bigint(20) DEFAULT 0 COMMENT '地址所在服务区域主键id' AFTER latitude;
-- - 修改 订单表 新增服务区域id关联服务区域表
alter table la_order Add column service_area_id bigint(20) DEFAULT 0 COMMENT '地址所在服务区域主键id' AFTER latitude;
##2023-07-27线 end #######################################################################