SELECT 'Checking timezone' AS step;
SHOW timezone;

SELECT 'Checking UUID helper function' AS step;
SELECT proname
FROM pg_proc
WHERE proname = 'generate_uuid_v4';

SELECT 'Checking core tables' AS step;
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'
  AND table_name IN (
    'properties',
    'locations',
    'offices',
    'inquiries',
    'pages',
    'blog_posts',
    'seo_metadata',
    'custom_field_definitions',
    'property_custom_field_values'
  )
ORDER BY table_name;

SELECT 'Checking seeded lookups' AS step;
SELECT
  (SELECT count(*) FROM property_types) AS property_types_count,
  (SELECT count(*) FROM deal_types) AS deal_types_count,
  (SELECT count(*) FROM property_statuses) AS property_statuses_count,
  (SELECT count(*) FROM location_types) AS location_types_count,
  (SELECT count(*) FROM media_types) AS media_types_count,
  (SELECT count(*) FROM inquiry_types) AS inquiry_types_count,
  (SELECT count(*) FROM inquiry_statuses) AS inquiry_statuses_count,
  (SELECT count(*) FROM page_types) AS page_types_count;

SELECT 'Checking demo content' AS step;
SELECT ref_number, slug, is_active
FROM properties
WHERE ref_number = 'GR-DEMO-0001';

SELECT slug, is_published
FROM blog_posts
WHERE slug = '5-reasons-invest-greece';
