SELECT CASE WHEN COUNT(*) = 0 THEN 1 ELSE 0 END AS ok
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
  AND TABLE_NAME IN ('qms_gcjyd', 'qms_gcjydzb')
  AND COLUMN_NAME = 'tenant_id'
  AND COLUMN_DEFAULT IS NOT NULL;
