SET FOREIGN_KEY_CHECKS=0;

ALTER TABLE `cardservice`.`card_black_sheet` ADD INDEX `IX_projectNo_parkId`(`project_no` ASC, `park_id` ASC) USING BTREE;

ALTER TABLE `cardservice`.`card_long_lease_apply` ADD INDEX `IX_projectNo_parkId`(`project_no` ASC, `park_id` ASC) USING BTREE;

ALTER TABLE `cardservice`.`card_long_lease_apply_approve_record` ADD INDEX `IX_projectNo_parkId`(`project_no` ASC, `park_id` ASC) USING BTREE;

ALTER TABLE `cardservice`.`card_long_lease_apply_approve_record` ADD INDEX `IX_projectNo_applyId`(`project_no` ASC, `apply_id` ASC) USING BTREE;

ALTER TABLE `cardservice`.`card_long_lease_apply_car` ADD INDEX `IX_applyId`(`apply_id` ASC) USING BTREE;

ALTER TABLE `cardservice`.`card_long_lease_apply_file` ADD INDEX `IX_applyId`(`apply_id` ASC) USING BTREE;

ALTER TABLE `cardservice`.`card_long_lease_channel_relation` DROP INDEX `idx_lease_long_id`;

ALTER TABLE `cardservice`.`card_long_lease_channel_relation` ADD INDEX `IX_longLeaseId`(`long_lease_id` ASC) USING BTREE;

ALTER TABLE `cardservice`.`card_long_lease_date_detail` DROP INDEX `idx_long_lease_id`;

ALTER TABLE `cardservice`.`card_long_lease_date_detail` ADD INDEX `IX_longLeaseId`(`long_lease_id` ASC) USING BTREE;

ALTER TABLE `cardservice`.`card_long_lease_enterprise_park_relation` DROP INDEX `idx_long_lease_id`;

ALTER TABLE `cardservice`.`card_long_lease_enterprise_park_relation` ADD INDEX `IX_longleaseId`(`long_lease_id` ASC) USING BTREE;

ALTER TABLE `cardservice`.`card_long_lease_info` DROP INDEX `IX_CardId`;

ALTER TABLE `cardservice`.`card_long_lease_info` MODIFY COLUMN `plate_no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '冗余当前固定套餐关联车牌；多个使用逗号分隔，最多存储10个；当前套餐车牌变更时，也要同步变更该字段；' AFTER `credential_type`;

ALTER TABLE `cardservice`.`card_long_lease_info` MODIFY COLUMN `card_no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '冗余当前固定套餐关联卡号；多个使用逗号分隔，最多存储10个；当前套餐卡号变更时，也要同步变更该字段；' AFTER `plate_no`;

ALTER TABLE `cardservice`.`card_long_lease_info` MODIFY COLUMN `source` int NULL DEFAULT 4 COMMENT '月卡来源' AFTER `stagger_flag`;

ALTER TABLE `cardservice`.`card_long_lease_info` ADD UNIQUE INDEX `IX_CardId`(`card_id` ASC) USING BTREE;

ALTER TABLE `cardservice`.`card_long_lease_info` ADD INDEX `IX_Customer_no`(`customer_no` ASC) USING BTREE;

ALTER TABLE `cardservice`.`card_long_lease_member_relation` ADD INDEX `IX_memberId`(`member_id` ASC) USING BTREE;

ALTER TABLE `cardservice`.`card_long_lease_pay_order_record` ADD INDEX `IX_paymentOrderId`(`payment_order_id` ASC) USING BTREE;

ALTER TABLE `cardservice`.`card_long_lease_plate_relation` DROP INDEX `idx_long_lease_id`;

ALTER TABLE `cardservice`.`card_long_lease_plate_relation` ADD INDEX `IX_longLeaseId`(`long_lease_id` ASC) USING BTREE;

ALTER TABLE `cardservice`.`card_long_lease_plate_relation` ADD INDEX `IX_projectNo_parkId`(`project_no` ASC, `park_id` ASC) USING BTREE;

ALTER TABLE `cardservice`.`card_type_enterprise_temp_standard` ROW_FORMAT = DYNAMIC;

ALTER TABLE `cardservice`.`card_type_enterprise_temp_standard_detail` ROW_FORMAT = DYNAMIC;

ALTER TABLE `cardservice`.`card_type_enterprise_temp_standard_detail` MODIFY COLUMN `model_value` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '模版配置value' AFTER `model_key`;

ALTER TABLE `cardservice`.`card_type_info` ADD INDEX `IX_projectNo`(`project_no` ASC) USING BTREE;

ALTER TABLE `cardservice`.`card_type_info` ADD INDEX `IX_parkId_code`(`park_id` ASC, `card_type_code` ASC) USING BTREE;

ALTER TABLE `cardservice`.`stored_value_account` COLLATE = utf8mb4_0900_ai_ci;

ALTER TABLE `cardservice`.`stored_value_account` MODIFY COLUMN `park_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '车场ID' AFTER `project_no`;

ALTER TABLE `cardservice`.`stored_value_account` MODIFY COLUMN `offline_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '线下账户ID' AFTER `park_id`;

ALTER TABLE `cardservice`.`stored_value_account` MODIFY COLUMN `plate_no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '冗余关联车牌,多个使用逗号分隔' AFTER `offline_id`;

ALTER TABLE `cardservice`.`stored_value_account` MODIFY COLUMN `invoice_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '发票抬头' AFTER `status`;

ALTER TABLE `cardservice`.`stored_value_account` MODIFY COLUMN `taxnum` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '税号' AFTER `invoice_title`;

ALTER TABLE `cardservice`.`stored_value_account` MODIFY COLUMN `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '邮箱' AFTER `taxnum`;

ALTER TABLE `cardservice`.`stored_value_account` MODIFY COLUMN `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注' AFTER `email`;

ALTER TABLE `cardservice`.`stored_value_account` MODIFY COLUMN `create_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人' AFTER `remark`;

ALTER TABLE `cardservice`.`stored_value_account` MODIFY COLUMN `update_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '修改人' AFTER `create_time`;

ALTER TABLE `cardservice`.`stored_value_plate_relation` COLLATE = utf8mb4_0900_ai_ci;

ALTER TABLE `cardservice`.`stored_value_plate_relation` MODIFY COLUMN `project_no` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目ID' AFTER `id`;

ALTER TABLE `cardservice`.`stored_value_plate_relation` MODIFY COLUMN `park_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '车场ID' AFTER `project_no`;

ALTER TABLE `cardservice`.`stored_value_plate_relation` MODIFY COLUMN `plate_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '车牌' AFTER `stored_id`;

ALTER TABLE `cardservice`.`stored_value_plate_relation` MODIFY COLUMN `car_model` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '车辆型号类型' AFTER `plate_color`;

ALTER TABLE `cardservice`.`stored_value_plate_relation` MODIFY COLUMN `brand` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '品牌' AFTER `car_type`;

ALTER TABLE `cardservice`.`stored_value_plate_relation` MODIFY COLUMN `car_colour` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '车辆颜色' AFTER `brand`;

ALTER TABLE `cardservice`.`stored_value_plate_relation` MODIFY COLUMN `create_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人' AFTER `car_colour`;

ALTER TABLE `cardservice`.`stored_value_plate_relation` MODIFY COLUMN `update_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '修改人' AFTER `create_time`;

SET FOREIGN_KEY_CHECKS=1;