package com.rongyichuang;
|
|
import org.junit.jupiter.api.Test;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import java.util.List;
|
import java.util.Map;
|
|
@SpringBootTest
|
public class CheckRatingItemTableStructureTest {
|
|
@Autowired
|
private JdbcTemplate jdbcTemplate;
|
|
@Test
|
public void checkTableStructure() {
|
System.out.println("=== 检查 t_activity_player_rating_item 表结构 ===");
|
|
String sql = "DESCRIBE t_activity_player_rating_item";
|
List<Map<String, Object>> columns = jdbcTemplate.queryForList(sql);
|
|
for (Map<String, Object> column : columns) {
|
System.out.println("字段: " + column.get("Field") +
|
", 类型: " + column.get("Type") +
|
", 是否为空: " + column.get("Null") +
|
", 键: " + column.get("Key") +
|
", 默认值: " + column.get("Default"));
|
}
|
|
// 检查是否存在remark字段
|
boolean hasRemarkField = columns.stream()
|
.anyMatch(column -> "remark".equals(column.get("Field")));
|
System.out.println("是否存在remark字段: " + hasRemarkField);
|
}
|
}
|