<?php

/**
 * Migration 0016 — Per-device page thumbnails
 *
 * Adds `thumbnail_tablet` + `thumbnail_mobile` columns alongside the existing
 * `thumbnail` (which represents the desktop view). Marketing surfaces like the
 * gig_grid block render a <picture> element with per-viewport sources, so a
 * mobile visitor sees the page captured at mobile aspect (9:16) instead of
 * a desktop screenshot squished into a portrait card.
 *
 * The screenshot capture pipeline (admin/views/impulse-preview.php +
 * assets/js/admin/instinctor-admin-core.js) populates the new columns as
 * pages are saved at each device viewport. Until the multi-device capture
 * orchestration ships, the columns stay empty and the renderer falls back
 * to the desktop thumbnail.
 *
 * @since 2.1.569
 */

if (!defined('ABSPATH')) exit;
return [
    'description' => 'Per-device page thumbnails (tablet + mobile)',

    'up' => [
        "ALTER TABLE {prefix}instinctor_pages
            ADD COLUMN thumbnail_tablet VARCHAR(512) NOT NULL DEFAULT '' AFTER thumbnail,
            ADD COLUMN thumbnail_mobile VARCHAR(512) NOT NULL DEFAULT '' AFTER thumbnail_tablet",
    ],

    'down' => [
        "ALTER TABLE {prefix}instinctor_pages
            DROP COLUMN thumbnail_mobile,
            DROP COLUMN thumbnail_tablet",
    ],
];
