-- Verify that the M01-B core schema baseline exists.

SELECT table_name
FROM information_schema.tables
WHERE table_schema = DATABASE()
  AND table_name IN (
    'qipai_schema_migrations',
    'qipai_tenants',
    'qipai_stores',
    'qipai_rooms',
    'qipai_members',
    'qipai_orders',
    'qipai_payments',
    'qipai_devices',
    'qipai_audit_logs',
    'qipai_legacy_table_mappings'
  )
ORDER BY table_name;

SELECT table_name, column_name
FROM information_schema.columns
WHERE table_schema = DATABASE()
  AND table_name IN (
    'qipai_stores',
    'qipai_rooms',
    'qipai_members',
    'qipai_orders',
    'qipai_payments',
    'qipai_devices',
    'qipai_audit_logs'
  )
  AND column_name IN ('tenant_id', 'created_at', 'updated_at', 'deleted_at')
ORDER BY table_name, column_name;

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