-- Public directory MVP listings table.
CREATE TABLE IF NOT EXISTS directory_listings (
  id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  business_name VARCHAR(160) NOT NULL,
  category VARCHAR(80) NOT NULL,
  description TEXT NOT NULL,
  address VARCHAR(180) NOT NULL,
  city VARCHAR(90) NOT NULL,
  region VARCHAR(90) NOT NULL,
  postal_code VARCHAR(24) DEFAULT NULL,
  phone VARCHAR(40) DEFAULT NULL,
  email VARCHAR(160) NOT NULL,
  website VARCHAR(220) DEFAULT NULL,
  hours VARCHAR(220) DEFAULT NULL,
  owner_name VARCHAR(140) NOT NULL,
  status ENUM('pending','approved') NOT NULL DEFAULT 'pending',
  is_claimable TINYINT(1) NOT NULL DEFAULT 1,
  created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  INDEX idx_directory_category (category),
  INDEX idx_directory_location (city, region),
  INDEX idx_directory_status (status),
  FULLTEXT INDEX ft_directory_search (business_name, category, description, address, city, region)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
