ALTER TABLE `toktok_stores`.`user_focus` AUTO_INCREMENT = 12869323;
ALTER TABLE `toktok_stores`.`user_focus`
ADD UNIQUE INDEX `user_focus_user_index`(`user_id`, `focus_user_id`);

ALTER TABLE `toktok_stores`.`beer_blind_box`
DROP COLUMN `box_no`,
DROP COLUMN `title`,
DROP COLUMN `details`,
DROP COLUMN `beer_ids`,
ADD COLUMN `sub_id` bigint(20) NOT NULL COMMENT '主题id' AFTER `blind_box_id`,
MODIFY COLUMN `box_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '盲盒名' AFTER `blind_box_id`,
MODIFY COLUMN `cut_off_time` int(0) NOT NULL COMMENT '截止日期(<=28)' AFTER `box_name`;

ALTER TABLE `toktok_stores`.`beer_blind_box`
ADD COLUMN `sort` int(10) NOT NULL DEFAULT 0 COMMENT '排序' AFTER `status`;

ALTER TABLE `toktok_stores`.`price_manager`
ADD COLUMN `default_price` tinyint(3) NOT NULL DEFAULT 0 COMMENT '是否为默认价格' AFTER `price`;

ALTER TABLE `toktok_stores`.`beer_blind_box_detail`
CHANGE COLUMN `beer_ids` `sku_ids` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '盲盒内的商品id列表，多个之间用;分隔' AFTER `details`;

ALTER TABLE `toktok_stores`.`trade_order`
ADD COLUMN `num` int(0) NOT NULL DEFAULT 1 COMMENT '订单商品数量' AFTER `out_id`;

ALTER TABLE `toktok_stores`.`beer_box_order`
ADD COLUMN `price` int(10) NOT NULL DEFAULT 0 COMMENT '单个商品价格（分）' AFTER `num`;

ALTER TABLE `toktok_stores`.`beer_box_order`
ADD COLUMN `order_no` varchar(64) NOT NULL COMMENT '订单号' AFTER `box_no`;

ALTER TABLE `toktok_stores`.`beer_blind_box`
ADD COLUMN `curr_box_no` varchar(64) NOT NULL DEFAULT '' COMMENT '当前盲盒期数' AFTER `gmt_modified`;

ALTER TABLE `toktok_stores`.`user_address`
ADD COLUMN `status` tinyint(3) NOT NULL DEFAULT 1 COMMENT '状态' AFTER `is_default`;

ALTER TABLE `toktok_stores`.`user_address`
CHANGE COLUMN `is_default` `default_address` tinyint(3) NOT NULL DEFAULT 0 COMMENT '是否默认' AFTER `detail_address`;

ALTER TABLE `toktok_stores`.`user_address`
MODIFY COLUMN `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) AFTER `create_time`;

ALTER TABLE `toktok_stores`.`beer_box_order`
MODIFY COLUMN `gmt_modified` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间' AFTER `gmt_create`;

INSERT INTO `toktok_stores`.`sys_config`( `name`, `value`, `des`, `create_time`, `update_time`) VALUES ( 'district_controller', '202305231049', '地区版本', '2023-05-23 10:49:40', NULL);

ALTER TABLE `toktok_stores`.`beer_blind_box_detail`
ADD COLUMN `des` varchar(255) NULL COMMENT '订阅说明，多个之间用;分隔' AFTER `details`;

ALTER TABLE `toktok_stores`.`beer_box_order`
CHANGE COLUMN `addrress` `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '收货人地址' AFTER `phone`,
ADD COLUMN `user_address_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '收货地址id' AFTER `phone`;

ALTER TABLE `toktok_stores`.`beer_blind_box`
ADD COLUMN `box_detail_id` bigint(20) UNSIGNED NOT NULL COMMENT '盲盒详情id' AFTER `curr_box_no`;

ALTER TABLE `toktok_stores`.`subject`
ADD COLUMN `sub_logo` varchar(255) NOT NULL COMMENT '主题logo' AFTER `detail_bg`;

ALTER TABLE `toktok_stores`.`beer_box_order_split`
ADD COLUMN `box_name` varchar(64) NOT NULL DEFAULT '' COMMENT '盲盒名称' AFTER `status`,
ADD COLUMN `cut_off_time` datetime(0) NULL COMMENT '盲盒截止时间' AFTER `month`;

ALTER TABLE `toktok_stores`.`beer_box_node_log`
ADD COLUMN `bbos_id` bigint(20) NOT NULL COMMENT 'box_order_split_id' AFTER `beer_box_node_log_id`;

ALTER TABLE `toktok_stores`.`beer_box_order_split`
CHANGE COLUMN `box_order_split_id` `bbos_id` bigint(20) NOT NULL AUTO_INCREMENT FIRST,
DROP PRIMARY KEY,
ADD PRIMARY KEY (`bbos_id`) USING BTREE;

ALTER TABLE `toktok_stores`.`account_third_wechat`
ADD UNIQUE INDEX `account_id_index`(`account_id`);

ALTER TABLE `toktok_stores`.`message`
ADD COLUMN `status` tinyint(3) NOT NULL DEFAULT 0 COMMENT '状态，0未读，1已读' AFTER `jump_path`;

ALTER TABLE `toktok_stores`.`account_third_wechat`
DROP INDEX `account_id_index`,
ADD INDEX `account_id_index`(`account_id`) USING BTREE;

ALTER TABLE `toktok_stores`.`account_third_wechat`
ADD UNIQUE INDEX `account_id_and_type_index`(`account_id`, `type`) USING BTREE;

ALTER TABLE `toktok_stores`.`beer_box_order_split`
ADD COLUMN `consignee` varchar(40) NOT NULL DEFAULT '' COMMENT '收货人' AFTER `sku_id`,
ADD COLUMN `phone` varchar(40) NOT NULL DEFAULT '' COMMENT '收货人联系电话' AFTER `consignee`;

ALTER TABLE `toktok_stores`.`beer_blind_box`
ADD COLUMN `loop_type` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '盲盒活动循环类型' AFTER `sub_id`;

ALTER TABLE `toktok_stores`.`account_third_wechat`
DROP INDEX `unionId_index`,
ADD INDEX `unionId_index`(`unionid`) USING BTREE;

ALTER TABLE `toktok_stores`.`beer_box_order_split`
ADD COLUMN `update_address_flag` tinyint(3) NOT NULL DEFAULT 0 COMMENT '更改收货地址开关' AFTER `address`;

ALTER TABLE `toktok_stores`.`trade_order`
ADD UNIQUE INDEX `order_no_index`(`order_no`) COMMENT 'order_no唯一索引';