SELECT table_name
FROM information_schema.tables
WHERE table_schema = DATABASE()
  AND table_name = 'qipai_cleaning_task_members';

SELECT table_name, column_name
FROM information_schema.columns
WHERE table_schema = DATABASE()
  AND (
    (table_name = 'qipai_cleaning_task_members'
      AND column_name IN ('task_id', 'user_id', 'member_role', 'reward_cents', 'removed_at', 'settled_at'))
    OR (table_name = 'qipai_cleaning_settlement_items'
      AND column_name = 'cleaner_user_id')
  );

SELECT table_name, index_name
FROM information_schema.statistics
WHERE table_schema = DATABASE()
  AND table_name IN ('qipai_cleaning_task_members', 'qipai_cleaning_settlement_items')
  AND index_name IN (
    'uq_qipai_cleaning_task_member',
    'idx_qipai_cleaning_task_member_user',
    'idx_qipai_cleaning_task_member_task',
    'uq_qipai_cleaning_settlement_item_task_user',
    'uq_qipai_cleaning_settlement_active_share',
    'idx_qipai_cleaning_settlement_items_cleaner'
  )
GROUP BY table_name, index_name;

SELECT version, name
FROM qipai_schema_migrations
WHERE version = '2026062627';
