SELECT table_name
FROM information_schema.tables
WHERE table_schema = DATABASE()
  AND table_name IN ('qipai_cleaning_settlements', 'qipai_cleaning_settlement_items');

SELECT column_name
FROM information_schema.columns
WHERE table_schema = DATABASE()
  AND table_name = 'qipai_cleaning_settlements'
  AND column_name IN (
    'settlement_no', 'cleaner_user_id', 'status', 'task_count',
    'total_reward_cents', 'period_start', 'period_end', 'confirmed_at', 'paid_at'
  );

SELECT index_name
FROM information_schema.statistics
WHERE table_schema = DATABASE()
  AND table_name IN ('qipai_cleaning_settlements', 'qipai_cleaning_settlement_items')
  AND index_name IN (
    'uq_qipai_cleaning_settlement_no',
    'idx_qipai_cleaning_settlement_cleaner',
    'idx_qipai_cleaning_settlement_store',
    'uq_qipai_cleaning_settlement_item_task',
    'idx_qipai_cleaning_settlement_items_parent'
  );

SELECT code
FROM qipai_permissions
WHERE code IN ('cleaning.settlement.read', 'cleaning.settlement.write');

SELECT version
FROM qipai_schema_migrations
WHERE version = '2026062626';
