<?php

/**
 * Migration 0053 — listing details (profile popup card)
 *
 * Profile deepening (Sergei 2026-07-24): the page keeps its short excerpt
 * (they look good); depth lives in a popup detail card. details is AUTHORED
 * text (services, hours, areas served; blank line = paragraph), rendered
 * into the DOM on the profile page (so it counts for SEO) and shown in a
 * custom overlay on demand. Same never-scrape rule as blurb.
 *
 * @since 2.1.2501
 */

if (!defined('ABSPATH')) exit;

return [
    'description' => 'directory_listings.details (authored popup-card content)',

    'up' => [],

    'php' => function () {
        $t = \Instinctor\Core\DB::prefix() . 'instinctor_directory_listings';
        $hasCol = (int) \Instinctor\Core\DB::get_var(\Instinctor\Core\DB::prepare(
            'SELECT COUNT(*) FROM information_schema.COLUMNS
             WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = %s AND COLUMN_NAME = %s',
            $t, 'details'
        )) > 0;
        if (!$hasCol) {
            \Instinctor\Core\DB::query("ALTER TABLE {$t} ADD COLUMN details text NULL DEFAULT NULL");
        }
    },
];
