- 添加数据库迁移脚本,为 play_clerk_level_info 表新增 order_number 字段 - 更新测试数据种子,设置默认等级的排序号 - 新增店员用户API测试,验证按等级排序号和在线状态的排序逻辑
This commit is contained in:
@@ -259,6 +259,7 @@ public class ApiTestDataSeeder implements CommandLineRunner {
|
||||
entity.setNotFirstRandomRadio(45);
|
||||
entity.setFirstRewardRatio(40);
|
||||
entity.setNotFirstRewardRatio(35);
|
||||
entity.setOrderNumber(1L);
|
||||
clerkLevelInfoService.save(entity);
|
||||
log.info("Inserted API test clerk level {}", DEFAULT_CLERK_LEVEL_ID);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
SET @column_exists := (
|
||||
SELECT COUNT(*)
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'play_clerk_level_info'
|
||||
AND COLUMN_NAME = 'order_number'
|
||||
);
|
||||
|
||||
SET @ddl := IF(
|
||||
@column_exists = 0,
|
||||
'ALTER TABLE `play_clerk_level_info` ADD COLUMN `order_number` bigint NULL COMMENT ''等级排序号''',
|
||||
'SELECT 1'
|
||||
);
|
||||
|
||||
PREPARE stmt FROM @ddl;
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
|
||||
UPDATE `play_clerk_level_info`
|
||||
SET `order_number` = COALESCE(`order_number`, `level`);
|
||||
Reference in New Issue
Block a user