-- 详细诊断 mes_moentry 和 mes_morder 表的主键状态

USE aidopdev;

-- 1. 检查 mes_moentry 表结构
SHOW CREATE TABLE mes_moentry\G

-- 2. 检查 mes_morder 表结构
SHOW CREATE TABLE mes_morder\G

-- 3. 检查 mes_moentry 所有索引
SHOW INDEX FROM mes_moentry;

-- 4. 检查 mes_morder 所有索引
SHOW INDEX FROM mes_morder;

-- 5. 检查 mes_moentry 主键列
SELECT 
    COLUMN_NAME,
    COLUMN_KEY,
    EXTRA
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'aidopdev' 
  AND TABLE_NAME = 'mes_moentry'
  AND COLUMN_KEY = 'PRI';

-- 6. 检查 mes_morder 主键列
SELECT 
    COLUMN_NAME,
    COLUMN_KEY,
    EXTRA
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'aidopdev' 
  AND TABLE_NAME = 'mes_morder'
  AND COLUMN_KEY = 'PRI';
